[Bug target/55816] New: Options from command line are added to target arch attribute eventhough they are in contradiction with that target

aivchenk at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Dec 27 16:16:00 GMT 2012


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?



More information about the Gcc-bugs mailing list