aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-06-16 09:36:09 +0200
committerRichard Biener <rguenther@suse.de>2020-06-16 13:56:55 +0200
commita97e49a89d11b302b12ec319a3316ba78adca02a (patch)
tree5cb498dfd7b548d4b4c37d802d39f325b120cf57 /gcc/varasm.c
parent2210ef7d3d68a027ec16476825049567953c7fa4 (diff)
downloadgcc-a97e49a89d11b302b12ec319a3316ba78adca02a.zip
gcc-a97e49a89d11b302b12ec319a3316ba78adca02a.tar.gz
gcc-a97e49a89d11b302b12ec319a3316ba78adca02a.tar.bz2
middle-end/95690 - avoid MEM_EXPRs for constants
The following avoids calling set_mem_attributes on the DECL_INITIAL of a CONST_DECL which seems pointless since there cannot be a sensible MEM_EXPR derived from that. We're overwriting both other possibly useful info, alias-set and alignment immediately so the following patch simply removes the call instead of making the function deal with even more (unexpected) trees that are not memory accesses. 2020-06-16 Richard Biener <rguenther@suse.de> PR middle-end/95690 * varasm.c (build_constant_desc): Remove set_mem_attributes call. * gfortran.dg/pr95690.f90: New testcase.
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index f062e48..4070f9c 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -3399,7 +3399,6 @@ build_constant_desc (tree exp)
TREE_CONSTANT_POOL_ADDRESS_P (symbol) = 1;
rtl = gen_const_mem (TYPE_MODE (TREE_TYPE (exp)), symbol);
- set_mem_attributes (rtl, exp, 1);
set_mem_alias_set (rtl, 0);
/* Putting EXP into the literal pool might have imposed a different