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 middle-end/40078] passing label to inline asm "i" constraint generates bad code



------- Comment #1 from pinskia at gcc dot gnu dot org  2009-05-08 22:52 -------
This is by design, first inline-asm is not allowed to change control flow.
Second labels can be moved if they are not used normally in the program.  In
this case they are not used normally.  Addresses of labels are only designed
for computed gotos and any other use causes undefined behavior of their
placement.

Yes:
asm("jmp %0" : : "i"(&&some_label));

is valid as the address of a label is a constant but GCC does not look into the
string and how you use it.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40078


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