summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-05 21:13:42 +0000
committerdj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-05 21:13:42 +0000
commit5e960ca9419a34a41ab80433986a7978b2bf963f (patch)
tree266940bd84b12c6fb47ca4f802ecf3412a8b8fe4
parente9a91a9e03c2a46cd9c39b6d5e7a474d34afbb27 (diff)
downloadppe42-gcc-5e960ca9419a34a41ab80433986a7978b2bf963f.tar.gz
ppe42-gcc-5e960ca9419a34a41ab80433986a7978b2bf963f.zip
* function.c (reorder_blocks): Make sure the flags are all reset
before using them to mark blocks, else a second invocation will corrupt the block chain. (reorder_blocks_0): New, resets the flags. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38724 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/function.c31
2 files changed, 38 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 650faa7838f..649c3914d9c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2001-01-05 DJ Delorie <dj@redhat.com>
+
+ * function.c (reorder_blocks): Make sure the flags are all reset
+ before using them to mark blocks, else a second invocation will
+ corrupt the block chain.
+ (reorder_blocks_0): New, resets the flags.
+
Fri Jan 5 20:34:06 2001 J"orn Rennecke <amylaar@redhat.com>
* cse.c (find_comparison_args): Stop if the argument is known to
diff --git a/gcc/function.c b/gcc/function.c
index 90ca36a5b6a..385dbc3d931 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -275,6 +275,7 @@ static void pad_below PARAMS ((struct args_size *, enum machine_mode,
static rtx round_trampoline_addr PARAMS ((rtx));
static rtx adjust_trampoline_addr PARAMS ((rtx));
static tree *identify_blocks_1 PARAMS ((rtx, tree *, tree *, tree *));
+static void reorder_blocks_0 PARAMS ((rtx));
static void reorder_blocks_1 PARAMS ((rtx, tree, varray_type *));
static tree blocks_nreverse PARAMS ((tree));
static int all_blocks PARAMS ((tree, tree *));
@@ -5789,6 +5790,7 @@ reorder_blocks ()
BLOCK_SUBBLOCKS (block) = NULL_TREE;
BLOCK_CHAIN (block) = NULL_TREE;
+ reorder_blocks_0 (get_insns ());
reorder_blocks_1 (get_insns (), block, &block_stack);
BLOCK_SUBBLOCKS (block) = blocks_nreverse (BLOCK_SUBBLOCKS (block));
@@ -5800,6 +5802,35 @@ reorder_blocks ()
at INSNS. Recurse for CALL_PLACEHOLDER insns. */
static void
+reorder_blocks_0 (insns)
+ rtx insns;
+{
+ rtx insn;
+
+ for (insn = insns; insn; insn = NEXT_INSN (insn))
+ {
+ if (GET_CODE (insn) == NOTE)
+ {
+ if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG)
+ {
+ tree block = NOTE_BLOCK (insn);
+ TREE_ASM_WRITTEN (block) = 0;
+ }
+ }
+ else if (GET_CODE (insn) == CALL_INSN
+ && GET_CODE (PATTERN (insn)) == CALL_PLACEHOLDER)
+ {
+ rtx cp = PATTERN (insn);
+ reorder_blocks_0 (XEXP (cp, 0));
+ if (XEXP (cp, 1))
+ reorder_blocks_0 (XEXP (cp, 1));
+ if (XEXP (cp, 2))
+ reorder_blocks_0 (XEXP (cp, 2));
+ }
+ }
+}
+
+static void
reorder_blocks_1 (insns, current_block, p_block_stack)
rtx insns;
tree current_block;
OpenPOWER on IntegriCloud