https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117965
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=116821 --- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> --- so obvious my fix is wrong as shown by other stuff. But I think the problem is 2 fold really. One is I think phivn_valid_p is too restrictive. The second is we are still missing a PRE for things like: ``` int f(int a, int b, int c, int x) { int *d; int e; if (a < b) { d = &a; e = a; } else { d = &b; e = b; } if (x > e) d = d; else d = &x; return *d + e; } ``` If we change it to: ``` int f(int a, int b, int c, int x) { int *d; int e; if (a < b) { d = &a; e = a; } else { d = &b; e = b; } e = *d; if (x > *d) d = d; else d = &x; return *d + e; } ``` The above is optimized due to the VN in phiprop. So the VN is in phiprop is useful but maybe wrong. Let me come back to this problem next week or so. I still need to come back to the other wrong code dealing with phiprop too.