[PATCH] Fix tree-opt/22037, ICE not renaming a VOP
Jeffrey A Law
law@redhat.com
Wed Jul 13 18:11:00 GMT 2005
On Mon, 2005-07-04 at 06:37 -0400, Andrew Pinski wrote:
> The problem here is that we copy propagate a constant into a builtin
> but we don't
> (and cannot) rename the vops as we are doing this optimization in
> tree-cfg when
> merging two basic blocks.
> This patch fixes the problem by creating a variable for that PHI if it
> is a
> constant so we don't fold the builtin.
>
> OK? Bootstrapped and tested on powerpc-darwin with no regressions.
>
> Thanks,
> Andrew Pinski
>
>
> Testcase:
> extern double sqrt (double);
>
> void foo(double *d, int n)
> {
> double e=0;
> for(int i=0; i<n; i++);
> for(int i=0; i<n; i++) e=1;
> *d = sqrt(e);
>
> for(int i=0; i<n; i++);
> }
Your patch for this looks way too conservative -- shouldn't
you only prevent propagation of constants into uses of virtual
operands?
Or am I missing something?
Jeff
More information about the Gcc-patches
mailing list