This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/12108] wrong code generated in the presence of asm("...")
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Aug 2003 13:47:45 -0000
- Subject: [Bug c/12108] wrong code generated in the presence of asm("...")
- References: <20030830095749.12108.anton@mips.complang.tuwien.ac.at>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12108
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-08-30 13:47 -------
I think the code is wrong because the asm is not marked as volatile so the schedular is free to
move it around.
Can you try this:
int foo(int);
main()
{
if(foo(0)!=16)
abort();
}
int y;
int foo(int x)
{
if (x) {
label1:
asm volatile (".skip 16"); /* or ".space 16" or somesuch */
label2:
;
}
return (&&label2)-(&&label1);
}