summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/cfgexpand.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0acde629bd2..de4bb3d0aa2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2013-09-12 DJ Delorie <dj@redhat.com>
+
+ * cfgexpand.c (expand_debug_expr): Avoid sign-extending SImode to
+ PSImode.
+
2013-09-12 Martin Jambor <mjambor@suse.cz>
PR ipa/58389
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 4f103617977..88e48c2a342 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -3154,7 +3154,12 @@ expand_debug_expr (tree exp)
&& GET_MODE (op0) != VOIDmode && GET_MODE (op1) != VOIDmode
&& GET_MODE (op0) != GET_MODE (op1))
{
- if (GET_MODE_BITSIZE (GET_MODE (op0)) < GET_MODE_BITSIZE (GET_MODE (op1)))
+ if (GET_MODE_BITSIZE (GET_MODE (op0)) < GET_MODE_BITSIZE (GET_MODE (op1))
+ /* If OP0 is a partial mode, then we must truncate, even if it has
+ the same bitsize as OP1 as GCC's representation of partial modes
+ is opaque. */
+ || (GET_MODE_CLASS (GET_MODE (op0)) == MODE_PARTIAL_INT
+ && GET_MODE_BITSIZE (GET_MODE (op0)) == GET_MODE_BITSIZE (GET_MODE (op1))))
op1 = simplify_gen_unary (TRUNCATE, GET_MODE (op0), op1,
GET_MODE (op1));
else
OpenPOWER on IntegriCloud