aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>1998-02-08 11:43:54 +0000
committerJeff Law <law@gcc.gnu.org>1998-02-08 04:43:54 -0700
commit7bf825d296e1551e8df8e214a810974315db7b02 (patch)
treef210847a0c0140adfdab016e0bbb986b731d4f02
parent40f39eb71477efa757b30435bf8774fb32066666 (diff)
downloadgcc-7bf825d296e1551e8df8e214a810974315db7b02.zip
gcc-7bf825d296e1551e8df8e214a810974315db7b02.tar.gz
gcc-7bf825d296e1551e8df8e214a810974315db7b02.tar.bz2
regmove.c: Fix various minor formatting problems.
* regmove.c: Fix various minor formatting problems. (optimize_reg_copy_1): Stop search at CALL_INSNs if flag_exceptions is true. Make end of basic block tests consistent through regmove.c. (optimize_reg_copy_2, optimize_reg_copy_3): Likewise. (fixup_match_2, fixup_match_1, regmove_optimize): Likewise. Co-Authored-By: Jeffrey A Law <law@cygnus.com> From-SVN: r17775
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/regmove.c112
2 files changed, 113 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fdb29ec..58e0b1b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+Sun Feb 8 12:04:24 1998 Jim Wilson (wilson@cygnus.com)
+ Jeff Law (law@cygnus.com)
+
+ * regmove.c: Fix various minor formatting problems.
+ (optimize_reg_copy_1): Stop search at CALL_INSNs if flag_exceptions
+ is true. Make end of basic block tests consistent through regmove.c.
+ (optimize_reg_copy_2, optimize_reg_copy_3): Likewise.
+ (fixup_match_2, fixup_match_1, regmove_optimize): Likewise.
+
Sun Feb 8 01:49:18 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gansidecl.h: Check for a conflicting macro definition before
diff --git a/gcc/regmove.c b/gcc/regmove.c
index 55c380a..4d1062d 100644
--- a/gcc/regmove.c
+++ b/gcc/regmove.c
@@ -206,6 +206,14 @@ optimize_reg_copy_1 (insn, dest, src)
|| NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
break;
+ /* ??? We can't scan past the end of a basic block without updating
+ the register lifetime info (REG_DEAD/basic_block_live_at_start).
+ A CALL_INSN might be the last insn of a basic block, if it is inside
+ an EH region. There is no easy way to tell, so we just always break
+ when we see a CALL_INSN if flag_exceptions is nonzero. */
+ if (flag_exceptions && GET_CODE (p) == CALL_INSN)
+ break;
+
if (GET_RTX_CLASS (GET_CODE (p)) != 'i')
continue;
@@ -380,6 +388,14 @@ optimize_reg_copy_2 (insn, dest, src)
|| NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
break;
+ /* ??? We can't scan past the end of a basic block without updating
+ the register lifetime info (REG_DEAD/basic_block_live_at_start).
+ A CALL_INSN might be the last insn of a basic block, if it is inside
+ an EH region. There is no easy way to tell, so we just always break
+ when we see a CALL_INSN if flag_exceptions is nonzero. */
+ if (flag_exceptions && GET_CODE (p) == CALL_INSN)
+ break;
+
if (GET_RTX_CLASS (GET_CODE (p)) != 'i')
continue;
@@ -451,10 +467,22 @@ optimize_reg_copy_3 (insn, dest, src)
return;
for (p = PREV_INSN (insn); ! reg_set_p (src_reg, p); p = PREV_INSN (p))
{
+ if (GET_CODE (p) == CODE_LABEL || GET_CODE (p) == JUMP_INSN
+ || (GET_CODE (p) == NOTE
+ && (NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_BEG
+ || NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
+ return;
+
+ /* ??? We can't scan past the end of a basic block without updating
+ the register lifetime info (REG_DEAD/basic_block_live_at_start).
+ A CALL_INSN might be the last insn of a basic block, if it is inside
+ an EH region. There is no easy way to tell, so we just always break
+ when we see a CALL_INSN if flag_exceptions is nonzero. */
+ if (flag_exceptions && GET_CODE (p) == CALL_INSN)
+ return;
+
if (GET_RTX_CLASS (GET_CODE (p)) != 'i')
continue;
- if (GET_CODE (p) == JUMP_INSN)
- return;
}
if (! (set = single_set (p))
|| GET_CODE (SET_SRC (set)) != MEM
@@ -541,7 +569,8 @@ reg_is_remote_constant_p (reg, insn, first)
/* cse disrupts preincrement / postdecrement squences when it finds a
hard register as ultimate source, like the frame pointer. */
-int fixup_match_2 (insn, dst, src, offset, regmove_dump_file)
+int
+fixup_match_2 (insn, dst, src, offset, regmove_dump_file)
rtx insn, dst, src, offset;
FILE *regmove_dump_file;
{
@@ -567,13 +596,21 @@ int fixup_match_2 (insn, dst, src, offset, regmove_dump_file)
|| NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
break;
+ /* ??? We can't scan past the end of a basic block without updating
+ the register lifetime info (REG_DEAD/basic_block_live_at_start).
+ A CALL_INSN might be the last insn of a basic block, if it is inside
+ an EH region. There is no easy way to tell, so we just always break
+ when we see a CALL_INSN if flag_exceptions is nonzero. */
+ if (flag_exceptions && GET_CODE (p) == CALL_INSN)
+ break;
+
if (GET_RTX_CLASS (GET_CODE (p)) != 'i')
continue;
- if (find_regno_note (p, REG_DEAD, REGNO (dst)))
- dst_death = p;
- if (! dst_death)
- length++;
+ if (find_regno_note (p, REG_DEAD, REGNO (dst)))
+ dst_death = p;
+ if (! dst_death)
+ length++;
pset = single_set (p);
if (pset && SET_DEST (pset) == dst
@@ -978,6 +1015,16 @@ regmove_optimize (f, nregs, regmove_dump_file)
|| NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
break;
+ /* ??? We can't scan past the end of a basic block without
+ updating the register lifetime info
+ (REG_DEAD/basic_block_live_at_start).
+ A CALL_INSN might be the last insn of a basic block, if
+ it is inside an EH region. There is no easy way to tell,
+ so we just always break when we see a CALL_INSN if
+ flag_exceptions is nonzero. */
+ if (flag_exceptions && GET_CODE (p) == CALL_INSN)
+ break;
+
if (GET_RTX_CLASS (GET_CODE (p)) != 'i')
continue;
@@ -1245,6 +1292,14 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
|| NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
break;
+ /* ??? We can't scan past the end of a basic block without updating
+ the register lifetime info (REG_DEAD/basic_block_live_at_start).
+ A CALL_INSN might be the last insn of a basic block, if it is
+ inside an EH region. There is no easy way to tell, so we just
+ always break when we see a CALL_INSN if flag_exceptions is nonzero. */
+ if (flag_exceptions && GET_CODE (p) == CALL_INSN)
+ break;
+
if (GET_RTX_CLASS (GET_CODE (p)) != 'i')
continue;
@@ -1281,6 +1336,20 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
q = 0;
break;
}
+
+ /* ??? We can't scan past the end of a basic block without
+ updating the register lifetime info
+ (REG_DEAD/basic_block_live_at_start).
+ A CALL_INSN might be the last insn of a basic block, if
+ it is inside an EH region. There is no easy way to tell,
+ so we just always break when we see a CALL_INSN if
+ flag_exceptions is nonzero. */
+ if (flag_exceptions && GET_CODE (p) == CALL_INSN)
+ {
+ q = 0;
+ break;
+ }
+
if (GET_RTX_CLASS (GET_CODE (q)) != 'i')
continue;
if (reg_overlap_mentioned_p (src, PATTERN (q))
@@ -1434,11 +1503,28 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
{
for (q = PREV_INSN (insn); q; q = PREV_INSN(q))
{
- if (GET_CODE (q) == JUMP_INSN)
+ if (GET_CODE (q) == CODE_LABEL || GET_CODE (q) == JUMP_INSN
+ || (GET_CODE (q) == NOTE
+ && (NOTE_LINE_NUMBER (q) == NOTE_INSN_LOOP_BEG
+ || NOTE_LINE_NUMBER (q) == NOTE_INSN_LOOP_END)))
{
q = 0;
break;
}
+
+ /* ??? We can't scan past the end of a basic block without
+ updating the register lifetime info
+ (REG_DEAD/basic_block_live_at_start).
+ A CALL_INSN might be the last insn of a basic block, if
+ it is inside an EH region. There is no easy way to tell,
+ so we just always break when we see a CALL_INSN if
+ flag_exceptions is nonzero. */
+ if (flag_exceptions && GET_CODE (p) == CALL_INSN)
+ {
+ q = 0;
+ break;
+ }
+
if (GET_RTX_CLASS (GET_CODE (q)) != 'i')
continue;
s_length2++;
@@ -1510,6 +1596,16 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
&& (NOTE_LINE_NUMBER (q) == NOTE_INSN_LOOP_BEG
|| NOTE_LINE_NUMBER (q) == NOTE_INSN_LOOP_END)))
break;
+
+ /* ??? We can't scan past the end of a basic block without updating
+ the register lifetime info (REG_DEAD/basic_block_live_at_start).
+ A CALL_INSN might be the last insn of a basic block, if it
+ is inside an EH region. There is no easy way to tell so we
+ just always break when we see a CALL_INSN if flag_exceptions
+ is nonzero. */
+ if (flag_exceptions && GET_CODE (p) == CALL_INSN)
+ break;
+
if (GET_RTX_CLASS (GET_CODE (q)) != 'i')
continue;
if (src != inc_dest && (reg_overlap_mentioned_p (src, PATTERN (q))