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]

Re: [PATCH] Fix ACATS failures in GCC 3.4


> I'd be inclined to test removing RSHIFT_EXPR here.  It doesn't make
> any sense.  And the comment hsould be updated to include a brief
> discussion of the issues these patches discovered.

Agreed.  OK for mainline after a complete testing cycle?


2004-02-27  Eric Botcazou  <ebotcazou@act-europe.fr>

	* fold-const.c (fold): Strip NOPs that change the signedness
	for RSHIFT too.  Expand comment.


-- 
Eric Botcazou
Index: fold-const.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v
retrieving revision 1.336
diff -c -p -r1.336 fold-const.c
*** fold-const.c	27 Feb 2004 08:11:34 -0000	1.336
--- fold-const.c	27 Feb 2004 15:56:36 -0000
*************** fold (tree expr)
*** 5423,5436 ****
  	  if (op == 0)
  	    continue;		/* Valid for CALL_EXPR, at least.  */
  
! 	  if (kind == '<' || code == RSHIFT_EXPR)
! 	    {
! 	      /* Signedness matters here.  Perhaps we can refine this
! 		 later.  */
! 	      STRIP_SIGN_NOPS (op);
! 	    }
  	  else
- 	    /* Strip any conversions that don't change the mode.  */
  	    STRIP_NOPS (op);
  
  	  if (TREE_CODE (op) == COMPLEX_CST)
--- 5423,5442 ----
  	  if (op == 0)
  	    continue;		/* Valid for CALL_EXPR, at least.  */
  
! 	  /* Strip any conversions that don't change the mode.  This is
! 	     safe for every expression, except for a comparison expression
! 	     because its signedness is derived from its operands.  So, in
! 	     the latter case, only strip conversions that don't change the
! 	     signedness.
! 
! 	     Note that this is done as an internal manipulation within the
! 	     constant folder, in order to find the simplest representation
! 	     of the arguments so that their form can be studied.  In any
! 	     cases, the appropriate type conversions should be put back in
! 	     the tree that will get out of the constant folder.  */
! 	  if (kind == '<')
! 	    STRIP_SIGN_NOPS (op);
  	  else
  	    STRIP_NOPS (op);
  
  	  if (TREE_CODE (op) == COMPLEX_CST)

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