[Bug tree-optimization/78731] Possible bug with switch when optimization is turned on.
wilson at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Dec 8 06:19:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78731
Jim Wilson <wilson at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2016-12-08
Version|5.4.1 |5.4.0
Ever confirmed|0 |1
--- Comment #1 from Jim Wilson <wilson at gcc dot gnu.org> ---
I can reproduce with gcc-5.4 on x86_64 and aarch64. But not with gcc-6.
The problem appears in the dom2 tree dump, where the switch statement is
optimized incorrectly.
git bisect tracked the fix down to a patch from Jeff Law. However, this patch
appears to be an optimization, not a bug fix, so it isn't obvious why it fixes
the problem. I haven't tried debugging dom to see what the problem is yet.
Jeff's patch is
https://gcc.gnu.org/ml/gcc-patches/2015-09/msg02391.html
2015-09-30 Jeff Law <law@redhat.com>
* tree-ssa-dom.c (optimize_stmt): Collapse control flow statements
with constant conditions.
* tree-ssa-threadupdate.c (remove_jump_threads_starting_at): New.
(remove_ctrl_stmt_and_useless_edges): No longer static.
* tree-ssa-threadupdate.h (remove_jump_threads_starting_at): Prototype.
(remove_ctrl_stmt_and_useless_edges): Likewise.
On the main branch, the first good git revision is
f1344f45994243478b1f4225e676446fedf18bf5. The last bad git revision is
a4f58df11093c1253f9648e0ffa7fbdf604d05c2.
More information about the Gcc-bugs
mailing list