------- Comment #6 from rguenther at suse dot de 2010-05-10 08:41 ------- Subject: Re: Optimizing integer power
On Sun, 9 May 2010, dfranke at gcc dot gnu dot org wrote: > ------- Comment #4 from dfranke at gcc dot gnu dot org 2010-05-09 21:08 > ------- > Situation still the same with gcc version 4.6.0 20100509 (experimental) (GCC). > > (In reply to comment #1) > > ... this asks for a POW_EXPR middle-end tree I guess. Or you can use > > builtins.c:expand_powi* do generate an expanded power series. > > Would that be enough of a gain to be worth the effort? If the Fortran standard allows integer powers to be expanded as power series by default then I would say yes (at least for non-constant power, for constant power one needs to compare generated code - the frontend does the power series expansion manually in this case, no?). Richard. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39280