summaryrefslogtreecommitdiff
path: root/gcc/ipa-polymorphic-call.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-06-22 09:02:50 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2015-06-22 07:02:50 +0000
commit7083621fad0baad1dfcbb6ab42bea360879c2081 (patch)
treec9c42892cd8505eef05d676c623dc168fecd67ea /gcc/ipa-polymorphic-call.c
parent6b4db50158952b893df977aff9eb1b470edbc65a (diff)
re PR rtl-optimization/66351 (r223883 miscompiles stage2 compiler on ia64)
PR ipa/66351 * ipa-polymorphic-call.c (ipa_polymorphic_call_context::get_dynamic_type): Fix thinko when initializing alias oracle; fix formating; set base_alias_set if it is known. From-SVN: r224719
Diffstat (limited to 'gcc/ipa-polymorphic-call.c')
-rw-r--r--gcc/ipa-polymorphic-call.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/gcc/ipa-polymorphic-call.c b/gcc/ipa-polymorphic-call.c
index 0036565a844..ac8c78ea8f1 100644
--- a/gcc/ipa-polymorphic-call.c
+++ b/gcc/ipa-polymorphic-call.c
@@ -1574,13 +1574,15 @@ ipa_polymorphic_call_context::get_dynamic_type (tree instance,
tree base_ref = get_ref_base_and_extent
(ref_exp, &offset2, &size, &max_size);
- /* Finally verify that what we found looks like read from OTR_OBJECT
- or from INSTANCE with offset OFFSET. */
+ /* Finally verify that what we found looks like read from
+ OTR_OBJECT or from INSTANCE with offset OFFSET. */
if (base_ref
&& ((TREE_CODE (base_ref) == MEM_REF
&& ((offset2 == instance_offset
&& TREE_OPERAND (base_ref, 0) == instance)
- || (!offset2 && TREE_OPERAND (base_ref, 0) == otr_object)))
+ || (!offset2
+ && TREE_OPERAND (base_ref, 0)
+ == otr_object)))
|| (DECL_P (instance) && base_ref == instance
&& offset2 == instance_offset)))
{
@@ -1608,9 +1610,17 @@ ipa_polymorphic_call_context::get_dynamic_type (tree instance,
/* We look for vtbl pointer read. */
ao.size = POINTER_SIZE;
ao.max_size = ao.size;
+ /* We are looking for stores to vptr pointer within the instance of
+ outer type.
+ TODO: The vptr pointer type is globally known, we probably should
+ keep it and do that even when otr_type is unknown. */
if (otr_type)
- ao.ref_alias_set
- = get_deref_alias_set (TREE_TYPE (BINFO_VTABLE (TYPE_BINFO (otr_type))));
+ {
+ ao.base_alias_set
+ = get_alias_set (outer_type ? outer_type : otr_type);
+ ao.ref_alias_set
+ = get_alias_set (TREE_TYPE (BINFO_VTABLE (TYPE_BINFO (otr_type))));
+ }
if (dump_file)
{