This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/35762] wrong code emitted for loop with volatile induction variable



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]