The leading advocate of moderation in Poland's Communist hierarchy came under surprise public attack in Warsaw yesterday amid indications of growing economic and political difficulties confronting party leader Edward Gierek's regime.

The attack on Mieczeslaw Rabowski, member of the Communist party central committee and long-time editor-in-chief of the largest Polish weekly newspaper Polytika, was made by an obscure academic associated with the party's higher political school. But it took on greater significance because it appeared in the party-controlled mass circulation daily Zycie Warszawy.

The attack on the internationally known figure thus caused a sensation among knowledgeable Poles and Western observers both in Poland and abroad.

Attack such as that do not come without authorization of high party authorities. Rakowski, however, has been a close political associate of Gierek.

U.S. analysts here viewed the incident as another indication of Gierek's growing difficulties in holding the reins of power as Poland's economic situation continues to deteriorate with no relief in sight.

Last week Gierek held a two-hour conference with Stefan Cardinal Wyszynski, the Polish primate, in an effort to gain support from the powerful Polish Roman Catholic Church. It was the first such meeting since Gierek assumed power seven years ago.

The severe food and fuel shortages and the Gierek regime's apparent inability to resolve them have reportedly created a split in the party leadership. Two workers uprisings over unpopular government measures and meat-and-potato issues brought down governments in 1956 and 1970.

Yesterday's attack on Rakowski appeared to have been orchestrated by the conservative elements in the leadership, presumably such men as Politburo members Jan Sidlak , Josef Kepa and Jerzy Lukaszewlez.

Rakowski, who last week wrote an article in warning against excessive economic centralization, has advocated introduction of greater flexibility in Poland's Soviet-style economy. He had advocated measures that would increase intitiative and personal responsibility of workers and argued that "the way out of our problems" is greater decentralization.

In an attack that went far beyond the normal polemics, Rakowski was accused yesterday of lacking "faith in the potential of our socialist state shose buding force is the party," Zycle Warzsawy also charged that Rakowski's views "would not be acceptable to the working people" and that they would lead to a "distortion of the fundamental principles of democratic centralism."

The latter is a charge of revisionaism, one of the cardial sins in Communist ideology.

Diplomatic observers said the attack on Rakowski was in fact a conservative challenge to Gierek's current policy of conciliation toward the church and Poland's dissident community.

Gierek's political fortunes have been declining since last year when his government's announcement of food price increases produced violent resistance by workers. By quickly reversing the decision, Gierek managed to avoid the kind of violence that led to a workers revilt in 1970 and brought down his predecessor, Wladyslaw Gomulka.

Poland's basic problem has remained the same. Except that unlike Gomulka, who did not believe in contracting foreign debts, Gierek ventured into the Western capital markets in a big way. An estimated $7 billion in various types of loans has been raised by Poland in the past seven years.

Gierek's borrowing initially created a measure of prosperity. But the government continued to subsidize prices on all basic commodities, unable to put the economy on a sound footing for fear that price increases would produce popular unrest.

Rakowski's argument for greater decentralization reflects the thinking of moderate men around Gierek who have argued in favor of a meaningful economic reform as a way of correcting massive price discrepancies and increasing labor productivity.

Although close to Gierek, Rakowski has made many enemies among the party leaders because of his exposed position as editor of the country's largest weekly newspaper.

Responses of moderate elements to yesterday's attack are expected to clarify Gierek's position and his personal authority in the coming weeks.