Fix va_arg ap_copy nop detection
authorTom de Vries <tom@codesourcery.com>
Wed, 22 Apr 2015 09:03:01 +0000 (09:03 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Wed, 22 Apr 2015 09:03:01 +0000 (09:03 +0000)
2015-04-22  Tom de Vries  <tom@codesourcery.com>

PR tree-optimization/65823
* gimplify.c (gimplify_modify_expr): Use operand_equal_p to test for
equality between ap_copy and ap.

From-SVN: r222318

gcc/ChangeLog
gcc/gimplify.c

index 2e70a87153fa8f10be01db48a08039f799c507e9..59eb8f8c1ecd571ea887025546e837910e944b05 100644 (file)
@@ -1,3 +1,9 @@
+2015-04-22  Tom de Vries  <tom@codesourcery.com>
+
+       PR tree-optimization/65823
+       * gimplify.c (gimplify_modify_expr): Use operand_equal_p to test for
+       equality between ap_copy and ap.
+
 2015-04-22  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>
 
        PR target/47098
index 0a8ef84169f40e1f8cc882e4d9d3968f07bc13dd..c68bd4747564b80a555538cc28f92bcc8c9538de 100644 (file)
@@ -4792,7 +4792,7 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
   if (ap != NULL_TREE
       && TREE_CODE (ap) == ADDR_EXPR
       && TREE_CODE (ap_copy) == ADDR_EXPR
-      && TREE_OPERAND (ap, 0) != TREE_OPERAND (ap_copy, 0))
+      && !operand_equal_p (TREE_OPERAND (ap, 0), TREE_OPERAND (ap_copy, 0), 0))
     gimplify_assign (TREE_OPERAND (ap, 0), TREE_OPERAND (ap_copy, 0), pre_p);
 
   if (want_value)