From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88803 invoked by alias); 26 Apr 2015 22:50:29 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 88784 invoked by uid 48); 26 Apr 2015 22:50:25 -0000 From: "sstsoft at wp dot pl" To: gcc-bugs@gcc.gnu.org Subject: [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 Date: Sun, 26 Apr 2015 22:50:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: inline-asm X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sstsoft at wp dot pl X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-04/txt/msg02232.txt.bz2 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: "