This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Non-call exceptions versus cse
Richard Henderson writes:
> On Wed, Nov 20, 2002 at 04:17:18PM +0000, Andrew Haley wrote:
> > Right, here's the unexpurgated dump just before CSE.
>
> Which looks right. In particular, we've got
>
> > (insn 33 30 233 0 0x402284a4 (set (reg/v:SI 65)
> > (mem/s:SI (plus:SI (reg/v/f:SI 63)
> > (const_int 4 [0x4])) [15 <variable>.length+0 S4 A32])) -1 (nil)
> > (expr_list:REG_EH_REGION (const_int 1 [0x1])
> > (nil)))
> > ;; End of basic block 0, registers live:
>
> ... an edge in the cfg for the trap.
>
> For grins, see if this is fixed by using -fno-cse-follow-jumps
> or -fno-cse-skip-blocks. I could see that maybe cse isn't
> respecting the cfg that we've created.
It isn't.
Might I suggest this?
Andrew.
2002-11-25 Andrew Haley <aph@redhat.com>
* cse.c (cse_insn): Don't cse past a basic block boundary.
Index: cse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cse.c,v
retrieving revision 1.242
diff -c -2 -p -r1.242 cse.c
*** cse.c 12 Oct 2002 00:00:39 -0000 1.242
--- cse.c 25 Nov 2002 12:40:22 -0000
*************** cse_insn (insn, libcall_insn)
*** 6317,6322 ****
&& ! find_reg_note (insn, REG_RETVAL, NULL_RTX))
{
! rtx prev = prev_nonnote_insn (insn);
!
/* Do not swap the registers around if the previous instruction
attaches a REG_EQUIV note to REG1.
--- 6317,6330 ----
&& ! find_reg_note (insn, REG_RETVAL, NULL_RTX))
{
! rtx prev = insn;
! /* Scan for the previous nonnote insn, but stop at a basic
! block boundary. */
! do
! {
! prev = PREV_INSN (prev);
! }
! while (prev && GET_CODE (prev) == NOTE
! && NOTE_LINE_NUMBER (prev) != NOTE_INSN_BASIC_BLOCK);
!
/* Do not swap the registers around if the previous instruction
attaches a REG_EQUIV note to REG1.