[Bug tree-optimization/62217] DOM confuses complete unrolling which in turn causes VRP to warn
kyukhin at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Aug 22 07:45:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62217
--- Comment #3 from Kirill Yukhin <kyukhin at gcc dot gnu.org> ---
As long as I understand `remove_exits_and_undefined_stmts'
iterate loop boundaries set marking `unreachable' stmts w/
impossible bounds.
For the example we have:
- for true edge
basic block 6, loop depth 1
pred: 5
g_x[b_6(D)] = *x1_7(D);
goto <bb 8>;
succ: 8
- for false edge
basic block 7, loop depth 1
pred: 5
g_x[i_14] = *x2_9(D);
succ: 8
I suspect, that the problem is that `b' was propagated along
`true' edge and replaced use of `i'.
This removed reference to g_x from boundaries analysis for that edge:
no IV is used there explicitly, only implicitly as b == i.
Hence this stmt didn't hit boundaries set of the loop and
wasn't marked as unreachable.
BTW: this code survive rest of optimizations:
movl (%edx), %edx
cmpl $4, %eax
movl %edx, g_x+12
jle .L1
movl (%ebx), %eax
movl %eax, g_x+16 ;; REDUNDANT
Looks like not simple warning, but also unnecessary code was
generated.
More information about the Gcc-bugs
mailing list