[Bug c/45687] possible wrong code bug

jakub at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Sep 16 08:55:00 GMT 2010



------- Comment #3 from jakub at gcc dot gnu dot org  2010-09-16 08:55 -------
--- ipa-prop.c.jj 2010-09-14 15:24:45.000000000 +0200
+++ ipa-prop.c 2010-09-16 10:47:14.000000000 +0200
@@ -2185,7 +2185,8 @@ ipa_modify_call_arguments (struct cgraph

   if (TREE_CODE (base) == ADDR_EXPR
       && DECL_P (TREE_OPERAND (base, 0)))
-    off = build_int_cst (reference_alias_ptr_type (base),
+    off = build_int_cst (reference_alias_ptr_type (TREE_OPERAND (base,
+                                                                 0)),
                          adj->offset / BITS_PER_UNIT);
   else if (TREE_CODE (base) != ADDR_EXPR
    && POINTER_TYPE_P (TREE_TYPE (base)))

seems to fix this, but even the else { } block a few lines below looks very
questionable.  In particular, the
              if (TREE_CODE (base) == ADDR_EXPR)
                base = TREE_OPERAND (base, 0);  
without remembering anywhere whether it was ADDR_EXPR or not and so what level
of indirection we need.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45687



More information about the Gcc-bugs mailing list