aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-08-25 14:05:28 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-08-25 14:05:28 +0000
commit1cf01301ac5e4b5f1d128dbc735620fe01421f98 (patch)
tree5be829b0ffed7290b19e398a7f2b7765810a510d /gcc/gimple.c
parenta2c0ed2ee91b8e30a47466ce3a18779248718c1b (diff)
downloadgcc-1cf01301ac5e4b5f1d128dbc735620fe01421f98.zip
gcc-1cf01301ac5e4b5f1d128dbc735620fe01421f98.tar.gz
gcc-1cf01301ac5e4b5f1d128dbc735620fe01421f98.tar.bz2
re PR tree-optimization/44562 (ICE: in get_alias_set, at alias.c:716 with -flto -fstrict-aliasing -fgraphite-identity)
2010-08-25 Richard Guenther <rguenther@suse.de> PR lto/44562 * lto-streamer.c (lto_record_common_node): Do not mess with TYPE_CANONICAL when not in lto. * gimple.c (gimple_register_type): Likewise. * gcc.dg/graphite/id-27.c: New testcase. * gcc.dg/lto/20100825-1_0.c: Likewise. From-SVN: r163545
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r--gcc/gimple.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 9d5c61b..50b2eab 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -4215,8 +4215,9 @@ gimple_register_type (tree t)
gcc_assert (TYPE_P (t));
/* In TYPE_CANONICAL we cache the result of gimple_register_type.
- It is initially set to NULL during LTO streaming. */
- if (TYPE_CANONICAL (t))
+ It is initially set to NULL during LTO streaming.
+ But do not mess with TYPE_CANONICAL when not in WPA or link phase. */
+ if (in_lto_p && TYPE_CANONICAL (t))
return TYPE_CANONICAL (t);
/* Always register the main variant first. This is important so we
@@ -4282,12 +4283,14 @@ gimple_register_type (tree t)
TYPE_NEXT_REF_TO (t) = NULL_TREE;
}
- TYPE_CANONICAL (t) = new_type;
+ if (in_lto_p)
+ TYPE_CANONICAL (t) = new_type;
t = new_type;
}
else
{
- TYPE_CANONICAL (t) = t;
+ if (in_lto_p)
+ TYPE_CANONICAL (t) = t;
*slot = (void *) t;
}