aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-03-19 21:48:39 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-03-19 21:48:39 +0100
commit90841d4302e804d0eafdd5e9565cda2d5ec166a8 (patch)
tree2286cf5c0c8f1f2a2519f241c46d9aa30c7b090a
parent359ea407e98009b6734ace47175c840a30ca4271 (diff)
downloadgcc-90841d4302e804d0eafdd5e9565cda2d5ec166a8.zip
gcc-90841d4302e804d0eafdd5e9565cda2d5ec166a8.tar.gz
gcc-90841d4302e804d0eafdd5e9565cda2d5ec166a8.tar.bz2
re PR sanitizer/78651 (Incorrect exception handling when catch clause uses local class and PIC and sanitizer are active)
PR sanitizer/78651 * dwarf2asm.c: Include fold-const.c. (dw2_output_indirect_constant_1): Set DECL_INITIAL (decl) to ADDR_EXPR of decl rather than decl itself. From-SVN: r258664
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/dwarf2asm.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 624bf15..9df89dc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2018-03-19 Jakub Jelinek <jakub@redhat.com>
+ PR sanitizer/78651
+ * dwarf2asm.c: Include fold-const.c.
+ (dw2_output_indirect_constant_1): Set DECL_INITIAL (decl) to ADDR_EXPR
+ of decl rather than decl itself.
+
PR rtl-optimization/84643
* memmodel.h (enum memmodel): Add MEMMODEL_MAX enumerator.
diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c
index 2e108ac..cdb629f 100644
--- a/gcc/dwarf2asm.c
+++ b/gcc/dwarf2asm.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "dwarf2.h"
#include "function.h"
#include "emit-rtl.h"
+#include "fold-const.h"
#ifndef XCOFF_DEBUGGING_INFO
#define XCOFF_DEBUGGING_INFO 0
@@ -954,7 +955,7 @@ dw2_output_indirect_constant_1 (const char *sym, tree id)
SET_DECL_ASSEMBLER_NAME (decl, id);
DECL_ARTIFICIAL (decl) = 1;
DECL_IGNORED_P (decl) = 1;
- DECL_INITIAL (decl) = decl;
+ DECL_INITIAL (decl) = build_fold_addr_expr (decl);
TREE_READONLY (decl) = 1;
TREE_STATIC (decl) = 1;