Commit 08d8c745 by Richard Biener Committed by Richard Biener

re PR lto/55525 (ICE: tree check: expected array_type, have pointer_type in…

re PR lto/55525 (ICE: tree check: expected array_type, have pointer_type in array_ref_low_bound, at expr.c:6768)

2012-12-05  Richard Biener  <rguenther@suse.de>

	PR lto/55525
	* gimple-streamer-in.c (input_gimple_stmt): Fixup ARRAY_REFs as well.

	* gcc.dg/lto/pr55525_0.c: New testcase.
	* gcc.dg/lto/pr55525_1.c: Likewise.

From-SVN: r194183
parent 7fb1e592
2012-12-05 Richard Biener <rguenther@suse.de>
PR lto/55525
* gimple-streamer-in.c (input_gimple_stmt): Fixup ARRAY_REFs as well.
2012-12-04 Ian Lance Taylor <iant@google.com>
* godump.c (find_dummy_types): Output a dummy type if we couldn't
......@@ -148,14 +148,14 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
if (!op)
continue;
/* Fixup FIELD_DECLs in COMPONENT_REFs, they are not handled
by decl merging. */
if (TREE_CODE (op) == ADDR_EXPR)
op = TREE_OPERAND (op, 0);
while (handled_component_p (op))
{
if (TREE_CODE (op) == COMPONENT_REF)
{
/* Fixup FIELD_DECLs in COMPONENT_REFs, they are not handled
by decl merging. */
tree field, type, tem;
tree closest_match = NULL_TREE;
field = TREE_OPERAND (op, 1);
......@@ -215,6 +215,18 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
else
TREE_OPERAND (op, 1) = tem;
}
else if ((TREE_CODE (op) == ARRAY_REF
|| TREE_CODE (op) == ARRAY_RANGE_REF)
&& (TREE_CODE (TREE_TYPE (TREE_OPERAND (op, 0)))
!= ARRAY_TYPE))
{
/* And ARRAY_REFs to objects that had mismatched types
during symbol merging to avoid ICEs. */
TREE_OPERAND (op, 0)
= build1 (VIEW_CONVERT_EXPR,
build_array_type (TREE_TYPE (op), NULL_TREE),
TREE_OPERAND (op, 0));
}
op = TREE_OPERAND (op, 0);
}
......
2012-12-05 Richard Biener <rguenther@suse.de>
PR lto/55525
* gcc.dg/lto/pr55525_0.c: New testcase.
* gcc.dg/lto/pr55525_1.c: Likewise.
2012-12-04 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/quad_3.f90: Really fix an if condition.
......
/* { dg-lto-do link } */
/* { dg-lto-options { { -flto -w } } } */
char s[8];
int main(void)
{
return strcmp(&s[1], "foo");
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment