summaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-06-26 11:54:58 -0700
committerH.J. Lu <hjl.tools@gmail.com>2012-06-26 11:54:58 -0700
commit241abac138d2b3bd184cbc9d5bf53cde3857a7a4 (patch)
tree50e18f41c302adc6a4d490cad98365f60c9465c1 /gcc/varasm.c
parente7e782527af100a7802b6903b15524fac6cd5da2 (diff)
parent24fe62c79a89d579257790e268b0b9ea87940a89 (diff)
downloadgcc-hjl/x32/gcc-4_6-branch+mx32.tar.gz
Merge branch 'hjl/x32/gcc-4_6-branch' into hjl/x32/gcc-4_6-branch+mx32hjl/x32/gcc-4_6-branch+mx32
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index d9748887d89..977ca40a088 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1,7 +1,7 @@
/* Output variables, constants and external declarations, for GNU compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010, 2011 Free Software Foundation, Inc.
+ 2010, 2011, 2012 Free Software Foundation, Inc.
This file is part of GCC.
@@ -3944,6 +3944,13 @@ compute_reloc_for_constant (tree exp)
tem = TREE_OPERAND (tem, 0))
;
+ if (TREE_CODE (tem) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (tem, 0)) == ADDR_EXPR)
+ {
+ reloc = compute_reloc_for_constant (TREE_OPERAND (tem, 0));
+ break;
+ }
+
if (TREE_PUBLIC (tem))
reloc |= 2;
else
@@ -4012,6 +4019,9 @@ output_addressed_constants (tree exp)
if (CONSTANT_CLASS_P (tem) || TREE_CODE (tem) == CONSTRUCTOR)
output_constant_def (tem, 0);
+
+ if (TREE_CODE (tem) == MEM_REF)
+ output_addressed_constants (TREE_OPERAND (tem, 0));
break;
case PLUS_EXPR: