This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: new problems with "-fforce-addr"


> On Wed, Oct 03, 2007 at 09:55:49AM +0200, Manfred Schwarb wrote:
> > Hi,
> > 
> > In contrary to my mail on September 1, my problem seems still to be
> present.
> > This time in another library, but I encounter the very same symptoms
> (gfortran of yesterday).
> > gfortran -O3 -march=pentium4 -mfpmath=sse -msse3 is OK,
> > gfortran -O3 -march=pentium4 -mfpmath=sse -msse3 -fforce-addr produces
> wrong code.
> > 
> > Again "-fforce-addr" in combination with "-O1" is OK, and output of
> -fdump-tree-optimized of the
> > broken one is identical to the working one.
> > As this is the second time I encounter this, it happens only with some
> combination of optimization
> > and other compilers don't have problems to compile this code, I think
> it's a real bug in gcc/gfortran.
> > 
> > If nobody on this list has an idea how to narrow this issue, I will post
> an mail to gcc@, as perhaps 
> > it is not frontend related, but some more general optimization issue.
> > 
> > Regards,
> > Manfred
> 
> Given the description
> 
> `-fforce-addr'
>      Force memory address constants to be copied into registers before
>      doing arithmetic on them.
>  
> Whatever you're seeing is a probably a middle or backend problem.
> 
> What does this option buy you?  Faster execution?  Does the
> problem occur with -O2 because with my codes the difference
> between -O2 and -O3 is in the noise?
> 

I went back and re-read my earlier postings, and made some additional
trials. The minimum flag combination is
"gfortran -O2 -march=pentium4 -fforce-addr"
-march=pentium4 is needed to trigger, and indeed "-O2" is sufficient.

And yes, "-fforce-addr" gives some minor speedup in the range of
some very few percents. As I spend cpu-hours per day with such programs,
I thought it was worth it. Well, probably not.

Meanwhile it's http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33638
(It's assigned to middle-end at the moment)

Thanks,
Manfred

BTW: for this particular program, gfortran is about 40% faster in
execution time than g95 :-)

PS2: No, my experience is that "-O3" in combination with the proper
march-setting is not in the noise, sometimes it really makes the
difference.

PS3: but for me all these tree-vectorize things are really in the noise,
the increase in the size of the executable is simply not worth it.


> 
> -- 
> Steve

-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]