aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2006-01-24 14:29:25 +0000
committerPaolo Bonzini <bonzini@gnu.org>2006-01-24 14:29:25 +0000
commit9ed2e4d05f4c87463c2b67831482abf1f496d266 (patch)
treeed823d071217156a9e008601bc9ad10e116f16dd /gcc
parentc7a38c5332151a37edab176f0f20a4a2f886b065 (diff)
2006-01-23 Paolo Bonzini <bonzini@gnu.org>
PR rtl-optimization/25890 PR rtl-optimization/25905 * combine.c (expand_compound_operation, expand_field_assignment): Fail if the bitfield's final position is out of bounds. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@110170 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/combine.c11
2 files changed, 13 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 74eba5267d8..d5046c4c801 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2006-01-23 Paolo Bonzini <bonzini@gnu.org>
+
+ PR rtl-optimization/25890
+ PR rtl-optimization/25905
+ * combine.c (expand_compound_operation, expand_field_assignment):
+ Fail if the bitfield's final position is out of bounds.
+
2006-01-24 Ian Lance Taylor <ian@airs.com>
PR middle-end/25930
diff --git a/gcc/combine.c b/gcc/combine.c
index 55f5723a3d7..0ec45808a8a 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -5640,8 +5640,9 @@ expand_compound_operation (rtx x)
len = INTVAL (XEXP (x, 1));
pos = INTVAL (XEXP (x, 2));
- /* This should stay within the object being extracted, fail. */
- gcc_assert (len + pos <= GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))));
+ /* This should stay within the object being extracted, fail otherwise. */
+ if (len + pos > GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))))
+ return x;
if (BITS_BIG_ENDIAN)
pos = GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))) - len - pos;
@@ -5800,9 +5801,9 @@ expand_field_assignment (rtx x)
pos = XEXP (SET_DEST (x), 2);
/* A constant position should stay within the width of INNER. */
- if (GET_CODE (pos) == CONST_INT)
- gcc_assert (INTVAL (pos) + len
- <= GET_MODE_BITSIZE (GET_MODE (inner)));
+ if (GET_CODE (pos) == CONST_INT
+ && INTVAL (pos) + len > GET_MODE_BITSIZE (GET_MODE (inner)))
+ break;
if (BITS_BIG_ENDIAN)
{