[Bug tree-optimization/116823] phiprop should ignore clobbers

2024-09-23 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116823 --- Comment #5 from Andrew Pinski --- Here is a reduced testcase for fold-const.cc case: ``` struct s2 { int i; s2(const int &a) : i (a) {} }; int h(s2 b); int g(int l, int r) { return h(l > r ? l : r); } ``` Which shows up since r6-68

[Bug tree-optimization/116823] phiprop should ignore clobbers

2024-09-23 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116823 --- Comment #4 from Andrew Pinski --- And yes this shows up in GCC itself. >From fold-const.cc: ``` if (lr_bitpos.2401_412 < rr_bitpos.2402_413) goto ; [INV] else goto ; [INV] : : # iftmp.2400_515 = PHI <&lr_bitpos(196), &r

[Bug tree-optimization/116823] phiprop should ignore clobbers

2024-09-23 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116823 --- Comment #3 from Andrew Pinski --- Here is a testcase for a well defined case: ``` void f(int *); int g(int i, struct f *ff) { const int t = 10; const int *a; { int b; f(&b); if (t < i) a = &t; else a = &i;

[Bug tree-optimization/116823] phiprop should ignore clobbers

2024-09-23 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116823 --- Comment #2 from Andrew Pinski --- (In reply to Andrew Pinski from comment #1) > I have a simple patch which allows for this. > Basically we need to ignore clobbers in 2 places. Even though clobbers have a vdef, they have no effect on aliasi

[Bug tree-optimization/116823] phiprop should ignore clobbers

2024-09-23 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116823 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed|