aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-02-01 16:43:20 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2007-02-01 16:43:20 +0000
commit0e6c5b58543978b3dc16cdfeb653df6997d4e800 (patch)
tree8ba597196a731bc04276e1b1d25a8f8fd4ff95ea /gcc
parentc0d919fa35e2af4aedb4c0e50c73778795d3f0b4 (diff)
downloadgcc-0e6c5b58543978b3dc16cdfeb653df6997d4e800.zip
gcc-0e6c5b58543978b3dc16cdfeb653df6997d4e800.tar.gz
gcc-0e6c5b58543978b3dc16cdfeb653df6997d4e800.tar.bz2
lower-subreg.c (simplify_gen_subreg_concatn): If we ask for the high part of a paradoxical subreg, return a constant zero.
* lower-subreg.c (simplify_gen_subreg_concatn): If we ask for the high part of a paradoxical subreg, return a constant zero. From-SVN: r121466
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/lower-subreg.c19
2 files changed, 23 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0a3ee33..a935ee4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2007-02-01 Ian Lance Taylor <iant@google.com>
+
+ * lower-subreg.c (simplify_gen_subreg_concatn): If we ask for the
+ high part of a paradoxical subreg, return a constant zero.
+
2007-02-01 Zdenek Dvorak <dvorakz@suse.cz>
* toplev.c (lang_dependent_init): Call init_set_costs.
diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c
index 7227624..ce9cfc5 100644
--- a/gcc/lower-subreg.c
+++ b/gcc/lower-subreg.c
@@ -372,6 +372,8 @@ static rtx
simplify_gen_subreg_concatn (enum machine_mode outermode, rtx op,
enum machine_mode innermode, unsigned int byte)
{
+ rtx ret;
+
/* We have to handle generating a SUBREG of a SUBREG of a CONCATN.
If OP is a SUBREG of a CONCATN, then it must be a simple mode
change with the same size and offset 0, or it must extract a
@@ -405,9 +407,24 @@ simplify_gen_subreg_concatn (enum machine_mode outermode, rtx op,
gcc_assert (op != NULL_RTX);
gcc_assert (innermode == GET_MODE (op));
}
+
if (GET_CODE (op) == CONCATN)
return simplify_subreg_concatn (outermode, op, byte);
- return simplify_gen_subreg (outermode, op, innermode, byte);
+
+ ret = simplify_gen_subreg (outermode, op, innermode, byte);
+
+ /* If we see an insn like (set (reg:DI) (subreg:DI (reg:SI) 0)) then
+ resolve_simple_move will ask for the high part of the paradoxical
+ subreg, which does not have a value. Just return a zero. */
+ if (ret == NULL_RTX
+ && GET_CODE (op) == SUBREG
+ && SUBREG_BYTE (op) == 0
+ && (GET_MODE_SIZE (innermode)
+ > GET_MODE_SIZE (GET_MODE (SUBREG_REG (op)))))
+ return CONST0_RTX (outermode);
+
+ gcc_assert (ret != NULL_RTX);
+ return ret;
}
/* Return whether we should resolve X into the registers into which it