This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/19790] equality not noticed when signedness differs.
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jul 2008 12:20:52 -0000
- Subject: [Bug tree-optimization/19790] equality not noticed when signedness differs.
- References: <bug-19790-5009@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from rguenth at gcc dot gnu dot org 2008-07-06 12:20 -------
So we can optimize
void __attribute__((noinline))
bar (int i)
{
asm ("");
}
extern void link_error (void);
void
foo (void)
{
int i;
for (i = 0; i <= 320; i++)
{
bar (i);
if (i > 320)
link_error ();
}
}
but not
void __attribute__((noinline))
bar (int i)
{
asm ("");
}
extern void link_error (void);
void
foo (void)
{
int i, j = 2;
for (i = 0; i <= 320; i++)
{
j++;
bar (j);
if (j > 322)
link_error ();
}
}
even with the niter computation hunk restored from the PR34244 patch.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19790