summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1994-02-01 23:27:04 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1994-02-01 23:27:04 +0000
commitb6006adf6024c9b1e2f1429b4be3349e5345d96d (patch)
treeebc319a8d7896d8d57f672b025732d2282963a1e
parent4ac7d2be3f2dac5c468da0875b40dbc465945293 (diff)
downloadgcc-b6006adf6024c9b1e2f1429b4be3349e5345d96d.tar.gz
(make_extraction): Don't make an extraction that has the potential of
crossing a boundary. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@6462 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/combine.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index d682939eb28..25f02970238 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -5120,6 +5120,16 @@ make_extraction (mode, inner, pos, pos_rtx, len,
&& ! in_compare && ! spans_byte && unsignedp)
return 0;
+ /* Unless we are allowed to span bytes, reject this if we would be
+ spanning bytes or if the position is not a constant and the length
+ is not 1. In all other cases, we would only be going outside
+ out object in cases when an original shift would have been
+ undefined. */
+ if (! spans_byte
+ && ((pos_rtx == 0 && pos + len > GET_MODE_BITSIZE (is_mode))
+ || (pos_rtx != 0 && len != 1)))
+ return 0;
+
/* Get the mode to use should INNER be a MEM, the mode for the position,
and the mode for the result. */
#ifdef HAVE_insv