aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorIlya Enkovich <ilya.enkovich@intel.com>2015-02-13 09:44:07 +0000
committerIlya Enkovich <ienkovich@gcc.gnu.org>2015-02-13 09:44:07 +0000
commitfb0653ab96ba450a5f364cbf9463060dfe5729f5 (patch)
tree4b2a3f514eba8ef119ef3719ecd498308e88ca4a /gcc/tree-sra.c
parent3c780bb2d55431af3ade07c418f831ff19505735 (diff)
downloadgcc-fb0653ab96ba450a5f364cbf9463060dfe5729f5.zip
gcc-fb0653ab96ba450a5f364cbf9463060dfe5729f5.tar.gz
gcc-fb0653ab96ba450a5f364cbf9463060dfe5729f5.tar.bz2
re PR tree-optimization/65002 (ICE: Segmentation fault)
gcc/ PR tree-optimization/65002 * tree-cfg.c (pass_data_fixup_cfg): Don't update SSA on start. * tree-sra.c (some_callers_have_no_vuse_p): New. (ipa_early_sra): Reject functions whose callers assume function is read only. gcc/testsuite/ PR tree-optimization/65002 * gcc.dg/pr65002.C: New. From-SVN: r220679
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r--gcc/tree-sra.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index c6726a8..023b817 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -4890,6 +4890,20 @@ some_callers_have_mismatched_arguments_p (struct cgraph_node *node,
return false;
}
+/* Return false if all callers have vuse attached to a call statement. */
+
+static bool
+some_callers_have_no_vuse_p (struct cgraph_node *node,
+ void *data ATTRIBUTE_UNUSED)
+{
+ struct cgraph_edge *cs;
+ for (cs = node->callers; cs; cs = cs->next_caller)
+ if (!cs->call_stmt || !gimple_vuse (cs->call_stmt))
+ return true;
+
+ return false;
+}
+
/* Convert all callers of NODE. */
static bool
@@ -5116,6 +5130,15 @@ ipa_early_sra (void)
goto simple_out;
}
+ if (node->call_for_symbol_thunks_and_aliases
+ (some_callers_have_no_vuse_p, NULL, true))
+ {
+ if (dump_file)
+ fprintf (dump_file, "There are callers with no VUSE attached "
+ "to a call stmt.\n");
+ goto simple_out;
+ }
+
bb_dereferences = XCNEWVEC (HOST_WIDE_INT,
func_param_count
* last_basic_block_for_fn (cfun));