diff options
author | Richard Biener <rguenther@suse.de> | 2016-01-12 14:22:40 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2016-01-12 14:22:40 +0000 |
commit | 3c4e91c903a599641e3adf08b6f2646d778c4cf3 (patch) | |
tree | 9bbcc45e1a72bbd0e7e5d86383d3182fb807651d /gcc | |
parent | 8b1bbf9cd703b514c1deea15788a9904ec90679d (diff) | |
download | gcc-3c4e91c903a599641e3adf08b6f2646d778c4cf3.zip gcc-3c4e91c903a599641e3adf08b6f2646d778c4cf3.tar.gz gcc-3c4e91c903a599641e3adf08b6f2646d778c4cf3.tar.bz2 |
re PR debug/69077 (omnetpp ICEs with -flto -g)
2016-01-12 Richard Biener <rguenther@suse.de>
PR lto/69077
lto/
* lto-symtab.c (lto_symtab_prevailing_virtual_decl): Properly
merge TREE_ADDRESSABLE and DECL_POSSIBLY_INLINED flags.
* g++.dg/lto/pr69077_0.C: New testcase.
* g++.dg/lto/pr69077_1.C: Likewise.
From-SVN: r232272
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/lto/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/lto/lto-symtab.c | 12 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lto/pr69077_0.C | 14 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lto/pr69077_1.C | 15 |
5 files changed, 53 insertions, 0 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 8d5d278..352fe17 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,9 @@ +2016-01-12 Richard Biener <rguenther@suse.de> + + PR lto/69077 + * lto-symtab.c (lto_symtab_prevailing_virtual_decl): Properly + merge TREE_ADDRESSABLE and DECL_POSSIBLY_INLINED flags. + 2016-01-04 Jakub Jelinek <jakub@redhat.com> Update copyright years. diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c index 3936916..a6f6d01 100644 --- a/gcc/lto/lto-symtab.c +++ b/gcc/lto/lto-symtab.c @@ -997,6 +997,18 @@ lto_symtab_prevailing_virtual_decl (tree decl) n = n->next_sharing_asm_name; if (n) { + /* Merge decl state in both directions, we may still end up using + the other decl. */ + TREE_ADDRESSABLE (n->decl) |= TREE_ADDRESSABLE (decl); + TREE_ADDRESSABLE (decl) |= TREE_ADDRESSABLE (n->decl); + + if (TREE_CODE (decl) == FUNCTION_DECL) + { + /* Merge decl state in both directions, we may still end up using + the other decl. */ + DECL_POSSIBLY_INLINED (n->decl) |= DECL_POSSIBLY_INLINED (decl); + DECL_POSSIBLY_INLINED (decl) |= DECL_POSSIBLY_INLINED (n->decl); + } lto_symtab_prevail_decl (n->decl, decl); decl = n->decl; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3ac0457..98ac650 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2016-01-12 Richard Biener <rguenther@suse.de> + + PR lto/69077 + * g++.dg/lto/pr69077_0.C: New testcase. + * g++.dg/lto/pr69077_1.C: Likewise. + 2016-01-12 Jakub Jelinek <jakub@redhat.com> PR target/69175 diff --git a/gcc/testsuite/g++.dg/lto/pr69077_0.C b/gcc/testsuite/g++.dg/lto/pr69077_0.C new file mode 100644 index 0000000..6a81d0e --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr69077_0.C @@ -0,0 +1,14 @@ +// { dg-lto-do link } +// { dg-lto-options { { -O3 -g -flto } } } +// { dg-extra-ld-options "-r -nostdlib" } + +struct cStdDev +{ + long ns; + virtual double mean() const { return ns; } +}; + +struct cWeightedStdDev : public cStdDev { + virtual int netPack(); +}; +int cWeightedStdDev::netPack() { } diff --git a/gcc/testsuite/g++.dg/lto/pr69077_1.C b/gcc/testsuite/g++.dg/lto/pr69077_1.C new file mode 100644 index 0000000..2173b6c --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr69077_1.C @@ -0,0 +1,15 @@ +struct cStdDev +{ + long ns; + virtual double mean() const { return ns; } +}; + +struct sf +{ + void recordScalar(double value); + cStdDev eedStats; + virtual void finish(); +}; +void sf::finish() { + recordScalar(eedStats.mean()); +} |