This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Loop Optimizer Deficiency revisited
- From: Zack Weinberg <zack at codesourcery dot com>
- To: "Nitin Gupta" <ngupta at GlobespanVirata dot com>, Daniel Berlin<dberlin at dberlin dot org>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Fri, 21 Mar 2003 09:42:09 -0800
- Subject: Re: Loop Optimizer Deficiency revisited
- References: <IDEAKDGJLGFCFODOJGGIOEOLCAAA.ngupta@globespanvirata.com>
"Nitin Gupta" <ngupta at GlobespanVirata dot com> writes:
> Hi,
> I'm experimenting with sparlet build of
> GCC 3.2 released. I could reproduce the first
> problem mentioned under section "More pathetic
> failures of loop optimization" in
> http://gcc.gnu.org/projects/optimize.html#pathetic-loop
> with the following piece of code.
>
> void badopt ( unsigned long ) ;
> void badopt(
> unsigned long l
> ) {
>
> long ad ;
> long i ;
>
> ad = l;
>
> while( ( (*((volatile unsigned long * ) (ad | 0x00007800)))/4) < 1 ) {
> i = 1000 ;
> while( --i ) ;
> }
> }
I don't like the looks of what you're doing with pointers here. It is
likely that GCC will never be able to optimize this very well.
> This problem is there with the i386 build of 3.2.
> The problem does not reproduce with 2.96 or earlier versions.
>
> I could locate the Zack mail when he reported this problem
> http://gcc.gnu.org/ml/gcc-patches/2000-02/msg00408.html. But could
> not find any reference of the problem beyond that.
>
> Please help in locating the furthur work done on the problem.
> If required, I would be like to contribute towards the fix of
> the problem.
I do not believe any work has been done specifically on that problem.
However, it is likely to be addressed by completing the store-motion
pass, which has never worked properly. If you would like to help with
that, talk to Daniel Berlin (cc:ed).
zw