This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Add VIEW_CONVERT_EXPR to operand_equal_p
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 14 Oct 2015 18:29:44 +0200
- Subject: Add VIEW_CONVERT_EXPR to operand_equal_p
- Authentication-results: sourceware.org; auth=none
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)))