This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch RFA] Fix PR rtl-optimization/34808
- From: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 20 Jan 2008 14:56:31 +0900 (JST)
- Subject: [patch RFA] Fix PR rtl-optimization/34808
Hi,
The attached patch is to fix PR rtl-optimization/34808 which
is a 4.3 regression. In the failed case, an insn which has
a REG_RETVAL note is splitted with try_split but try_split
doesn't handle this REG_RETVAL note at all.
The patch is tested with bootstrap and the top level "make -k
check" on i686-pc-linux-gnu and powerpc-apple-darwin9.1.0
with no new failures. Ok for trunk?
Regards,
kaz
--
:ADDPATCH rtl-optimization:
2008-01-20 Kaz Kojima <kkojima@gcc.gnu.org>
PR rtl-optimization/34808
* emit-rtl.c (try_split): Handle REG_RETVAL notes.
diff -uprN ORIG/trunk/gcc/emit-rtl.c LOCAL/trunk/gcc/emit-rtl.c
--- ORIG/trunk/gcc/emit-rtl.c 2008-01-15 09:35:12.000000000 +0900
+++ LOCAL/trunk/gcc/emit-rtl.c 2008-01-20 14:52:05.000000000 +0900
@@ -1,6 +1,6 @@
/* Emit RTL for the GCC expander.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
@@ -3136,7 +3136,7 @@ try_split (rtx pat, rtx trial, int last)
rtx before = PREV_INSN (trial);
rtx after = NEXT_INSN (trial);
int has_barrier = 0;
- rtx tem, note_retval;
+ rtx tem, note_retval, note_libcall;
rtx note, seq;
int probability;
rtx insn_last, insn;
@@ -3284,6 +3284,18 @@ try_split (rtx pat, rtx trial, int last)
XEXP (note_retval, 0) = insn_last;
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:
break;
}