This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/42020] field not merged causes cc1 to be miscompiled
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Nov 2009 10:55:51 -0000
- Subject: [Bug lto/42020] field not merged causes cc1 to be miscompiled
- References: <bug-42020-12026@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from rguenth at gcc dot gnu dot org 2009-11-18 10:55 -------
Hm, the assert doesn't trigger if I add a tem != field check. In fact I do not
understand the assert you added at all ;) We do find the correct field, if
that ends up still being the wrong one then DECL_CONTEXT is already wrong
which means we end up not unifying types as we should.
In fact for the testcase both FIELD_DECLs of the two COMPONENT_REFs for
new_bb->succs and bb->succs are the same.
So - did you just not properly reduce the testcase? The assert to be put
in I suggested would have been
Index: gcc/lto-streamer-in.c
===================================================================
--- gcc/lto-streamer-in.c (revision 154283)
+++ gcc/lto-streamer-in.c (working copy)
@@ -1091,8 +1091,8 @@ input_gimple_stmt (struct lto_input_bloc
/* In case of type mismatches across units we can fail
to unify some types and thus not find a proper
field-decl here. Just do nothing in this case. */
- if (tem != NULL_TREE)
- TREE_OPERAND (op, 1) = tem;
+ gcc_assert (tem != NULL_TREE);
+ TREE_OPERAND (op, 1) = tem;
}
op = TREE_OPERAND (op, 0);
which I probably should re-add under ENABLE_CHECKING at least (I think it
failed somewhere in SPEC though).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42020