Incorrect code generation on optimization (-O3).

Falk Hueffner falk.hueffner@student.uni-tuebingen.de
Sat Nov 1 22:22:00 GMT 2003


Dhruv Matani <dhruvbird@gmx.net> writes:

> I have here a file, which generates incorrect code for -O3 optimization.
> 
> inline int foo (int _x)
> {
>   //  int _y = 3;
>   __asm__ ("addl $3, %0\n\t"
> 	   : "=g"(_x));
>   return _x;
> }

Not a bug in gcc. Since you don't specify _x to be an input to the
asm, gcc is free to clobber it with random stuff prior to the asm.

-- 
	Falk



More information about the Gcc-bugs mailing list