diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-01 09:46:19 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-01 09:46:19 +0000 |
commit | 4525baee1ed29080845aef4793e30883aa0d2d8d (patch) | |
tree | 4350359914b33a7170ae49a554770232e317a6c9 | |
parent | f69f16c8633fd5167aea83171748ca34dd3d2f94 (diff) | |
download | gcc-4525baee1ed29080845aef4793e30883aa0d2d8d.tar.gz |
2011-03-01 Richard Guenther <rguenther@suse.de>
PR lto/47924
* lto-streamer.c (lto_record_common_node): Also register
the canonical type.
* gcc.dg/lto/pr47924_0.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170589 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/lto-streamer.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/pr47924_0.c | 19 |
4 files changed, 33 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5d567fb498a..79487c18b0c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2011-03-01 Richard Guenther <rguenther@suse.de> + PR lto/47924 + * lto-streamer.c (lto_record_common_node): Also register + the canonical type. + +2011-03-01 Richard Guenther <rguenther@suse.de> + PR lto/46911 * lto-streamer-in.c (lto_input_ts_decl_common_tree_pointers): Do not stream DECL_ABSTRACT_ORIGIN. diff --git a/gcc/lto-streamer.c b/gcc/lto-streamer.c index dba9d2d5dd7..67132ef1dff 100644 --- a/gcc/lto-streamer.c +++ b/gcc/lto-streamer.c @@ -527,7 +527,9 @@ lto_record_common_node (tree *nodep, VEC(tree, heap) **common_nodes, are set by the middle-end. */ if (in_lto_p) TYPE_CANONICAL (node) = NULL_TREE; - *nodep = node = gimple_register_type (node); + node = gimple_register_type (node); + TYPE_CANONICAL (node) = gimple_register_canonical_type (node); + *nodep = node; } /* Return if node is already seen. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 65e0db406bf..d5e79f82f2e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2011-03-01 Richard Guenther <rguenther@suse.de> + PR lto/47924 + * gcc.dg/lto/pr47924_0.c: New testcase. + +2011-03-01 Richard Guenther <rguenther@suse.de> + PR lto/46911 * gfortran.dg/lto/pr46911_0.f: New testcase. diff --git a/gcc/testsuite/gcc.dg/lto/pr47924_0.c b/gcc/testsuite/gcc.dg/lto/pr47924_0.c new file mode 100644 index 00000000000..f7fdb44b073 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr47924_0.c @@ -0,0 +1,19 @@ +/* { dg-lto-do link } */ +/* { dg-lto-options {{-O2 -flto}} } */ + +extern void link_error (void); +short *p __attribute__((used)); +int i __attribute__((used)); + +int main() +{ + if (i == 0) + return; + + *p = 0; + + if (i == 0) + link_error (); + + return 0; +} |