public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug inline-asm/65898] New: GCC puts auto generated code between two asm volatile(".intel_syntax"); and asm volatile(".att_syntax"); globally syntaxed rather than not put or change it's syntax
@ 2015-04-26 22:50 sstsoft at wp dot pl
  2015-04-26 22:56 ` [Bug inline-asm/65898] " sstsoft at wp dot pl
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: sstsoft at wp dot pl @ 2015-04-26 22:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65898

            Bug ID: 65898
           Summary: GCC puts auto generated code between two asm
                    volatile(".intel_syntax"); and asm
                    volatile(".att_syntax"); globally syntaxed rather than
                    not put or change it's syntax
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: inline-asm
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sstsoft at wp dot pl
  Target Milestone: ---

GCC put's code between asm volatile statements ended by new line
asm(".intel_syntax noprefix\n");
asm("mov eax,eax\n");
asm(".att_syntax\n");

so it's "auto generated" code is not well recognized by linker(?)
/APP
 # 515 "../../../some.cpp" 1
        .intel_syntax noprefix
 # 0 "" 2
        .loc 2 519 0
/NO_APP
        leal    -44(%ebp), %eax  #, tmp80
/APP
 # 519 "../../../some.cpp" 1
mov eax,%eax;    # tmp80

 # 0 "" 2
 # 519 "../../../some.cpp" 1
        .att_syntax
/NO_APP

When i write code without "\n" it's the same. I need to write in one asm();

1. GCC/GAS is not intuitive as could it be. 
Think it's little bug but then it's some kind of blocker!
2. When im forced to add .intel_syntax + code + .att_syntax at end there is a
problem with global flag -masm=intel and mixed syntaxes.
When .att code is mixed with intel asembly code global compiler flag could be
easy detected by #ifdef __INTEL_ASM and preprocessor so make decision of #ifdef
my .intel_syntaxed code with or without pre .intel statements. But if code is
mixed and pre stetemented i can't undef (change back to default syntax) because
rest of the auto generated GCC code would be ruined and not recognized.
If those statements are in one line asm() i must undef whole code either, and
this is specially when asm is in #define macro() because i can't put # in macro
 body. When i wrote asm volatile("att_syntax"); GCC sometimes put's some code
before it formated with global syntax flag and... you know what next:

"no such instruction: "


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-05-01  7:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-26 22:50 [Bug inline-asm/65898] New: GCC puts auto generated code between two asm volatile(".intel_syntax"); and asm volatile(".att_syntax"); globally syntaxed rather than not put or change it's syntax sstsoft at wp dot pl
2015-04-26 22:56 ` [Bug inline-asm/65898] " sstsoft at wp dot pl
2015-04-26 23:16 ` pinskia at gcc dot gnu.org
2015-04-30 21:53 ` sstsoft at wp dot pl
2015-05-01  7:08 ` schwab@linux-m68k.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).