Commit 539c54ba by Kaz Kojima

re PR rtl-optimization/34808 (ICE in prescan_insns_for_dce)

	PR rtl-optimization/34808
	* emit-rtl.c (try_split): Handle REG_RETVAL notes.
	* gcc.c-torture/compile/pr34808.c: New test.

From-SVN: r131680
parent f5d67ede
2008-01-20 Kaz Kojima <kkojima@gcc.gnu.org>
PR rtl-optimization/34808
* emit-rtl.c (try_split): Handle REG_RETVAL notes.
2008-01-20 Richard Sandiford <rsandifo@nildram.co.uk> 2008-01-20 Richard Sandiford <rsandifo@nildram.co.uk>
* global.c (find_reg): Only compute EH_RETURN_DATA_REGNO once per * global.c (find_reg): Only compute EH_RETURN_DATA_REGNO once per
......
...@@ -3136,7 +3136,7 @@ try_split (rtx pat, rtx trial, int last) ...@@ -3136,7 +3136,7 @@ try_split (rtx pat, rtx trial, int last)
rtx before = PREV_INSN (trial); rtx before = PREV_INSN (trial);
rtx after = NEXT_INSN (trial); rtx after = NEXT_INSN (trial);
int has_barrier = 0; int has_barrier = 0;
rtx tem, note_retval; rtx tem, note_retval, note_libcall;
rtx note, seq; rtx note, seq;
int probability; int probability;
rtx insn_last, insn; rtx insn_last, insn;
...@@ -3284,6 +3284,18 @@ try_split (rtx pat, rtx trial, int last) ...@@ -3284,6 +3284,18 @@ try_split (rtx pat, rtx trial, int last)
XEXP (note_retval, 0) = insn_last; XEXP (note_retval, 0) = insn_last;
break; break;
case REG_RETVAL:
/* Relink the insns with REG_LIBCALL note and with REG_RETVAL note
after split. */
REG_NOTES (insn_last)
= gen_rtx_INSN_LIST (REG_RETVAL,
XEXP (note, 0),
REG_NOTES (insn_last));
note_libcall = find_reg_note (XEXP (note, 0), REG_LIBCALL, NULL);
XEXP (note_libcall, 0) = insn_last;
break;
default: default:
break; break;
} }
......
2008-01-20 Kaz Kojima <kkojima@gcc.gnu.org>
PR rtl-optimization/34808
* gcc.c-torture/compile/pr34808.c: New test.
2008-01-20 Paul Thomas <pault@gcc.gnu.org> 2008-01-20 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34784 PR fortran/34784
/* PR 34808 */
/* { dg-do compile }
/* { dg-options "-fno-tree-dominator-opts" } */
extern int flags;
struct r { int code; int val;};
int
foo (struct r *home)
{
int n = 0;
int regno = -1;
if (home->code == 0)
regno = home->val;
if (home->code == 1)
bar ();
else if (regno >= 0)
n = (regno == 16
? 16
: (regno - (unsigned long long) (flags != 0 ? 63 : 15)
? regno - 128
: -1));
baz ();
return n;
}
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