This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Incorrect code generation on optimization (-O3).
- From: Dhruv Matani <dhruvbird at gmx dot net>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 01 Nov 2003 23:21:42 +0530
- Subject: Incorrect code generation on optimization (-O3).
- Organization:
I have here a file, which generates incorrect code for -O3 optimization.
Haven't tested for -O1, or -O2, but works fine for default.
ps. Please cc the reply to me, since I am not subscribed.
--
-Dhruv Matani.
http://www.geocities.com/dhruvbird/
#include <iostream>
inline int foo (int _x)
{
// int _y = 3;
__asm__ ("addl $3, %0\n\t"
: "=g"(_x));
// : "0"(_y),
// "r"(_x));
//: "0");
//return _x;
return _x;
}
int main ()
{
int t = 23;
std::cout<<foo (t)<<std::endl;
return 0;
}