mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-29 22:25:57 +08:00
re PR tree-optimization/24300 (segfault in operand_equal_p with -ftree-vectorize)
PR tree-opt/24300 * Makefile.in (tree-ssa-dce.o): Depend on CFGLOOP_H. * tree-ssa-dce.c: Include cfgloop.h. (tree_ssa_dce_loop, pass_dce_loop): New. * tree-pass.h (pass_dce_loop): Declare it. * passes.c (init_optimization_passes): Use it. From-SVN: r105250
This commit is contained in:
parent
5e8b5b0868
commit
4989673889
@ -1,3 +1,12 @@
|
|||||||
|
2005-10-11 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
|
PR tree-opt/24300
|
||||||
|
* Makefile.in (tree-ssa-dce.o): Depend on CFGLOOP_H.
|
||||||
|
* tree-ssa-dce.c: Include cfgloop.h.
|
||||||
|
(tree_ssa_dce_loop, pass_dce_loop): New.
|
||||||
|
* tree-pass.h (pass_dce_loop): Declare it.
|
||||||
|
* passes.c (init_optimization_passes): Use it.
|
||||||
|
|
||||||
2005-10-11 Eric Botcazou <ebotcazou@libertysurf.fr>
|
2005-10-11 Eric Botcazou <ebotcazou@libertysurf.fr>
|
||||||
|
|
||||||
PR middle-end/24263
|
PR middle-end/24263
|
||||||
|
@ -2230,7 +2230,7 @@ mode-switching.o : mode-switching.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
|
|||||||
tree-ssa-dce.o : tree-ssa-dce.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
|
tree-ssa-dce.o : tree-ssa-dce.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
|
||||||
$(RTL_H) $(TM_P_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) \
|
$(RTL_H) $(TM_P_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) \
|
||||||
coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) $(BASIC_BLOCK_H) \
|
coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) $(BASIC_BLOCK_H) \
|
||||||
$(GGC_H) hard-reg-set.h $(OBSTACK_H) $(TREE_GIMPLE_H)
|
$(GGC_H) hard-reg-set.h $(OBSTACK_H) $(TREE_GIMPLE_H) $(CFGLOOP_H)
|
||||||
tree-ssa-ccp.o : tree-ssa-ccp.c $(TREE_FLOW_H) $(CONFIG_H) \
|
tree-ssa-ccp.o : tree-ssa-ccp.c $(TREE_FLOW_H) $(CONFIG_H) \
|
||||||
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h \
|
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h \
|
||||||
$(DIAGNOSTIC_H) function.h $(TIMEVAR_H) $(TM_H) coretypes.h \
|
$(DIAGNOSTIC_H) function.h $(TIMEVAR_H) $(TM_H) coretypes.h \
|
||||||
|
@ -595,12 +595,7 @@ init_optimization_passes (void)
|
|||||||
|
|
||||||
p = &pass_vectorize.sub;
|
p = &pass_vectorize.sub;
|
||||||
NEXT_PASS (pass_lower_vector_ssa);
|
NEXT_PASS (pass_lower_vector_ssa);
|
||||||
/* ??? The loop optimizers are not GC safe. See PR 21805.
|
NEXT_PASS (pass_dce_loop);
|
||||||
Turn off GC while registering this pass. */
|
|
||||||
pass_dce.todo_flags_finish &= ~TODO_ggc_collect;
|
|
||||||
NEXT_PASS (pass_dce);
|
|
||||||
pass_dce.todo_flags_finish |= TODO_ggc_collect;
|
|
||||||
gcc_assert (p != &pass_dce.next);
|
|
||||||
*p = NULL;
|
*p = NULL;
|
||||||
|
|
||||||
p = &pass_loop2.sub;
|
p = &pass_loop2.sub;
|
||||||
|
35
gcc/testsuite/gcc.dg/vect/pr24300.c
Normal file
35
gcc/testsuite/gcc.dg/vect/pr24300.c
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/* { dg-do compile } */
|
||||||
|
|
||||||
|
static int *** foo (int);
|
||||||
|
|
||||||
|
void
|
||||||
|
bar ()
|
||||||
|
{
|
||||||
|
int ***p = foo (2);
|
||||||
|
}
|
||||||
|
|
||||||
|
extern int *nd;
|
||||||
|
extern int ***tc;
|
||||||
|
extern int *ap;
|
||||||
|
extern int *as;
|
||||||
|
extern float ss;
|
||||||
|
|
||||||
|
static int ***
|
||||||
|
foo (int Fc)
|
||||||
|
{
|
||||||
|
int i, j, s, p, n, t;
|
||||||
|
|
||||||
|
n = 0;
|
||||||
|
for (s = 0; s < 4; s++)
|
||||||
|
n += nd[s];
|
||||||
|
|
||||||
|
for (i = 0; i < n; i++)
|
||||||
|
{
|
||||||
|
p = ap[i];
|
||||||
|
s = as[i];
|
||||||
|
for (j = 0; j < Fc; j++)
|
||||||
|
tc[p][s][j] = i * ss + j;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (tc);
|
||||||
|
}
|
@ -243,6 +243,7 @@ extern struct tree_opt_pass pass_build_ssa;
|
|||||||
extern struct tree_opt_pass pass_del_ssa;
|
extern struct tree_opt_pass pass_del_ssa;
|
||||||
extern struct tree_opt_pass pass_dominator;
|
extern struct tree_opt_pass pass_dominator;
|
||||||
extern struct tree_opt_pass pass_dce;
|
extern struct tree_opt_pass pass_dce;
|
||||||
|
extern struct tree_opt_pass pass_dce_loop;
|
||||||
extern struct tree_opt_pass pass_cd_dce;
|
extern struct tree_opt_pass pass_cd_dce;
|
||||||
extern struct tree_opt_pass pass_merge_phi;
|
extern struct tree_opt_pass pass_merge_phi;
|
||||||
extern struct tree_opt_pass pass_may_alias;
|
extern struct tree_opt_pass pass_may_alias;
|
||||||
|
@ -64,6 +64,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
|||||||
#include "tree-pass.h"
|
#include "tree-pass.h"
|
||||||
#include "timevar.h"
|
#include "timevar.h"
|
||||||
#include "flags.h"
|
#include "flags.h"
|
||||||
|
#include "cfgloop.h"
|
||||||
|
|
||||||
static struct stmt_stats
|
static struct stmt_stats
|
||||||
{
|
{
|
||||||
@ -941,6 +942,13 @@ tree_ssa_dce (void)
|
|||||||
perform_tree_ssa_dce (/*aggressive=*/false);
|
perform_tree_ssa_dce (/*aggressive=*/false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
tree_ssa_dce_loop (void)
|
||||||
|
{
|
||||||
|
perform_tree_ssa_dce (/*aggressive=*/false);
|
||||||
|
free_numbers_of_iterations_estimates (current_loops);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
tree_ssa_cd_dce (void)
|
tree_ssa_cd_dce (void)
|
||||||
{
|
{
|
||||||
@ -974,6 +982,26 @@ struct tree_opt_pass pass_dce =
|
|||||||
0 /* letter */
|
0 /* letter */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct tree_opt_pass pass_dce_loop =
|
||||||
|
{
|
||||||
|
"dceloop", /* name */
|
||||||
|
gate_dce, /* gate */
|
||||||
|
tree_ssa_dce_loop, /* execute */
|
||||||
|
NULL, /* sub */
|
||||||
|
NULL, /* next */
|
||||||
|
0, /* static_pass_number */
|
||||||
|
TV_TREE_DCE, /* tv_id */
|
||||||
|
PROP_cfg | PROP_ssa | PROP_alias, /* properties_required */
|
||||||
|
0, /* properties_provided */
|
||||||
|
0, /* properties_destroyed */
|
||||||
|
0, /* todo_flags_start */
|
||||||
|
TODO_dump_func
|
||||||
|
| TODO_update_ssa_no_phi
|
||||||
|
| TODO_cleanup_cfg
|
||||||
|
| TODO_verify_ssa, /* todo_flags_finish */
|
||||||
|
0 /* letter */
|
||||||
|
};
|
||||||
|
|
||||||
struct tree_opt_pass pass_cd_dce =
|
struct tree_opt_pass pass_cd_dce =
|
||||||
{
|
{
|
||||||
"cddce", /* name */
|
"cddce", /* name */
|
||||||
|
Loading…
Reference in New Issue
Block a user