This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] for PR15717


Hello,

legitimate_constant_p on i386.c allows const_int - symbol_ref, which is wrong
and causes this PR.

Bootstrapped & regtested on i686.

Zdenek

	* config/i386/i386.c (legitimate_constant_p): Do not allow
	x - symbol_ref.

Index: config/i386/i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.669
diff -c -3 -p -r1.669 i386.c
*** config/i386/i386.c	22 May 2004 18:18:46 -0000	1.669
--- config/i386/i386.c	29 May 2004 20:03:39 -0000
*************** legitimate_constant_p (rtx x)
*** 5823,5829 ****
  	  && tls_symbolic_operand (XEXP (inner, 0), Pmode))
  	return false;
  
!       if (GET_CODE (inner) == PLUS)
  	{
  	  if (GET_CODE (XEXP (inner, 1)) != CONST_INT)
  	    return false;
--- 5823,5830 ----
  	  && tls_symbolic_operand (XEXP (inner, 0), Pmode))
  	return false;
  
!       if (GET_CODE (inner) == PLUS
! 	  || GET_CODE (inner) == MINUS)
  	{
  	  if (GET_CODE (XEXP (inner, 1)) != CONST_INT)
  	    return false;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]