From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16966 invoked by alias); 27 Dec 2012 16:16:26 -0000 Received: (qmail 16896 invoked by uid 48); 27 Dec 2012 16:16:03 -0000 From: "aivchenk at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/55816] New: Options from command line are added to target arch attribute eventhough they are in contradiction with that target Date: Thu, 27 Dec 2012 16:16:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: aivchenk at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2012-12/txt/msg02360.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55816 Bug #: 55816 Summary: Options from command line are added to target arch attribute eventhough they are in contradiction with that target Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned@gcc.gnu.org ReportedBy: aivchenk@gmail.com CC: aivchenk@gmail.com, hjl.tools@gmail.com, ubizjak@gmail.com Target: i?86-*-* x86_64-*-* On x86 android gcc we have -msse3 turned on by default, that leads gcc/testsuite/gcc.target/i386/funcspec-10.c to fail: extern int foo (int) __attribute__((__target__("arch=i386"))); int foo (int x) { if (x < 0) x = 1; return x; } because compiler produces CMOV, eventhough foo has been declared as arch=i386. The problem is that isa option from command line (-msse3) is added to arch=i386 within this function. I believe that there could be other cases when that would be more critical. Should we turn off enabled from command line isa's inside the function with "target arch" attribute, if those isa's are in contradiction with that arch?