Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998
1999, 2000, 2001 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
#include "config.h"
/* stdio.h must precede rtl.h for FFS. */
#include "system.h"
-#include <setjmp.h>
#include "rtl.h"
#include "tm_p.h"
case PC:
/* If the next insn is a CODE_LABEL followed by a jump table,
PC's value is a LABEL_REF pointing to that label. That
- lets us fold switch statements on the Vax. */
+ lets us fold switch statements on the VAX. */
if (insn && GET_CODE (insn) == JUMP_INSN)
{
rtx next = next_nonnote_insn (insn);
if (GET_CODE (insn) == CALL_INSN)
{
- if (! CONST_CALL_P (insn))
+ if (! CONST_OR_PURE_CALL_P (insn))
invalidate_memory ();
invalidate_for_call ();
}
This section previously turned the REG_EQUIV into a REG_EQUAL
note. We cannot do that because REG_EQUIV may provide an
- uninitialised stack slot when REG_PARM_STACK_SPACE is used. */
+ uninitialised stack slot when REG_PARM_STACK_SPACE is used. */
if (prev != 0 && GET_CODE (prev) == INSN
&& GET_CODE (PATTERN (prev)) == SET
return x;
case MEM:
- XEXP (x, 0) = cse_process_notes (XEXP (x, 0), x);
+ validate_change (x, &XEXP (x, 0),
+ cse_process_notes (XEXP (x, 0), x), 0);
return x;
case EXPR_LIST:
if (GET_CODE (insn) == CALL_INSN)
{
- if (! CONST_CALL_P (insn))
+ if (! CONST_OR_PURE_CALL_P (insn))
invalidate_memory ();
invalidate_for_call ();
}
&& NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)
break;
- /* Don't cse over a call to setjmp; on some machines (eg vax)
+ /* Don't cse over a call to setjmp; on some machines (eg VAX)
the regs restored by the longjmp come from
a later time than the setjmp. */
- if (GET_CODE (p) == NOTE
- && NOTE_LINE_NUMBER (p) == NOTE_INSN_SETJMP)
+ if (PREV_INSN (p) && GET_CODE (PREV_INSN (p)) == CALL_INSN
+ && find_reg_note (PREV_INSN (p), REG_SETJMP, NULL))
break;
/* A PARALLEL can have lots of SETs in it,
for (q = PREV_INSN (JUMP_LABEL (p)); q; q = PREV_INSN (q))
if ((GET_CODE (q) != NOTE
|| NOTE_LINE_NUMBER (q) == NOTE_INSN_LOOP_END
- || NOTE_LINE_NUMBER (q) == NOTE_INSN_SETJMP)
+ || (PREV_INSN (q) && GET_CODE (PREV_INSN (q)) == CALL_INSN
+ && find_reg_note (PREV_INSN (q), REG_SETJMP, NULL)))
&& (GET_CODE (q) != CODE_LABEL || LABEL_NUSES (q) != 0))
break;
we can cse into the loop. Don't do this if we changed the jump
structure of a loop unless we aren't going to be following jumps. */
+ insn = prev_nonnote_insn(to);
if ((cse_jumps_altered == 0
|| (flag_cse_follow_jumps == 0 && flag_cse_skip_blocks == 0))
&& around_loop && to != 0
&& GET_CODE (to) == NOTE && NOTE_LINE_NUMBER (to) == NOTE_INSN_LOOP_END
- && GET_CODE (PREV_INSN (to)) == JUMP_INSN
- && JUMP_LABEL (PREV_INSN (to)) != 0
- && LABEL_NUSES (JUMP_LABEL (PREV_INSN (to))) == 1)
- cse_around_loop (JUMP_LABEL (PREV_INSN (to)));
+ && GET_CODE (insn) == JUMP_INSN
+ && JUMP_LABEL (insn) != 0
+ && LABEL_NUSES (JUMP_LABEL (insn)) == 1)
+ cse_around_loop (JUMP_LABEL (insn));
free (qty_table + max_reg);
/* If this insn uses a LABEL_REF and there isn't a REG_LABEL note for it,
we must rerun jump since it needs to place the note. If this is a
LABEL_REF for a CODE_LABEL that isn't in the insn chain, don't do this
- since no REG_LABEL will be added. */
+ since no REG_LABEL will be added. */
return (GET_CODE (*rtl) == LABEL_REF
&& INSN_UID (XEXP (*rtl, 0)) != 0
&& ! find_reg_note (insn, REG_LABEL, XEXP (*rtl, 0)));
static bool
set_live_p (set, insn, counts)
rtx set;
- rtx insn ATTRIBUTE_UNUSED;
+ rtx insn ATTRIBUTE_UNUSED; /* Only used with HAVE_cc0. */
int *counts;
{
#ifdef HAVE_cc0
if (find_reg_note (insn, REG_RETVAL, NULL_RTX))
{
in_libcall = 1;
- /* If the insn storing return value is dead, whole libcall is dead.
- Otherwise attempt to eliminate libcall by doing an direct
- operation. */
- if (!insn_live_p (insn, counts))
- {
- live_insn = 0;
- dead_libcall = 1;
- }
- else
- {
- live_insn = 1;
- dead_libcall = dead_libcall_p (insn);
- }
+ live_insn = 1;
+ dead_libcall = dead_libcall_p (insn);
}
else if (in_libcall)
live_insn = ! dead_libcall;
if (find_reg_note (insn, REG_RETVAL, NULL_RTX))
{
in_libcall = 1;
- /* If the insn storing return value is dead, whole libcall is dead.
- Otherwise attempt to eliminate libcall by doing an direct
- operation. */
- if (!insn_live_p (insn, counts))
- {
- live_insn = 0;
- dead_libcall = 1;
- }
- else
- {
- live_insn = 1;
- dead_libcall = dead_libcall_p (insn);
- }
+ live_insn = 1;
+ dead_libcall = dead_libcall_p (insn);
}
else if (in_libcall)
live_insn = ! dead_libcall;