]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR debug/69244
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Jan 2016 19:57:34 +0000 (19:57 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Jan 2016 19:57:34 +0000 (19:57 +0000)
* 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.

* gcc.dg/guality/pr69244.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232382 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/dwarf2out.c
gcc/lra-eliminations.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/guality/pr69244.c [new file with mode: 0644]

index eb26fccc2d9bdd7c1266e2870606046476014094..35e39b57501a08b796e4c677d327563445c8e1ec 100644 (file)
@@ -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},
index 2c0bd6314880cc11f4e94ec06296c6ba50de7eb3..61a7bf3f4122835762c51383751951e3f2b15dbd 100644 (file)
@@ -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;
 
index 99d5c6f017160e6b19fd1c5e41f6164bcba6cc11..1494263c06f80a52b9ce42a644ec46ab06e9dd77 100644 (file)
@@ -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,
index 38b96a6d48fe2b7f4efab79d81d3fc934cb5de63..c666dfa1ad882f079ea85927a4d484768764192a 100644 (file)
@@ -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 (file)
index 0000000..6fe14bd
--- /dev/null
@@ -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" } } */