[PATCH] Handle SPARC float command line parameters for SPARCv9

Brad Smith brad at comstyle.com
Thu Aug 14 17:19:39 PDT 2014


On Tue, Aug 05, 2014 at 11:12:25AM -0400, Rafael Esp??ndola wrote:
> Is it testable?

While looking into that I found a bug with getSparcTargetFeatures()
with the & missing from the Features field which resulted in the
feature flag not being passed back.


Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp	(revision 215681)
+++ lib/Driver/Tools.cpp	(working copy)
@@ -1298,7 +1298,7 @@
 }
 
 static void getSparcTargetFeatures(const ArgList &Args,
-                                   std::vector<const char *> Features) {
+                                   std::vector<const char *> &Features) {
   bool SoftFloatABI = true;
   if (Arg *A =
           Args.getLastArg(options::OPT_msoft_float, options::OPT_mhard_float)) {
@@ -1801,6 +1801,7 @@
     getPPCTargetFeatures(Args, Features);
     break;
   case llvm::Triple::sparc:
+  case llvm::Triple::sparcv9:
     getSparcTargetFeatures(Args, Features);
     break;
   case llvm::Triple::aarch64:
Index: test/Driver/sparc-float.c
===================================================================
--- test/Driver/sparc-float.c	(revision 215681)
+++ test/Driver/sparc-float.c	(working copy)
@@ -5,6 +5,7 @@
 // RUN: %clang -c %s -### -o %t.o 2>&1 \
 // RUN:     -target sparc-linux-gnu \
 // RUN:   | FileCheck --check-prefix=CHECK-DEF %s
+// CHECK-DEF: "-target-feature" "+soft-float"
 // CHECK-DEF: "-msoft-float"
 //
 // -mhard-float
@@ -17,6 +18,7 @@
 // RUN: %clang -c %s -### -o %t.o 2>&1 \
 // RUN:     -target sparc-linux-gnu -msoft-float \
 // RUN:   | FileCheck --check-prefix=CHECK-SOFT %s
+// CHECK-SOFT: "-target-feature" "+soft-float"
 // CHECK-SOFT: "-msoft-float"
 //
 // Default sparc64
@@ -23,6 +25,7 @@
 // RUN: %clang -c %s -### -o %t.o 2>&1 \
 // RUN:     -target sparc64-linux-gnu \
 // RUN:   | FileCheck --check-prefix=CHECK-DEF-SPARC64 %s
+// CHECK-DEF-SPARC64: "-target-feature" "+soft-float"
 // CHECK-DEF-SPARC64: "-msoft-float"
 //
 // -mhard-float
@@ -35,4 +38,5 @@
 // RUN: %clang -c %s -### -o %t.o 2>&1 \
 // RUN:     -target sparc64-linux-gnu -msoft-float \
 // RUN:   | FileCheck --check-prefix=CHECK-SOFT-SPARC64 %s
+// CHECK-SOFT-SPARC64: "-target-feature" "+soft-float"
 // CHECK-SOFT-SPARC64: "-msoft-float"


> On 3 August 2014 00:32, Brad Smith <brad at comstyle.com> wrote:
> > On 26/07/14 4:21 PM, Brad Smith wrote:
> >>
> >> I missed a switch case when adding the initial float handling
> >> support for SPARCv9.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the cfe-commits mailing list