This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/42142] [4.5 Regression] DCE miscompiles a certain quicksort implementation when optimizing with -O1 or higher
- 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: 23 Nov 2009 13:29:32 -0000
- Subject: [Bug tree-optimization/42142] [4.5 Regression] DCE miscompiles a certain quicksort implementation when optimizing with -O1 or higher
- References: <bug-42142-18477@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from rguenth at gcc dot gnu dot org 2009-11-23 13:29 -------
int __attribute__((noinline,noclone))
sort(int L)
{
int end[2] = { 10, 10, }, i=0, R;
while (i<2)
{
R = end[i];
if (L<R)
{
end[i+1] = 1;
end[i] = 10;
++i;
}
else
break;
}
return i;
}
extern void abort (void);
int main()
{
if (sort (5) != 1)
abort ();
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42142