aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-prop.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-04-12 07:44:52 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2015-04-12 05:44:52 +0000
commitdb66bf68a1cd1d417000032cc255dfe177ce50fc (patch)
tree8ac0aecfa0363647ac374049bbb636b19fed1996 /gcc/ipa-prop.c
parentc153ad0318b0d4845a3a1598cae7e2617f9fe0e5 (diff)
downloadgcc-db66bf68a1cd1d417000032cc255dfe177ce50fc.zip
gcc-db66bf68a1cd1d417000032cc255dfe177ce50fc.tar.gz
gcc-db66bf68a1cd1d417000032cc255dfe177ce50fc.tar.bz2
re PR middle-end/65743 (LTO+FDO build of Firefox crashes at startup)
PR ipa/65743 * ipa-inline-transform.c (speculation_removed): Remove static var. (check_speculations): New function. (clone_inlined_nodes): Do not check spculations. (inline_call): Call check_speculations. * ipa-prop.c (ipa_make_edge_direct_to_target): Do not consider non-invariants. From-SVN: r222017
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r--gcc/ipa-prop.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 89a4623..dc8f360 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -2626,9 +2626,29 @@ ipa_make_edge_direct_to_target (struct cgraph_edge *ie, tree target,
target = canonicalize_constructor_val (target, NULL);
if (!target || TREE_CODE (target) != FUNCTION_DECL)
{
- if (ie->indirect_info->member_ptr)
- /* Member pointer call that goes through a VMT lookup. */
- return NULL;
+ /* Member pointer call that goes through a VMT lookup. */
+ if (ie->indirect_info->member_ptr
+ /* Or if target is not an invariant expression and we do not
+ know if it will evaulate to function at runtime.
+ This can happen when folding through &VAR, where &VAR
+ is IP invariant, but VAR itself is not.
+
+ TODO: Revisit this when GCC 5 is branched. It seems that
+ member_ptr check is not needed and that we may try to fold
+ the expression and see if VAR is readonly. */
+ || !is_gimple_ip_invariant (target))
+ {
+ if (dump_enabled_p ())
+ {
+ location_t loc = gimple_location_safe (ie->call_stmt);
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc,
+ "discovered direct call non-invariant "
+ "%s/%i\n",
+ ie->caller->name (), ie->caller->order);
+ }
+ return NULL;
+ }
+
if (dump_enabled_p ())
{