diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-05-11 20:14:19 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-05-11 20:14:19 +0200 |
commit | 3895ec538abb365483f1ff862f1fe0e78a3119d5 (patch) | |
tree | ba115298ec48f9d6e9f497a0767153cc671f31c1 /gcc/config/alpha/elf.h | |
parent | 056928b248b7e3f879c2b3ac4be935e67ad3a09a (diff) | |
download | gcc-3895ec538abb365483f1ff862f1fe0e78a3119d5.zip gcc-3895ec538abb365483f1ff862f1fe0e78a3119d5.tar.gz gcc-3895ec538abb365483f1ff862f1fe0e78a3119d5.tar.bz2 |
re PR c++/44059 (Static initializers executed more than once when using unique global symbols)
PR c++/44059
* config/elfos.h (ASM_DECLARE_OBJECT_NAME): Use qnu_unique_object
even for DECL_ONE_ONLY DECL_ARTIFICIAL !TREE_READONLY decls.
* config/alpha/elf.h (ASM_DECLARE_OBJECT_NAME): Likewise.
* dwarf2asm.c (dw2_output_indirect_constant_1): Set TREE_READONLY
on DW.ref.* decls.
From-SVN: r159287
Diffstat (limited to 'gcc/config/alpha/elf.h')
-rw-r--r-- | gcc/config/alpha/elf.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h index d2bf732..57ab91e2 100644 --- a/gcc/config/alpha/elf.h +++ b/gcc/config/alpha/elf.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for DEC Alpha w/ELF. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2007, 2008, - 2009 Free Software Foundation, Inc. + 2009, 2010 Free Software Foundation, Inc. Contributed by Richard Henderson (rth@tamu.edu). This file is part of GCC. @@ -284,10 +284,12 @@ do { \ HOST_WIDE_INT size; \ \ /* For template static data member instantiations or \ - inline fn local statics, use gnu_unique_object so that \ - they will be combined even under RTLD_LOCAL. */ \ - if (USE_GNU_UNIQUE_OBJECT \ - && !DECL_ARTIFICIAL (DECL) && DECL_ONE_ONLY (DECL)) \ + inline fn local statics and their guard variables, use \ + gnu_unique_object so that they will be combined even under \ + RTLD_LOCAL. Don't use gnu_unique_object for typeinfo, \ + vtables and other read-only artificial decls. */ \ + if (USE_GNU_UNIQUE_OBJECT && DECL_ONE_ONLY (DECL) \ + && (!DECL_ARTIFICIAL (DECL) || !TREE_READONLY (DECL))) \ ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "gnu_unique_object"); \ else \ ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \ |