This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/34114] Missed optimization: cannot determine loop termination
- From: "rakdver at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Nov 2007 02:38:02 -0000
- Subject: [Bug tree-optimization/34114] Missed optimization: cannot determine loop termination
- References: <bug-34114-6477@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from rakdver at gcc dot gnu dot org 2007-11-16 02:38 -------
(In reply to comment #2)
> Is there be any way to modify the code such that GCC would have an easier time
> seeing this? I tried using 'assert(rnd_to_2 % 2 == 0)' (since glibc's
> __assert_fail is marked with noreturn I thought it might help), but that didn't
> seem to have an effect.
As a workaround, you may change the type of i and rnd_to_2 to signed (signed
arithmetics in C is guaranteed not to overflow, and loop optimizer will use
this to prove that the loop is finite).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34114