From: Jim Wilson Date: Fri, 10 Mar 1995 19:28:07 +0000 (-0800) Subject: (copy_constant): Copy operand of ADDR_EXPR if it is a constant. X-Git-Tag: misc/cutover-egcs-0~4792 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=310bbbf468139f038709bf212b8c9f64a4be61a8;p=thirdparty%2Fgcc.git (copy_constant): Copy operand of ADDR_EXPR if it is a constant. From-SVN: r9164 --- diff --git a/gcc/varasm.c b/gcc/varasm.c index 537d9b272f48..818628ba2738 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: