[tree-ssa] Re: PATCH: [gcc3.5 improvement branch] Very Simple constant propagation

Jan Hubicka jh@suse.cz
Fri Jan 16 00:18:00 GMT 2004


> 
> On Jan 15, 2004, at 3:28 PM, Jan Hubicka wrote:
> [caroline's example:]
> >>>The test code for this problem is:
> >>>
> >>>float *a, *b;
> >>>
> >>>float  foo () {
> >>>  int i;
> >>>  float sum = 1.0;
> >>>  for (i = 0; i < 4; i++)
> >>>     sum *= a[i]/b[i];
> >>>}
> >And here is proposed patch.
> >Bootstrap/regress on i386 in progress, OK if it passes?
> 
> I doubt it.  The point of the code you're removing is to replace the 
> division
> with multiplication inside the loop in cases like this (-ffast-math):
> 
> extern void bar(double);
> void foo(float b) {
>    int i;
>    for (i=0; i<10; i++)
>      bar(i/b);
> }
> 
> Your patch fixes Caroline's example, but I suspect it breaks this one.

Yes, I invented that code some time ago.  I really think that in
post-SSA world we should not do the trick on RTL.  Perhaps the patch
would need to wait for SSA equivalent of this transform that I can do
soon if this is considered important feature.
Dom doesn't have def-use chains readilly available, right?

Honza



More information about the Gcc-patches mailing list