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: [tree-ssa] Stopgap bugfix for 20040303-1.c


In message <2A8F1DB0-6E0B-11D8-8E7A-000393A6D2F2@physics.uc.edu>, Andrew Pinski
 writes:
 >
 >On Mar 4, 2004, at 10:34, law@redhat.com wrote:
 >>
 >>
 >> 	* fold-const.c (fold): When rebuilding the expression after a
 >> 	call to fold_relational_hi_lo, make sure to convert the type of
 >> 	the second argument to the type of the first.
 >>
 >> Index: fold-const.c
 >> ===================================================================
 >> RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v
 >> retrieving revision 1.213.2.78
 >> diff -c -p -r1.213.2.78 fold-const.c
 >> *** fold-const.c	4 Mar 2004 15:38:44 -0000	1.213.2.78
 >> --- fold-const.c	4 Mar 2004 18:28:08 -0000
 >> *************** fold (tree expr)
 >> *** 7487,7493 ****
 >>   	return t1;
 >>         else if (code != TREE_CODE (t)
 >>   	       || TREE_OPERAND (t, 0) != arg0 || TREE_OPERAND (t, 1) != 
 >> arg1)
 >> ! 	t = build (code, type, arg0, arg1);
 >>
 >>         /* If this is an EQ or NE comparison of a constant with a 
 >> PLUS_EXPR or
 >>   	 a MINUS_EXPR of a constant, we can convert it into a comparison 
 >> with
 >> --- 7487,7493 ----
 >>   	return t1;
 >>         else if (code != TREE_CODE (t)
 >>   	       || TREE_OPERAND (t, 0) != arg0 || TREE_OPERAND (t, 1) != 
 >> arg1)
 >> ! 	t = build (code, type, arg0, convert (TREE_TYPE (arg0), arg1));
 >>
 >>         /* If this is an EQ or NE comparison of a constant with a 
 >> PLUS_EXPR or
 >>   	 a MINUS_EXPR of a constant, we can convert it into a comparison 
 >> with
 >
 >This is wrong, you should be using fold_convert of convert (as convert 
 >is front-end convert) instead.
fold_convert will abort if presented with anything which it does not
understand -- which will show up in the C++ and libstdc++ testsuites as
regressions.  fold_convert was my first choice....

jeff


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