Commit 5f0be3d0 by Andrew Pinski Committed by Andrew Pinski

re PR middle-end/17957 (vector type node used after garbage-collected)

2004-11-25  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/17957
        * testsuite/gcc.dg/pr17957.c: New test.

2004-11-25  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/17957
        * tree-complex.c (vector_inner_type): New variable moved from
        build_word_mode_vector_type.
        (vector_last_type): Likewise.
        (vector_last_nunits): Likewise.
        (build_word_mode_vector_type): Use the new variables.
        * Makefile.in (tree-complex.o): Add gt-tree-complex.h $(GGC_H).
        (GTFILES): Add tree-complex.c.
        (gt-tree-complex.h): New rule, add it to the rest of the gt-* rules.

From-SVN: r91322
parent c0b57a5a
2004-11-25 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/17957
* tree-complex.c (vector_inner_type): New variable moved from
build_word_mode_vector_type.
(vector_last_type): Likewise.
(vector_last_nunits): Likewise.
(build_word_mode_vector_type): Use the new variables.
* Makefile.in (tree-complex.o): Add gt-tree-complex.h $(GGC_H).
(GTFILES): Add tree-complex.c.
(gt-tree-complex.h): New rule, add it to the rest of the gt-* rules.
2004-11-25 Bob Wilson <bob.wilson@acm.org> 2004-11-25 Bob Wilson <bob.wilson@acm.org>
* config/xtensa/xtensa.h (TARGET_CPU_CPP_BUILTINS): Define * config/xtensa/xtensa.h (TARGET_CPU_CPP_BUILTINS): Define
......
...@@ -1962,7 +1962,7 @@ tree-sra.o : tree-sra.c $(CONFIG_H) system.h errors.h $(TREE_H) $(RTL_H) \ ...@@ -1962,7 +1962,7 @@ tree-sra.o : tree-sra.c $(CONFIG_H) system.h errors.h $(TREE_H) $(RTL_H) \
tree-complex.o : tree-complex.c $(CONFIG_H) system.h $(TREE_H) \ tree-complex.o : tree-complex.c $(CONFIG_H) system.h $(TREE_H) \
$(TM_H) $(TREE_FLOW_H) $(TREE_GIMPLE_H) tree-iterator.h tree-pass.h \ $(TM_H) $(TREE_FLOW_H) $(TREE_GIMPLE_H) tree-iterator.h tree-pass.h \
$(FLAGS_H) $(OPTABS_H) $(RTL_H) $(MACHMODE_H) $(EXPR_H) \ $(FLAGS_H) $(OPTABS_H) $(RTL_H) $(MACHMODE_H) $(EXPR_H) \
langhooks.h $(FLAGS_H) $(DIAGNOSTIC_H) langhooks.h $(FLAGS_H) $(DIAGNOSTIC_H) gt-tree-complex.h $(GGC_H)
df.o : df.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ df.o : df.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
insn-config.h $(RECOG_H) function.h $(REGS_H) alloc-pool.h hard-reg-set.h \ insn-config.h $(RECOG_H) function.h $(REGS_H) alloc-pool.h hard-reg-set.h \
$(BASIC_BLOCK_H) $(DF_H) $(BASIC_BLOCK_H) $(DF_H)
...@@ -2420,7 +2420,7 @@ GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h \ ...@@ -2420,7 +2420,7 @@ GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/tree-phinodes.c $(srcdir)/tree-cfg.c \ $(srcdir)/tree-phinodes.c $(srcdir)/tree-cfg.c \
$(srcdir)/tree-dfa.c $(srcdir)/tree-ssa-propagate.c \ $(srcdir)/tree-dfa.c $(srcdir)/tree-ssa-propagate.c \
$(srcdir)/tree-iterator.c $(srcdir)/gimplify.c \ $(srcdir)/tree-iterator.c $(srcdir)/gimplify.c \
$(srcdir)/tree-chrec.h \ $(srcdir)/tree-chrec.h $(srcdir)/tree-complex.c \
$(srcdir)/tree-ssa-operands.h $(srcdir)/tree-ssa-operands.c \ $(srcdir)/tree-ssa-operands.h $(srcdir)/tree-ssa-operands.c \
$(srcdir)/tree-profile.c $(srcdir)/rtl-profile.c $(srcdir)/tree-nested.c \ $(srcdir)/tree-profile.c $(srcdir)/rtl-profile.c $(srcdir)/tree-nested.c \
$(out_file) \ $(out_file) \
...@@ -2439,7 +2439,7 @@ gt-expr.h gt-sdbout.h gt-optabs.h gt-bitmap.h gt-dojump.h \ ...@@ -2439,7 +2439,7 @@ gt-expr.h gt-sdbout.h gt-optabs.h gt-bitmap.h gt-dojump.h \
gt-dwarf2out.h gt-ra-build.h gt-reg-stack.h gt-dwarf2asm.h \ gt-dwarf2out.h gt-ra-build.h gt-reg-stack.h gt-dwarf2asm.h \
gt-dbxout.h gt-c-common.h gt-c-decl.h gt-c-parse.h \ gt-dbxout.h gt-c-common.h gt-c-decl.h gt-c-parse.h \
gt-c-pragma.h gtype-c.h gt-input.h gt-cfglayout.h \ gt-c-pragma.h gtype-c.h gt-input.h gt-cfglayout.h \
gt-tree-mudflap.h \ gt-tree-mudflap.h gt-tree-complex.h \
gt-tree-ssa-ccp.h gt-tree-eh.h \ gt-tree-ssa-ccp.h gt-tree-eh.h \
gt-tree-ssanames.h gt-tree-iterator.h gt-gimplify.h \ gt-tree-ssanames.h gt-tree-iterator.h gt-gimplify.h \
gt-tree-phinodes.h gt-tree-cfg.h gt-tree-nested.h \ gt-tree-phinodes.h gt-tree-cfg.h gt-tree-nested.h \
......
2004-11-25 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/17957
* testsuite/gcc.dg/pr17957.c: New test.
2004-11-25 Mark Mitchell <mark@codesourcery.com> 2004-11-25 Mark Mitchell <mark@codesourcery.com>
PR c++/18445 PR c++/18445
......
/* { dg-do compile } */
/* { dg-options "--param ggc-min-expand=0 -param ggc-min-heapsize=0" } */
__attribute__ ((vector_size (64))) unsigned char v1, v2, v3;
void
vadd (void)
{
v1 = v2 + v3;
}
void
test_add (void)
{
vadd ();
}
void
vsub (void)
{
v1 = v2 - v3;
}
...@@ -35,6 +35,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -35,6 +35,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tree-iterator.h" #include "tree-iterator.h"
#include "tree-pass.h" #include "tree-pass.h"
#include "flags.h" #include "flags.h"
#include "ggc.h"
/* Extract the real or imaginary part of a complex variable or constant. /* Extract the real or imaginary part of a complex variable or constant.
...@@ -509,25 +510,30 @@ build_replicated_const (tree type, tree inner_type, HOST_WIDE_INT value) ...@@ -509,25 +510,30 @@ build_replicated_const (tree type, tree inner_type, HOST_WIDE_INT value)
return ret; return ret;
} }
static GTY(()) tree vector_inner_type;
static GTY(()) tree vector_last_type;
static GTY(()) int vector_last_nunits;
/* Return a suitable vector types made of SUBPARTS units each of mode /* Return a suitable vector types made of SUBPARTS units each of mode
"word_mode" (the global variable). */ "word_mode" (the global variable). */
static tree static tree
build_word_mode_vector_type (int nunits) build_word_mode_vector_type (int nunits)
{ {
static tree innertype; if (!vector_inner_type)
static tree last; vector_inner_type = lang_hooks.types.type_for_mode (word_mode, 1);
static int last_nunits; else if (vector_last_nunits == nunits)
{
if (!innertype) gcc_assert (TREE_CODE (vector_last_type) == VECTOR_TYPE);
innertype = lang_hooks.types.type_for_mode (word_mode, 1); return vector_last_type;
else if (last_nunits == nunits) }
return last;
/* We build a new type, but we canonicalize it nevertheless, /* We build a new type, but we canonicalize it nevertheless,
because it still saves some memory. */ because it still saves some memory. */
last_nunits = nunits; vector_last_nunits = nunits;
last = type_hash_canon (nunits, build_vector_type (innertype, nunits)); vector_last_type = type_hash_canon (nunits,
return last; build_vector_type (vector_inner_type,
nunits));
return vector_last_type;
} }
typedef tree (*elem_op_func) (block_stmt_iterator *, typedef tree (*elem_op_func) (block_stmt_iterator *,
...@@ -953,3 +959,5 @@ struct tree_opt_pass pass_pre_expand = ...@@ -953,3 +959,5 @@ struct tree_opt_pass pass_pre_expand =
| TODO_verify_stmts, /* todo_flags_finish */ | TODO_verify_stmts, /* todo_flags_finish */
0 /* letter */ 0 /* letter */
}; };
#include "gt-tree-complex.h"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment