This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/35762] wrong code emitted for loop with volatile induction variable
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Dec 2008 03:50:04 -0000
- Subject: [Bug middle-end/35762] wrong code emitted for loop with volatile induction variable
- References: <bug-35762-12544@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2008-12-29 03:50 -------
>The output is not correct, it unconditionally returns the value from g_13.
No, it does not.
You missed:
setle %al
movzbl %al, %eax
subl $1, %eax
Now it unconditionally reads from g_13 which is the real issue but you did not
mention that.
With -march=i686, I get a conditional move instead:
movzwl _g_10, %eax
cmpw $10, %ax
movl $0, %eax
cmovg _g_13, %eax
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35762