aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMichael Meissner <meissner@gcc.gnu.org>1995-05-11 13:37:44 +0000
committerMichael Meissner <meissner@gcc.gnu.org>1995-05-11 13:37:44 +0000
commit08664dffb263afea1de2501309830fbe10ca1fcc (patch)
tree82d4a545bbe9c712044059cf22ba6442c82e62da /gcc
parent201012cbf98c4d5fa8f8756cd78c26096289240a (diff)
downloadgcc-08664dffb263afea1de2501309830fbe10ca1fcc.zip
gcc-08664dffb263afea1de2501309830fbe10ca1fcc.tar.gz
gcc-08664dffb263afea1de2501309830fbe10ca1fcc.tar.bz2
Do not segfault if SUBREG uses something other than REG.
From-SVN: r9617
Diffstat (limited to 'gcc')
-rw-r--r--gcc/flow.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/flow.c b/gcc/flow.c
index 5ebaf25..1143e53 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -2382,6 +2382,13 @@ mark_used_regs (needed, live, x, final, insn)
!= GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))))
reg_changes_size[REGNO (SUBREG_REG (x))] = 1;
+ /* In case the SUBREG is not of a register, don't optimize */
+ if (GET_CODE (SUBREG_REG (x)) != REG)
+ {
+ mark_used_regs (needed, live, SUBREG_REG (x), final, insn);
+ return;
+ }
+
/* While we're here, optimize this case. */
x = SUBREG_REG (x);