summaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2019-02-12 12:25:11 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2019-02-12 11:25:11 +0000
commitbaaf860b3364f2efac1cb04a1430f82f867768ef (patch)
treee9b26a340267828b74f5c5a01d908071d9eca10d /gcc/cgraphunit.c
parent0dcbc6dd8e6bc57a27d5b1cdbd8447a2f5a618b2 (diff)
re PR target/88777 (Out-of-range offsets building glibc test-tgmath2.c for hppa-linux-gnu)
PR lto/88777 * cgraphunit.c (analyze_functions): Clear READONLY flag for external types that needs constructiong. * tree.h (may_be_aliased): Do not check TYPE_NEEDS_CONSTRUCTING. From-SVN: r268791
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index a7c9b9ac249..162e0049b6b 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1226,6 +1226,15 @@ analyze_functions (bool first_time)
&& node != first_handled_var; node = next)
{
next = node->next;
+ /* For symbols declared locally we clear TREE_READONLY when emitting
+ the construtor (if one is needed). For external declarations we can
+ not safely assume that the type is readonly because we may be called
+ during its construction. */
+ if (TREE_CODE (node->decl) == VAR_DECL
+ && TYPE_P (TREE_TYPE (node->decl))
+ && TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (node->decl))
+ && DECL_EXTERNAL (node->decl))
+ TREE_READONLY (node->decl) = 0;
if (!node->aux && !node->referred_to_p ())
{
if (symtab->dump_file)