This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/53128] [4.8 Regression] Compiler produces infinite loop on regular O2
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 03 May 2012 16:02:56 +0000
- Subject: [Bug tree-optimization/53128] [4.8 Regression] Compiler produces infinite loop on regular O2
- Auto-submitted: auto-generated
- References: <bug-53128-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53128
Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu.org
--- Comment #5 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2012-05-03 16:02:56 UTC ---
(In reply to comment #4)
> Isn't it too aggressive from user perspective to perform such transformation
> even without warning? Especially for the case when that "wrong" read is not
> used later.
> Sure it is dangerous anyway to make such access but at he same time it seems
> this could affect lot of existing code...
Igor, I guess the compiler only sees something like:
x = 14
if (x < 13) do_A(); else do_B();
and transform it into:
do_A();
It doesn't see that an infinite loop is generated. Now, whether there could be
an optimization pass that detects infinite loops, and warns for them, that I am
not sure, but surely it would be a nice thing to have. If someone contributed a
nice implementation, I think it will be accepted. Unfortunately, I don't think
it is in the TODO list of any current contributor.