This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/45687] possible wrong code bug
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Sep 2010 08:55:36 -0000
- Subject: [Bug c/45687] possible wrong code bug
- References: <bug-45687-12544@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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