This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/12108] wrong code generated in the presence of asm("...")


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);
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]