Hi! On the following testcase we ICE on x86_64-linux because sel-sched decides to duplicate a push insn, the original one remains in one bb, the copy in a different bb which have both a common successor. Unfortunately the REG_ARGS_SIZE note isn't copied over, so during the dwarf2 pass we don't notice the needed adjustment of the argument size in one of the bb's and on the merge label we have different CFA expressions.
Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2011-12-15 Jakub Jelinek <ja...@redhat.com> PR debug/51557 * sel-sched-ir.c (create_copy_of_insn_rtx): Copy REG_ARGS_SIZE notes. * gcc.dg/pr51557.c: New test. --- gcc/sel-sched-ir.c.jj 2011-10-20 14:13:43.000000000 +0200 +++ gcc/sel-sched-ir.c 2011-12-15 00:35:05.968011345 +0100 @@ -5723,7 +5723,7 @@ create_vinsn_from_insn_rtx (rtx insn_rtx rtx create_copy_of_insn_rtx (rtx insn_rtx) { - rtx res; + rtx res, note; if (DEBUG_INSN_P (insn_rtx)) return create_insn_rtx_from_pattern (copy_rtx (PATTERN (insn_rtx)), @@ -5733,6 +5733,10 @@ create_copy_of_insn_rtx (rtx insn_rtx) res = create_insn_rtx_from_pattern (copy_rtx (PATTERN (insn_rtx)), NULL_RTX); + /* Duplicate REG_ARGS_SIZE note if any. */ + note = find_reg_note (insn_rtx, REG_ARGS_SIZE, NULL_RTX); + if (note) + add_reg_note (res, REG_ARGS_SIZE, XEXP (note, 0)); return res; } --- gcc/testsuite/gcc.dg/pr51557.c.jj 2011-12-15 00:38:36.417105928 +0100 +++ gcc/testsuite/gcc.dg/pr51557.c 2011-12-15 00:38:27.000000000 +0100 @@ -0,0 +1,17 @@ +/* PR debug/51557 */ +/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */ +/* { dg-options "-Os -fno-asynchronous-unwind-tables -g -fsel-sched-pipelining -fselective-scheduling2" } */ + +extern int baz (void); +extern void bar (int, int, int, int, int, int, int); + +void +synth (int *values, int n_values, int ci, int s1, int v, int s2) +{ + while (--s1) + { + int r1 = values[s1]; + int co = ci ? r1 : baz () < r1; + bar (0, n_values, s1, s2, v, co, 0); + } +} Jakub