[gcc r11-3036] MSP430: Don't override default ISA when MCU name is unrecognized

Jozef Lawrynowicz jozefl@gcc.gnu.org
Mon Sep 7 16:35:47 GMT 2020


https://gcc.gnu.org/g:7f87e446691f1debfe2671a40f8738bd5e128832

commit r11-3036-g7f87e446691f1debfe2671a40f8738bd5e128832
Author: Jozef Lawrynowicz <jozef.l@mittosystems.com>
Date:   Mon Sep 7 17:35:04 2020 +0100

    MSP430: Don't override default ISA when MCU name is unrecognized
    
    430X is the default ISA under normal operation, so even when the MCU name
    passed to -mmcu= is unrecognized, it should not be overriden.
    
    gcc/ChangeLog:
    
            * config/msp430/msp430.c (msp430_option_override): Don't set the
            ISA to 430 when the MCU is unrecognized.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/msp430/430x-default-isa.c: New test.

Diff:
---
 gcc/config/msp430/msp430.c                         | 11 ++---------
 gcc/testsuite/gcc.target/msp430/430x-default-isa.c | 10 ++++++++++
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c
index c2b24974364..129b916715e 100644
--- a/gcc/config/msp430/msp430.c
+++ b/gcc/config/msp430/msp430.c
@@ -223,7 +223,7 @@ msp430_option_override (void)
 		  if (target_cpu == NULL)
 		    warning (0,
 			     "Unrecognized MCU name %qs, assuming that it is "
-			     "just a MSP430 with no hardware multiply.\n"
+			     "just a MSP430X with no hardware multiply.\n"
 			     "Use the %<-mcpu%> and %<-mhwmult%> options to "
 			     "set these explicitly.",
 			     target_mcu);
@@ -242,22 +242,15 @@ msp430_option_override (void)
 	      if (msp430_warn_mcu)
 		warning (0,
 			 "Unrecognized MCU name %qs, assuming that it just "
-			 "supports the MSP430 ISA.\nUse the %<-mcpu%> option "
+			 "supports the MSP430X ISA.\nUse the %<-mcpu%> option "
 			 "to set the ISA explicitly.",
 			 target_mcu);
-
-	      msp430x = false;
 	    }
 	  else if (msp430_warn_mcu)
 	    warning (0, "Unrecognized MCU name %qs.", target_mcu);
 	}
     }
 
-  /* The F5 series are all able to support the 430X ISA.  */
-  if (target_cpu == NULL && target_mcu == NULL
-      && msp430_hwmult_type == MSP430_HWMULT_F5SERIES)
-    msp430x = true;
-
   if (TARGET_LARGE && !msp430x)
     error ("%<-mlarge%> requires a 430X-compatible %<-mmcu=%>");
 
diff --git a/gcc/testsuite/gcc.target/msp430/430x-default-isa.c b/gcc/testsuite/gcc.target/msp430/430x-default-isa.c
new file mode 100644
index 00000000000..4e8077786b0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/msp430/430x-default-isa.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-skip-if "" { *-*-* } { "-mcpu=*" "-mmcu=*" } } */
+/* { dg-options "-mmcu=msp430foobar -mno-warn-mcu -mno-warn-devices-csv" } */
+
+/* Verify that the default ISA is set to 430X when the MCU passed to -mmcu= is
+   unrecognized.  */
+
+#ifndef __MSP430X__
+#error
+#endif


More information about the Gcc-cvs mailing list