[llvm-commits] [llvm-gcc-4.2] r76208 - in /llvm-gcc-4.2/trunk/gcc: llvm-backend.cpp llvm-convert.cpp

Anton Korobeynikov anton at korobeynikov.info
Fri Jul 17 14:38:24 PDT 2009


> The case I'm worried about is something like the following:
> int test() {
>  register int x __asm__(("edi")) = 0;
>  // Lots of code, where the register allocator
>  // happens to reuse edi for something else
>  return x; // Returns a random value instead of zero
>            // because it's reading the register rather than
>            // the value
> }
Agree, it also depends whether x is used inside "lots of code" or not.
But someone who tends to write such code should clearly understand all
stuff beyond these constructs.

-- 
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University




More information about the llvm-commits mailing list