summaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1997-03-18 22:55:01 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1997-03-18 22:55:01 +0000
commit4d7cc64a95d817d3822c2bbedf8255abb3e7a84f (patch)
treec638d7f111b1248210d76f7b8586c9ae1789894f /gcc/final.c
parentdd0fefda9210f50bfa252aefdcfab29341733a6b (diff)
downloadgcc-4d7cc64a95d817d3822c2bbedf8255abb3e7a84f.tar.gz
(shorten_branches): Split all insns before computing insn
lengths. (final_scan_insn, case default): If HAVE_ATTR_length defined, call abort for any insn that has a '#' output template. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13744 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/final.c')
-rw-r--r--gcc/final.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/final.c b/gcc/final.c
index 51296117972..64b5c500b5d 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -655,6 +655,13 @@ shorten_branches (first)
rtx body;
int uid;
+ /* In order to make sure that all instructions have valid length info,
+ we must split them before we compute the address/length info. */
+
+ for (insn = NEXT_INSN (first); insn; insn = NEXT_INSN (insn))
+ if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
+ insn = try_split (PATTERN (insn), insn, 1);
+
/* Compute maximum UID and allocate arrays. */
for (insn = first; insn; insn = NEXT_INSN (insn))
if (INSN_UID (insn) > max_uid)
@@ -2090,6 +2097,13 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
if (new == insn && PATTERN (new) == body)
abort ();
+#ifdef HAVE_ATTR_length
+ /* This instruction should have been split in shorten_branches,
+ to ensure that we would have valid length info for the
+ splitees. */
+ abort ();
+#endif
+
new_block = 0;
return new;
}