[ColdFire 48/63] Fix the 'T' constraint

Richard Sandiford richard@codesourcery.com
Wed Jan 10 12:04:00 GMT 2007


After having misapplied a patch, I came across a bug in which 'T'
was allowing symbolic constants for non-pcrel PIC.  The comment reads:

   `T' is for operands that satisfy 's' when -mpcrel is not in effect.

and 's' doesn't accept anything if flag_pic.

This bug became latent again once I'd fixed my initial mistake,
but I still think it should be fixed.

Richard


gcc/
	* config/m68k/m68k.h (EXTRA_CONSTRAINT): Stop the 'T' constraint
	from accepting 's' constraints if flag_pic.

Index: gcc/config/m68k/m68k.h
===================================================================
--- gcc/config/m68k/m68k.h	2007-01-09 15:02:22.000000000 +0000
+++ gcc/config/m68k/m68k.h	2007-01-09 15:02:23.000000000 +0000
@@ -526,7 +526,7 @@ #define EXTRA_CONSTRAINT(OP,CODE)			\
 	  || GET_CODE (XEXP (OP, 0)) == CONST))		\
    : 							\
    (CODE) == 'T'					\
-   ? ( !TARGET_PCREL 					\
+   ? (!flag_pic						\
       && (GET_CODE (OP) == SYMBOL_REF			\
 	  || GET_CODE (OP) == LABEL_REF			\
 	  || GET_CODE (OP) == CONST))			\



More information about the Gcc-patches mailing list