[Bug c/42142] New: GCC 4.5 doesn't compile a certain quicksort implementation correctly when optimizing with -O1 or higher
maister at archlinux dot us
gcc-bugzilla@gcc.gnu.org
Sun Nov 22 12:06:00 GMT 2009
I have a reproducible test case which shows that GCC 4.5 (20091112) doesn't
compile a certain quicksort implementation correctly. It runs fine, but the
sorting is plain wrong when trying to optimize with -O1 or higher. There might
be something wrong with the quicksort implementation itself, but it compiles
and runs fine when not optimizing anything with GCC 4.5. It also runs, and
executes correctly on 4.3 and 4.4 with all optimizations applied.
The code in question is here:
http://pastebin.com/m270ad2a5
Output when compiling with
gcc-4.5 -o qsort qsort.c -O
http://pastebin.com/m44c8f6f2
Output with
gcc-4.5 -o qsort qsort.c
http://pastebin.com/m6ee486a0
Output with
gcc-4.4 -o qsort qsort.c $CRAZYSTUFF_HERE
http://pastebin.com/m78d55249
--
Summary: GCC 4.5 doesn't compile a certain quicksort
implementation correctly when optimizing with -O1 or
higher
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: maister at archlinux dot us
GCC host triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42142
More information about the Gcc-bugs
mailing list