Greetings,

The attached patch is proposed for rs6000/linux64.h.

The problem it addresses is that the current checking only tests for existence not for an incompatible/compatible setting.

For example:

$ powerpc64-linux-gnu-gcc -mcmodel=medium -mminimal-toc foo.c
is an incompatible set of switches

however

$ powerpc64-linux-gnu-gcc -mcmodel=medium -mno-minimal-toc foo.c
is ok.

Currently both are reported as incompatible.

--Douglas Rupp, AdaCore

diff --git gcc/config/rs6000/linux64.h gcc/config/rs6000/linux64.h
index 34776c8421e..6728006d208 100644
--- gcc/config/rs6000/linux64.h
+++ gcc/config/rs6000/linux64.h
@@ -134,8 +134,10 @@ extern int dot_symbols;
 	      rs6000_isa_flags |= OPTION_MASK_POWERPC64;	\
 	      error ("%<-m64%> requires a PowerPC64 cpu");		\
 	    }							\
-	  if ((rs6000_isa_flags_explicit			\
-	       & OPTION_MASK_MINIMAL_TOC) != 0)			\
+	  if (((rs6000_isa_flags_explicit			\
+		& OPTION_MASK_MINIMAL_TOC) != 0) &&		\
+	      ((rs6000_isa_flags				\
+		& OPTION_MASK_MINIMAL_TOC) != 0))		\
 	    {							\
 	      if (global_options_set.x_rs6000_current_cmodel	\
 		  && rs6000_current_cmodel != CMODEL_SMALL)	\

Attachment: changelog.toc
Description: application/cdrdao-toc

Reply via email to