From 315036fe5403bf7fe49b4f569b645369c7989aac Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Fri, 26 Aug 2011 14:02:28 +0000 Subject: [PATCH] varasm.c (decode_addr_const): Handle MEM_REF[&X, OFF]. 2011-08-26 Richard Guenther * varasm.c (decode_addr_const): Handle MEM_REF[&X, OFF]. From-SVN: r178107 --- gcc/ChangeLog | 4 ++++ gcc/varasm.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9412f498569..28c9d2f5107 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2011-08-26 Richard Guenther + + * varasm.c (decode_addr_const): Handle MEM_REF[&X, OFF]. + 2011-08-26 Zdenek Dvorak Tom de Vries diff --git a/gcc/varasm.c b/gcc/varasm.c index a612888d6f3..e83bebbb04e 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -2592,6 +2592,12 @@ decode_addr_const (tree exp, struct addr_const *value) * tree_low_cst (TREE_OPERAND (target, 1), 0)); target = TREE_OPERAND (target, 0); } + else if (TREE_CODE (target) == MEM_REF + && TREE_CODE (TREE_OPERAND (target, 0)) == ADDR_EXPR) + { + offset += mem_ref_offset (target).low; + target = TREE_OPERAND (TREE_OPERAND (target, 0), 0); + } else if (TREE_CODE (target) == INDIRECT_REF && TREE_CODE (TREE_OPERAND (target, 0)) == NOP_EXPR && TREE_CODE (TREE_OPERAND (TREE_OPERAND (target, 0), 0)) -- 2.30.2