aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-prop.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2010-11-14 11:24:47 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2010-11-14 11:24:47 +0000
commitae788515d2b28952fdee5a83b010667dc9285732 (patch)
tree97e1975467157f9597f21ef3b60596ea692c84ce /gcc/ipa-prop.c
parent8926bd5d5c308154694122957e2a54c965ebee08 (diff)
downloadgcc-ae788515d2b28952fdee5a83b010667dc9285732.zip
gcc-ae788515d2b28952fdee5a83b010667dc9285732.tar.gz
gcc-ae788515d2b28952fdee5a83b010667dc9285732.tar.bz2
re PR tree-optimization/45722 (FAIL: gcc.c-torture/execute/20040709-2.c execution at -O1 and -Os)
PR tree-optimization/45722 * tree-sra.c (build_ref_for_model): Always build a COMPONENT_REF if this is a reference to a component. * ipa-prop.c (ipa_get_member_ptr_load_param): Accept COMPONENT_REF. (ipa_note_param_call): Adjust comment. From-SVN: r166731
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r--gcc/ipa-prop.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 473f483a..7c7df56 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -918,10 +918,15 @@ ipa_compute_jump_functions (struct cgraph_node *node,
static tree
ipa_get_member_ptr_load_param (tree rhs, bool use_delta)
{
- tree rec, ref_offset, fld_offset;
- tree ptr_field;
- tree delta_field;
+ tree rec, ref_field, ref_offset, fld, fld_offset, ptr_field, delta_field;
+ if (TREE_CODE (rhs) == COMPONENT_REF)
+ {
+ ref_field = TREE_OPERAND (rhs, 1);
+ rhs = TREE_OPERAND (rhs, 0);
+ }
+ else
+ ref_field = NULL_TREE;
if (TREE_CODE (rhs) != MEM_REF)
return NULL_TREE;
rec = TREE_OPERAND (rhs, 0);
@@ -933,6 +938,20 @@ ipa_get_member_ptr_load_param (tree rhs, bool use_delta)
return NULL_TREE;
ref_offset = TREE_OPERAND (rhs, 1);
+
+ if (ref_field)
+ {
+ if (integer_nonzerop (ref_offset))
+ return NULL_TREE;
+
+ if (use_delta)
+ fld = delta_field;
+ else
+ fld = ptr_field;
+
+ return ref_field == fld ? rec : NULL_TREE;
+ }
+
if (use_delta)
fld_offset = byte_position (delta_field);
else
@@ -1005,10 +1024,15 @@ ipa_note_param_call (struct cgraph_node *node, int param_index, gimple stmt,
below, the call is on the last line:
<bb 2>:
+ f$__delta_5 = f.__delta;
+ f$__pfn_24 = f.__pfn;
+
+ or
+ <bb 2>:
f$__delta_5 = MEM[(struct *)&f];
f$__pfn_24 = MEM[(struct *)&f + 4B];
- ...
+ and a few lines below:
<bb 5>
D.2496_3 = (int) f$__pfn_24;