varasm.c (decode_addr_const): Handle MEM_REF[&X, OFF].

2011-08-26  Richard Guenther  <rguenther@suse.de>

	* varasm.c (decode_addr_const): Handle MEM_REF[&X, OFF].

From-SVN: r178107
This commit is contained in:
Richard Guenther 2011-08-26 14:02:28 +00:00 committed by Richard Biener
parent 3e0694cf75
commit 315036fe54
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2011-08-26 Richard Guenther <rguenther@suse.de>
* varasm.c (decode_addr_const): Handle MEM_REF[&X, OFF].
2011-08-26 Zdenek Dvorak <ook@ucw.cz>
Tom de Vries <tom@codesourcery.com>

View File

@ -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))