re PR rtl-optimization/69102 (ICE: in move_op_ascend, at sel-sched.c:6138 with -fselective-scheduling2)

gcc/
        PR rtl-optimization/69102
        * sched-deps.c (sched_analyze_insn): Do not set last_args_size field
        when we have a readonly dependency context.

testsuite/

        PR rtl-optimization/69102
        * gcc.c-torture/compile/pr69102.c: New test.

From-SVN: r234359
This commit is contained in:
Andrey Belevantsev 2016-03-21 10:52:05 +03:00 committed by Andrey Belevantsev
parent d816052f17
commit 8e7816b466
4 changed files with 34 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2016-03-21 Andrey Belevantsev <abel@ispras.ru>
PR rtl-optimization/69102
* sched-deps.c (sched_analyze_insn): Do not set last_args_size field
when we have a readonly dependency context.
2016-03-18 Jeff Law <law@redhat.com>
PR rtl-optimization/70263

View File

@ -3495,7 +3495,8 @@ sched_analyze_insn (struct deps_desc *deps, rtx x, rtx_insn *insn)
{
if (deps->last_args_size)
add_dependence (insn, deps->last_args_size, REG_DEP_OUTPUT);
deps->last_args_size = insn;
if (!deps->readonly)
deps->last_args_size = insn;
}
}

View File

@ -1,3 +1,8 @@
2016-03-21 Andrey Belevantsev <abel@ispras.ru>
PR rtl-optimization/69102
* gcc.c-torture/compile/pr69102.c: New test.
2016-03-18 Jeff Law <law@redhat.com>
PR rtl-optimization/70263

View File

@ -0,0 +1,21 @@
/* { dg-options "-Og -fPIC -fschedule-insns2 -fselective-scheduling2 -fno-tree-fre --param=max-sched-extend-regions-iters=10" } */
void bar (unsigned int);
void
foo (void)
{
char buf[1] = { 3 };
const char *p = buf;
const char **q = &p;
unsigned int ch;
switch (**q)
{
case 1: ch = 5; break;
case 2: ch = 4; break;
case 3: ch = 3; break;
case 4: ch = 2; break;
case 5: ch = 1; break;
default: ch = 0; break;
}
bar (ch);
}