diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-20 13:33:03 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-20 13:33:03 +0000 |
commit | b816f77fe5748d5e9200dfa6292ab50069d0d7f8 (patch) | |
tree | 1c293e03073acf994f215b7e4a140572f557282b /gcc/gimple.c | |
parent | c6a55b9702535fdb235885a1e5fa0b1bb200f86a (diff) | |
download | gcc-b816f77fe5748d5e9200dfa6292ab50069d0d7f8.tar.gz |
2009-10-20 Richard Guenther <rguenther@suse.de>
PR lto/41761
* gimple.c (gimple_register_type): Make sure we register
the types main variant first.
* gcc.dg/lto/20091020-1_0.c: New testcase.
* gcc.dg/lto/20091020-1_1.c: Likewise.
* gcc.dg/lto/20091020-2_0.c: Likewise.
* gcc.dg/lto/20091020-2_1.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153012 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r-- | gcc/gimple.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c index d5b1cf7f1c7..f725a347bac 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -3809,6 +3809,12 @@ gimple_register_type (tree t) gcc_assert (TYPE_P (t)); + /* Always register the main variant first. This is important so we + pick up the non-typedef variants as canonical, otherwise we'll end + up taking typedef ids for structure tags during comparison. */ + if (TYPE_MAIN_VARIANT (t) != t) + gimple_register_type (TYPE_MAIN_VARIANT (t)); + if (gimple_types == NULL) gimple_types = htab_create (16381, gimple_type_hash, gimple_type_eq, 0); |