This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH for gen_sequence
- To: gcc-patches at sourceware dot cygnus dot com
- Subject: PATCH for gen_sequence
- From: Andrew Haley <aph at pasanda dot cygnus dot co dot uk>
- Date: 22 Nov 1999 15:00:12 -0000
At present, if gen_sequence returns a singl insn sequence any
REG_NOTES and insn codes get lost; in order to prevent this it is
necessary to insert dummy INSN_DELETED notes. This is evil.
To remedy this, the following patch only returns the pattern of an
insn if that isns's code really is INSN and there are no REG_NOTES.
Approved by rth, checked in.
Andrew.
Fri Nov 12 14:08:40 1999 Andrew Haley <aph@cygnus.com>
* emit-rtl.c (gen_sequence): Only return the pattern of an insn if
its code is INSN and it has no notes.
Index: emit-rtl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/emit-rtl.c,v
retrieving revision 1.97
diff -p -r1.97 emit-rtl.c
*** emit-rtl.c 1999/11/04 07:23:58 1.97
--- emit-rtl.c 1999/11/22 14:51:03
*************** gen_sequence ()
*** 3393,3408 ****
for (tem = first_insn; tem; tem = NEXT_INSN (tem))
len++;
! /* If only one insn, return its pattern rather than a SEQUENCE.
(Now that we cache SEQUENCE expressions, it isn't worth special-casing
! the case of an empty list.) */
if (len == 1
&& ! RTX_FRAME_RELATED_P (first_insn)
! && (GET_CODE (first_insn) == INSN
! || GET_CODE (first_insn) == JUMP_INSN
! /* Don't discard the call usage field. */
! || (GET_CODE (first_insn) == CALL_INSN
! && CALL_INSN_FUNCTION_USAGE (first_insn) == NULL_RTX)))
{
if (!ggc_p)
{
--- 3393,3408 ----
for (tem = first_insn; tem; tem = NEXT_INSN (tem))
len++;
! /* If only one insn, return it rather than a SEQUENCE.
(Now that we cache SEQUENCE expressions, it isn't worth special-casing
! the case of an empty list.)
! We only return the pattern of an insn if its code is INSN and it
! has no notes. This ensures that no information gets lost. */
if (len == 1
&& ! RTX_FRAME_RELATED_P (first_insn)
! && GET_CODE (first_insn) == INSN
! /* Don't throw away any reg notes. */
! && REG_NOTES (first_insn) == 0)
{
if (!ggc_p)
{