diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1995-03-10 11:28:07 -0800 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1995-03-10 11:28:07 -0800 |
commit | 310bbbf468139f038709bf212b8c9f64a4be61a8 (patch) | |
tree | 7cdd03b9623f929e436752e61a688f9b326fb4f6 /gcc | |
parent | 31c97f6a227591c55d4f1b15e9ea8afea7e3fff4 (diff) | |
download | gcc-310bbbf468139f038709bf212b8c9f64a4be61a8.zip gcc-310bbbf468139f038709bf212b8c9f64a4be61a8.tar.gz gcc-310bbbf468139f038709bf212b8c9f64a4be61a8.tar.bz2 |
(copy_constant): Copy operand of ADDR_EXPR if it is a constant.
From-SVN: r9164
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/varasm.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 537d9b2..818628b 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -2568,12 +2568,18 @@ copy_constant (exp) { switch (TREE_CODE (exp)) { + case ADDR_EXPR: + /* For ADDR_EXPR, we do not want to copy the decl whose address + is requested. We do want to copy constants though. */ + if (TREE_CODE_CLASS (TREE_CODE (TREE_OPERAND (exp, 0))) == 'c') + return build1 (TREE_CODE (exp), TREE_TYPE (exp), + copy_constant (TREE_OPERAND (exp, 0))); + else + return copy_node (exp); + case INTEGER_CST: case REAL_CST: case STRING_CST: - case ADDR_EXPR: - /* For ADDR_EXPR, we do not want to copy the decl - whose address is requested. */ return copy_node (exp); case COMPLEX_CST: |