This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/30322] ((-i-1) + i) +1) is turned into ~i + (i+1) and never into 0 on the tree level
- 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: 5 Jan 2007 16:30:46 -0000
- Subject: [Bug middle-end/30322] ((-i-1) + i) +1) is turned into ~i + (i+1) and never into 0 on the tree level
- References: <bug-30322-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from rguenth at gcc dot gnu dot org 2007-01-05 16:30 -------
It seems to be IVOPTs rewriting introduces the trees. Testcase:
extern void op( int, int);
void foo(int f0, int f1, int e0, int e1)
{
for (int i1 = f1; i1 <= e1; ++i1)
for (int i0 = f0; i0 <= e0; ++i0)
op(i0, i1);
}
results in (./cc1plus -O2):
void foo(int, int, int, int) (f0, f1, e0, e1)
{
int i0;
int i1;
<bb 2>:
if (f1 <= e1) goto <L26>; else goto <L5>;
<L26>:;
i1 = f1;
goto <bb 5> (<L2>);
<L25>:;
i0 = f0;
<L1>:;
op (i0, i1);
i0 = i0 + 1;
if (e0 >= i0) goto <L1>; else goto <L3>;
<L3>:;
i1 = i1 + 1;
if (i1 != (int) ((unsigned int) f1 + 2 + (unsigned int) ~f1 + (unsigned int)
e1)) goto <L2>; else goto <L5>;
<L2>:;
if (f0 <= e0) goto <L25>; else goto <L3>;
<L5>:;
return;
}
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rakdver at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30322