This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49073] g++ optimizer breaks do-while code
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 20 May 2011 07:26:54 +0000
- Subject: [Bug c++/49073] g++ optimizer breaks do-while code
- Auto-submitted: auto-generated
- References: <bug-49073-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49073
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.05.20 06:57:01
CC| |jakub at gcc dot gnu.org
Version|4.5.2 |4.6.0
Ever Confirmed|0 |1
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-05-20 06:57:01 UTC ---
Confirmed for 4.6 and trunk, if you can reproduce it with 4.5, complain to
Ubuntu for backporting very risky patch that caused already more than one
regression.
Caused by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=160445
Simplified testcase:
extern void abort (void);
int c;
int
main ()
{
int a[] = { 1, 2, 3, 4, 5, 6, 7 }, d = 1, i = 1;
_Bool f = 0;
do
{
d = a[i];
if (f && d == 4)
{
++c;
break;
}
i++;
f = (d == 3);
}
while (d < 7);
if (c != 1)
abort ();
return 0;
}
I'll have a look.