[Bug tree-optimization/100511] Fail to remove dead code in loop

2021-05-11 Thread jiangning.liu at amperecomputing dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100511 --- Comment #5 from Jiangning Liu --- If we change "c3 = a" to "c3 = x->b", GCC can optimize it without IPA. It seems VRP is working for this case. $ cat tt7.c #include int a; typedef struct { int b; int count; } XX; int g; __attrib

[Bug tree-optimization/100511] Fail to remove dead code in loop

2021-05-11 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100511 --- Comment #4 from Richard Biener --- I don't see how we can say x->count is loop invariant, the GIMPLE memory model allows aliasing of 'g' via 'x->count' since the effective type of 'g' can be a struct XX (and the store via 'g' doesn't change

[Bug tree-optimization/100511] Fail to remove dead code in loop

2021-05-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100511 --- Comment #3 from Andrew Pinski --- (In reply to Jiangning Liu from comment #2) > Then why gcc can't optimize this case either? sizeof (XX) <> sizeof(g) here. The second case is a VRP issue which really should be filed seperately. -O3 case i

[Bug tree-optimization/100511] Fail to remove dead code in loop

2021-05-10 Thread jiangning.liu at amperecomputing dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100511 --- Comment #2 from Jiangning Liu --- Then why gcc can't optimize this case either? sizeof (XX) <> sizeof(g) here. #include int a; typedef struct { int b; int count; } XX; int g; __attribute__((noinline)) void f(XX *x) { int c1

[Bug tree-optimization/100511] Fail to remove dead code in loop

2021-05-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100511 Andrew Pinski changed: What|Removed |Added Keywords||alias, missed-optimization Se