Don't convert TImode in debug insn
authorH.J. Lu <hongjiu.lu@intel.com>
Mon, 11 Jul 2016 15:13:56 +0000 (15:13 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Mon, 11 Jul 2016 15:13:56 +0000 (08:13 -0700)
When converting V1TImode register in debug insn, check if it has been
converted to TImode already.

gcc/

PR target/71801
* config/i386/i386.c (timode_scalar_chain::fix_debug_reg_uses):
Don't convert TImode in debug insn.

gcc/testsuite/

PR target/71801
* gcc.target/i386/pr71801.c: New test.

From-SVN: r238211

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr71801.c [new file with mode: 0644]

index 8ddd878..40e34dd 100644 (file)
@@ -1,3 +1,9 @@
+2016-07-11  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/71801
+       * config/i386/i386.c (timode_scalar_chain::fix_debug_reg_uses):
+       Don't convert TImode in debug insn.
+
 2016-07-11  Bernd Edlinger  <bernd.edlinger@hotmail.de>
 
        Convert TYPE_ALIGN_OK to a TYPE_LANG_FLAG.
index 9eaf414..d190bef 100644 (file)
@@ -3814,6 +3814,9 @@ timode_scalar_chain::fix_debug_reg_uses (rtx reg)
            continue;
          gcc_assert (GET_CODE (val) == VAR_LOCATION);
          rtx loc = PAT_VAR_LOCATION_LOC (val);
+         /* It may have been converted to TImode already.  */
+         if (GET_MODE (loc) == TImode)
+           continue;
          gcc_assert (REG_P (loc)
                      && GET_MODE (loc) == V1TImode);
          /* Convert V1TImode register, which has been updated by a SET
index 1d9dc5b..4bfbba5 100644 (file)
@@ -1,3 +1,8 @@
+2016-07-11  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/71801
+       * gcc.target/i386/pr71801.c: New test.
+
 2016-07-11  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/71816
diff --git a/gcc/testsuite/gcc.target/i386/pr71801.c b/gcc/testsuite/gcc.target/i386/pr71801.c
new file mode 100644 (file)
index 0000000..6c87522
--- /dev/null
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+struct {
+  char uuid[16];
+} c;
+struct {
+  int s_uuid[6];
+} a, b;
+int bar (void);
+static int get_label_uuid(char *p1) {
+  __builtin_memcpy(p1, a.s_uuid, sizeof(a));
+  if (bar())
+    __builtin_memcpy(p1, b.s_uuid, sizeof(b));
+  return 0;
+}
+void uuidcache_addentry(char *p1) { __builtin_memcpy(&c, p1, sizeof(c)); }
+void uuidcache_init() {
+  char d[1];
+  get_label_uuid(d);
+  uuidcache_addentry(d);
+}