aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/dwarf2out.c7
-rw-r--r--gcc/lra-eliminations.c4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/guality/pr69244.c30
5 files changed, 53 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index eb26fcc..35e39b5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2016-01-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/69244
+ * lra-eliminations.c (move_plus_up): Don't change anything if either
+ the outer or inner subreg mode is not MODE_INT.
+ * dwarf2out.c (mem_loc_descriptor): For SUBREG, if outer mode is
+ integral <= DWARF2_ADDR_SIZE, convert to untyped afterwards.
+
2016-01-14 Alan Lawrence <alan.lawrence@arm.com>
* doc/md.texi (reduc_smin_@var{m}, reduc_smax_@var{m},
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 2c0bd63..61a7bf3 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -13239,6 +13239,13 @@ mem_loc_descriptor (rtx rtl, machine_mode mode,
cvt->dw_loc_oprnd1.v.val_die_ref.die = type_die;
cvt->dw_loc_oprnd1.v.val_die_ref.external = 0;
add_loc_descr (&mem_loc_result, cvt);
+ if (GET_MODE_CLASS (mode) == MODE_INT
+ && GET_MODE_SIZE (mode) <= DWARF2_ADDR_SIZE)
+ {
+ /* Convert it to untyped afterwards. */
+ cvt = new_loc_descr (DW_OP_GNU_convert, 0, 0);
+ add_loc_descr (&mem_loc_result, cvt);
+ }
}
break;
diff --git a/gcc/lra-eliminations.c b/gcc/lra-eliminations.c
index 99d5c6f..1494263 100644
--- a/gcc/lra-eliminations.c
+++ b/gcc/lra-eliminations.c
@@ -295,7 +295,9 @@ move_plus_up (rtx x)
subreg_reg_mode = GET_MODE (subreg_reg);
if (GET_CODE (x) == SUBREG && GET_CODE (subreg_reg) == PLUS
&& GET_MODE_SIZE (x_mode) <= GET_MODE_SIZE (subreg_reg_mode)
- && CONSTANT_P (XEXP (subreg_reg, 1)))
+ && CONSTANT_P (XEXP (subreg_reg, 1))
+ && GET_MODE_CLASS (x_mode) == MODE_INT
+ && GET_MODE_CLASS (subreg_reg_mode) == MODE_INT)
{
rtx cst = simplify_subreg (x_mode, XEXP (subreg_reg, 1), subreg_reg_mode,
subreg_lowpart_offset (x_mode,
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 38b96a6..c666dfa 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-01-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/69244
+ * gcc.dg/guality/pr69244.c: New test.
+
2016-01-14 Uros Bizjak <ubizjak@gmail.com>
* lib/target-supports.exp (check_effective_target_issignaling):
diff --git a/gcc/testsuite/gcc.dg/guality/pr69244.c b/gcc/testsuite/gcc.dg/guality/pr69244.c
new file mode 100644
index 0000000..6fe14bd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/guality/pr69244.c
@@ -0,0 +1,30 @@
+/* PR debug/69244 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+#include "../nop.h"
+
+union U { float f; int i; };
+float a, b;
+
+__attribute__((noinline, noclone)) void
+foo (void)
+{
+ asm volatile ("" : : "g" (&a), "g" (&b) : "memory");
+}
+
+int
+main ()
+{
+ float e = a;
+ foo ();
+ float d = e;
+ union U p;
+ p.f = d += 2;
+ int c = p.i - 4;
+ asm (NOP : : : "memory");
+ b = c;
+ return 0;
+}
+
+/* { dg-final { gdb-test 25 "c" "p.i-4" } } */