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]

Add VIEW_CONVERT_EXPR to operand_equal_p


Hi,
this patch adds VIEW_CONVERT_EXPR which is another code omitted in
operand_equal_p.  During bootstrap there are about 1000 matches.

Bootstrapped/regtested x86_64-linux, OK?

Honza

	* fold-const.c (operand_equal_p): Handle VIEW_CONVERT_EXPR.
Index: fold-const.c
===================================================================
--- fold-const.c	(revision 228735)
+++ fold-const.c	(working copy)
@@ -2962,6 +2968,12 @@ operand_equal_p (const_tree arg0, const_
 	case IMAGPART_EXPR:
 	  return OP_SAME (0);
 
+	case VIEW_CONVERT_EXPR:
+	  if (!(flags & (OEP_ADDRESS_OF | OEP_CONSTANT_ADDRESS_OF))
+	      && !types_compatible_p (TREE_TYPE (arg0), TREE_TYPE (arg1)))
+	    return false;
+	  return OP_SAME (0);
+
 	case TARGET_MEM_REF:
 	case MEM_REF:
 	  if (!(flags & (OEP_ADDRESS_OF | OEP_CONSTANT_ADDRESS_OF)))


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