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]

fold-const.c type tweek


In the aforementioned alpha sqrt test, we'd get slightly different rtl
out of the .00.rtl dump depending on whether or not a typedef was used.

Clearly incorrect.  Fixed thus.


r~


        * fold-const.c (fold): Compare TYPE_MAIN_VARIANT rather than
        the types themselves to discover type equivalence.

Index: fold-const.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/fold-const.c,v
retrieving revision 1.138
diff -c -p -d -r1.138 fold-const.c
*** fold-const.c	2000/11/07 22:49:52	1.138
--- fold-const.c	2000/11/09 23:56:27
*************** fold (expr)
*** 5099,5105 ****
  	     handled below, if we are converting something to its own
  	     type via an object of identical or wider precision, neither
  	     conversion is needed.  */
! 	  if (inside_type == final_type
  	      && ((inter_int && final_int) || (inter_float && final_float))
  	      && inter_prec >= final_prec)
  	    return TREE_OPERAND (TREE_OPERAND (t, 0), 0);
--- 5099,5105 ----
  	     handled below, if we are converting something to its own
  	     type via an object of identical or wider precision, neither
  	     conversion is needed.  */
! 	  if (TYPE_MAIN_VARIANT (inside_type) == TYPE_MAIN_VARIANT (final_type)
  	      && ((inter_int && final_int) || (inter_float && final_float))
  	      && inter_prec >= final_prec)
  	    return TREE_OPERAND (TREE_OPERAND (t, 0), 0);

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