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 c/66348] Simple loop has only lower half of the 64-bit counter initialized correctly


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66348

--- Comment #8 from UroÅ Bizjak <ubizjak at gmail dot com> ---
(In reply to Sebastiano Vigna from comment #0)

> The loop commented as "problematic loop" is compiled (with -O3) as
> 
>         xorl    %eax, %eax      # i
>
> That is, the loop index i is in %rax, but only the lower half is zeroed at
> the start of the loop. When we enter the loop with a large (>32-bit) value,
> the loop never ends. This happens already with -O1. We had to #pragma the
> function to -O0 to make it work.

If you are referring to the xorl insn above, then rest assured that it zeroes
the whole 64bit register.  Your bug is elsewhere.

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