mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-15 13:30:59 +08:00
re PR lto/47924 (Missed optimization with LTO)
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. From-SVN: r170589
This commit is contained in:
parent
06c7edcc27
commit
7a00d9eaf6
gcc
@ -1,3 +1,9 @@
|
||||
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
|
||||
|
@ -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. */
|
||||
|
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
19
gcc/testsuite/gcc.dg/lto/pr47924_0.c
Normal file
19
gcc/testsuite/gcc.dg/lto/pr47924_0.c
Normal file
@ -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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user