This is the mail archive of the gcc-bugs@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]

[Bug c/45687] possible wrong code bug



------- 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


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