diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/sched-deps.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/20020926-1.c | 21 |
3 files changed, 36 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6c9702a3631..f836df4cf54 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2002-09-26 Richard Henderson <rth@redhat.com> + PR c/7160 + * sched-deps.c (sched_analyze_insn): Make clobber insns depend + on call insns. + +2002-09-26 Richard Henderson <rth@redhat.com> + * emit-rtl.c (const_double_htab_eq): Remove unused variable. 2002-09-26 Chris Lattner <sabre@nondot.org> diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c index 32260a89f50..cf762cccb58 100644 --- a/gcc/sched-deps.c +++ b/gcc/sched-deps.c @@ -922,7 +922,15 @@ sched_analyze_insn (deps, x, insn, loop_notes) code = GET_CODE (x); } if (code == SET || code == CLOBBER) - sched_analyze_1 (deps, x, insn); + { + sched_analyze_1 (deps, x, insn); + + /* Bare clobber insns are used for letting life analysis, reg-stack + and others know that a value is dead. Depend on the last call + instruction so that reg-stack won't get confused. */ + if (code == CLOBBER) + add_dependence_list (insn, deps->last_function_call, REG_DEP_OUTPUT); + } else if (code == PARALLEL) { int i; diff --git a/gcc/testsuite/gcc.c-torture/compile/20020926-1.c b/gcc/testsuite/gcc.c-torture/compile/20020926-1.c new file mode 100644 index 00000000000..260e844549a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20020926-1.c @@ -0,0 +1,21 @@ +/* PR c/7160 */ +/* Verify that the register-to-stack converter properly handles + branches without return value containing function calls. */ + +extern int gi; + +extern int foo1(int, int); +extern void foo2(int, int); +extern float foo3(int); + +float bar(int i1, int i2) +{ + int i3; + + if (i2) { + i3 = foo1(i1, gi); + foo2(i1, i3); + } + else + return foo3(i2); +} |