mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-19 22:41:28 +08:00
emit-rtl.c (component_ref_for_mem_expr): Try harder to find decl underneath COMPONENT_REFs.
* emit-rtl.c (component_ref_for_mem_expr): Try harder to find decl underneath COMPONENT_REFs. (set_mem_attributes): Also strip VIEW_CONVERT_EXPR. From-SVN: r47662
This commit is contained in:
parent
ef31d0c25e
commit
c56e3582c2
@ -1,3 +1,9 @@
|
||||
Wed Dec 5 06:26:27 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
|
||||
|
||||
* emit-rtl.c (component_ref_for_mem_expr): Try harder to find decl
|
||||
underneath COMPONENT_REFs.
|
||||
(set_mem_attributes): Also strip VIEW_CONVERT_EXPR.
|
||||
|
||||
2001-12-05 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||
|
||||
* toplev.c (display_target_options): Don't print twice.
|
||||
|
@ -1649,13 +1649,31 @@ component_ref_for_mem_expr (ref)
|
||||
|
||||
if (TREE_CODE (inner) == COMPONENT_REF)
|
||||
inner = component_ref_for_mem_expr (inner);
|
||||
else if (! DECL_P (inner))
|
||||
inner = NULL_TREE;
|
||||
else
|
||||
{
|
||||
tree placeholder_ptr = 0;
|
||||
|
||||
/* Now remove any conversions: they don't change what the underlying
|
||||
object is. Likewise for SAVE_EXPR. Also handle PLACEHOLDER_EXPR. */
|
||||
while (TREE_CODE (inner) == NOP_EXPR || TREE_CODE (inner) == CONVERT_EXPR
|
||||
|| TREE_CODE (inner) == NON_LVALUE_EXPR
|
||||
|| TREE_CODE (inner) == VIEW_CONVERT_EXPR
|
||||
|| TREE_CODE (inner) == SAVE_EXPR
|
||||
|| TREE_CODE (inner) == PLACEHOLDER_EXPR)
|
||||
if (TREE_CODE (inner) == PLACEHOLDER_EXPR)
|
||||
inner = find_placeholder (inner, &placeholder_ptr);
|
||||
else
|
||||
inner = TREE_OPERAND (inner, 0);
|
||||
|
||||
if (! DECL_P (inner))
|
||||
inner = NULL_TREE;
|
||||
}
|
||||
|
||||
if (inner == TREE_OPERAND (ref, 0))
|
||||
return ref;
|
||||
else
|
||||
return build (COMPONENT_REF, TREE_TYPE (ref), inner, TREE_OPERAND (ref, 1));
|
||||
return build (COMPONENT_REF, TREE_TYPE (ref), inner,
|
||||
TREE_OPERAND (ref, 1));
|
||||
}
|
||||
|
||||
/* Given REF, a MEM, and T, either the type of X or the expression
|
||||
@ -1723,10 +1741,12 @@ set_mem_attributes (ref, t, objectp)
|
||||
if (TREE_THIS_VOLATILE (t))
|
||||
MEM_VOLATILE_P (ref) = 1;
|
||||
|
||||
/* Now remove any NOPs: they don't change what the underlying object is.
|
||||
Likewise for SAVE_EXPR. */
|
||||
/* Now remove any conversions: they don't change what the underlying
|
||||
object is. Likewise for SAVE_EXPR. */
|
||||
while (TREE_CODE (t) == NOP_EXPR || TREE_CODE (t) == CONVERT_EXPR
|
||||
|| TREE_CODE (t) == NON_LVALUE_EXPR || TREE_CODE (t) == SAVE_EXPR)
|
||||
|| TREE_CODE (t) == NON_LVALUE_EXPR
|
||||
|| TREE_CODE (t) == VIEW_CONVERT_EXPR
|
||||
|| TREE_CODE (t) == SAVE_EXPR)
|
||||
t = TREE_OPERAND (t, 0);
|
||||
|
||||
/* If this expression can't be addressed (e.g., it contains a reference
|
||||
|
Loading…
x
Reference in New Issue
Block a user