aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Belevantsev <abel@ispras.ru>2010-10-14 11:59:57 +0400
committerAndrey Belevantsev <abel@gcc.gnu.org>2010-10-14 11:59:57 +0400
commitcfeb0fa8c91502d26d8e2cab0065ba6946562d4d (patch)
tree2de47a8d5084668e3ae0cf4ea9c11b147f68cb80
parent3e6a3f6fc3662f0c830f4d3e35634745ace379cf (diff)
downloadgcc-cfeb0fa8c91502d26d8e2cab0065ba6946562d4d.zip
gcc-cfeb0fa8c91502d26d8e2cab0065ba6946562d4d.tar.gz
gcc-cfeb0fa8c91502d26d8e2cab0065ba6946562d4d.tar.bz2
sel-sched-ir.c (init_global_and_expr_for_insn): Set CANT_MOVE on RTX_FRAME_RELATED_P insns and the insn to which...
* sel-sched-ir.c (init_global_and_expr_for_insn): Set CANT_MOVE on RTX_FRAME_RELATED_P insns and the insn to which NOTE_INSN_EPILOGUE_BEG is attached. * sched-vis.c (print_value): Allow NULL value. * gcc.target/ia64/20101005.c: New test. From-SVN: r165455
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/sched-vis.c5
-rw-r--r--gcc/sel-sched-ir.c42
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/ia64/20101014.c132
5 files changed, 179 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index caf71b3..5a8a4eb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2010-10-14 Andrey Belevantsev <abel@ispras.ru>
+ * sel-sched-ir.c (init_global_and_expr_for_insn): Set CANT_MOVE
+ on RTX_FRAME_RELATED_P insns and the insn to which
+ NOTE_INSN_EPILOGUE_BEG is attached.
+ * sched-vis.c (print_value): Allow NULL value.
+
+2010-10-14 Andrey Belevantsev <abel@ispras.ru>
+
PR rtl-optimization/45570
* sel-sched-ir.c (cfg_preds_1): When walking out of the region,
assert that we are pipelining outer loops. Allow returning
diff --git a/gcc/sched-vis.c b/gcc/sched-vis.c
index 98d1d1c..83c423a 100644
--- a/gcc/sched-vis.c
+++ b/gcc/sched-vis.c
@@ -428,6 +428,11 @@ print_value (char *buf, const_rtx x, int verbose)
char t[BUF_LEN];
char *cur = buf;
+ if (!x)
+ {
+ safe_concat (buf, buf, "(nil)");
+ return;
+ }
switch (GET_CODE (x))
{
case CONST_INT:
diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index f29f711..452d8d4 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -2862,18 +2862,38 @@ init_global_and_expr_for_insn (insn_t insn)
bool force_unique_p;
ds_t spec_done_ds;
- /* Certain instructions cannot be cloned. */
- if (CANT_MOVE (insn)
- || INSN_ASM_P (insn)
- || SCHED_GROUP_P (insn)
- || prologue_epilogue_contains (insn)
- /* Exception handling insns are always unique. */
- || (cfun->can_throw_non_call_exceptions && can_throw_internal (insn))
- /* TRAP_IF though have an INSN code is control_flow_insn_p (). */
- || control_flow_insn_p (insn))
- force_unique_p = true;
+ /* Certain instructions cannot be cloned, and frame related insns and
+ the insn adjacent to NOTE_INSN_EPILOGUE_BEG cannot be moved out of
+ their block. */
+ if (prologue_epilogue_contains (insn))
+ {
+ if (RTX_FRAME_RELATED_P (insn))
+ CANT_MOVE (insn) = 1;
+ else
+ {
+ rtx note;
+ for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
+ if (REG_NOTE_KIND (note) == REG_SAVE_NOTE
+ && ((enum insn_note) INTVAL (XEXP (note, 0))
+ == NOTE_INSN_EPILOGUE_BEG))
+ {
+ CANT_MOVE (insn) = 1;
+ break;
+ }
+ }
+ force_unique_p = true;
+ }
else
- force_unique_p = false;
+ if (CANT_MOVE (insn)
+ || INSN_ASM_P (insn)
+ || SCHED_GROUP_P (insn)
+ /* Exception handling insns are always unique. */
+ || (cfun->can_throw_non_call_exceptions && can_throw_internal (insn))
+ /* TRAP_IF though have an INSN code is control_flow_insn_p (). */
+ || control_flow_insn_p (insn))
+ force_unique_p = true;
+ else
+ force_unique_p = false;
if (targetm.sched.get_insn_spec_ds)
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 98ca284..753a523 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2010-10-14 Andrey Belevantsev <abel@ispras.ru>
+ * gcc.target/ia64/20101005.c: New test.
+
+2010-10-14 Andrey Belevantsev <abel@ispras.ru>
+
PR rtl-optimization/45570
* gcc.dg/pr45570.c: New test.
diff --git a/gcc/testsuite/gcc.target/ia64/20101014.c b/gcc/testsuite/gcc.target/ia64/20101014.c
new file mode 100644
index 0000000..7511c90
--- /dev/null
+++ b/gcc/testsuite/gcc.target/ia64/20101014.c
@@ -0,0 +1,132 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -fselective-scheduling2" } */
+
+typedef long unsigned int size_t;
+struct fileloc
+{
+ const char *file;
+};
+typedef struct type *type_p;
+typedef const struct type *const_type_p;
+enum typekind
+{
+ TYPE_STRUCT,
+ TYPE_UNION,
+ TYPE_POINTER,
+ TYPE_LANG_STRUCT,
+ TYPE_PARAM_STRUCT
+};
+struct type
+{
+ enum typekind kind;
+ union
+ {
+ struct
+ {
+ struct fileloc line;
+ } s;
+ struct
+ {
+ struct fileloc line;
+ } param_struct;
+ } u;
+};
+struct outf
+{
+ size_t bufused;
+ char *buf;
+};
+typedef struct outf *outf_p;
+oprintf (outf_p o, const char *format, ...)
+{
+ char *s;
+ size_t slength;
+ memcpy (o->buf + o->bufused, s, slength);
+}
+output_mangled_typename (outf_p of, const_type_p t)
+{
+ switch (t->kind)
+ {
+ case TYPE_POINTER: (fancy_abort ("/gcc/gengtype.c", 1988, __FUNCTION__));
+ }
+}
+output_type_enum (outf_p of, type_p s)
+{
+ if (s->kind == TYPE_PARAM_STRUCT && s->u.param_struct.line.file != ((void *)0))
+ {
+ oprintf (of, ", gt_e_");
+ }
+ else if (((s)->kind == TYPE_UNION || (s)->kind == TYPE_STRUCT || (s)->kind == TYPE_LANG_STRUCT) && s->u.s.line.file != ((void *)0))
+ {
+ oprintf (of, ", gt_ggc_e_");
+ output_mangled_typename (of, s);
+ }
+ else
+ oprintf (of, ", gt_types_enum_last");
+}
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -fselective-scheduling2" } */
+
+typedef long unsigned int size_t;
+struct fileloc
+{
+ const char *file;
+};
+typedef struct type *type_p;
+typedef const struct type *const_type_p;
+enum typekind
+{
+ TYPE_STRUCT,
+ TYPE_UNION,
+ TYPE_POINTER,
+ TYPE_LANG_STRUCT,
+ TYPE_PARAM_STRUCT
+};
+struct type
+{
+ enum typekind kind;
+ union
+ {
+ struct
+ {
+ struct fileloc line;
+ } s;
+ struct
+ {
+ struct fileloc line;
+ } param_struct;
+ } u;
+};
+struct outf
+{
+ size_t bufused;
+ char *buf;
+};
+typedef struct outf *outf_p;
+oprintf (outf_p o, const char *format, ...)
+{
+ char *s;
+ size_t slength;
+ memcpy (o->buf + o->bufused, s, slength);
+}
+output_mangled_typename (outf_p of, const_type_p t)
+{
+ switch (t->kind)
+ {
+ case TYPE_POINTER: (fancy_abort ("/gcc/gengtype.c", 1988, __FUNCTION__));
+ }
+}
+output_type_enum (outf_p of, type_p s)
+{
+ if (s->kind == TYPE_PARAM_STRUCT && s->u.param_struct.line.file != ((void *)0))
+ {
+ oprintf (of, ", gt_e_");
+ }
+ else if (((s)->kind == TYPE_UNION || (s)->kind == TYPE_STRUCT || (s)->kind == TYPE_LANG_STRUCT) && s->u.s.line.file != ((void *)0))
+ {
+ oprintf (of, ", gt_ggc_e_");
+ output_mangled_typename (of, s);
+ }
+ else
+ oprintf (of, ", gt_types_enum_last");
+}