This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Incorrect code generation on optimization (-O3).
- From: Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de>
- To: Dhruv Matani <dhruvbird at gmx dot net>
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: 01 Nov 2003 23:22:53 +0100
- Subject: Re: Incorrect code generation on optimization (-O3).
- References: <1067709101.2765.10.camel@home.free>
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