Add "sorry, target cannot support label values" for nvptx
authorTom de Vries <tom@codesourcery.com>
Fri, 9 Jun 2017 13:11:52 +0000 (13:11 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Fri, 9 Jun 2017 13:11:52 +0000 (13:11 +0000)
2017-06-09  Tom de Vries  <tom@codesourcery.com>

PR target/80855
* config/nvptx/nvptx.md (define_expand "mov<QHSDISDFM>"): Error out with
"target cannot support label values" when encountering LABEL_REF.

* gcc.target/nvptx/label-values.c: New test.

From-SVN: r249060

gcc/ChangeLog
gcc/config/nvptx/nvptx.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/nvptx/label-values.c [new file with mode: 0644]

index b9612cf0ba883b5b50e8c4093e0ef344457d2471..c61cba39f95e863783f6fa7d64b8a1cb14ec1bd9 100644 (file)
@@ -1,3 +1,9 @@
+2017-06-09  Tom de Vries  <tom@codesourcery.com>
+
+       PR target/80855
+       * config/nvptx/nvptx.md (define_expand "mov<QHSDISDFM>"): Error out with
+       "target cannot support label values" when encountering LABEL_REF.
+
 2017-06-09  Martin Liska  <mliska@suse.cz>
 
        * tree-profile.c (gimple_gen_ic_profiler): Update comment.
index f2ed63bf06b377d9a70f4cda34778fdb91deec5a..f2b090594e37caf752491ce4c912b82e0ff44833 100644 (file)
       emit_move_insn (operands[0], tmp);
       DONE;
     }
+
+  if (GET_CODE (operands[1]) == LABEL_REF)
+    sorry ("target cannot support label values");
 })
 
 (define_insn "zero_extendqihi2"
index 1a709466b2e6bfdd24b0f81829283097377c9e06..431e2e8368f606bea2b19f2d8a576a968839bdd4 100644 (file)
@@ -1,3 +1,8 @@
+2017-06-09  Tom de Vries  <tom@codesourcery.com>
+
+       PR target/80855
+       * gcc.target/nvptx/label-values.c: New test.
+
 2017-06-09  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        * lib/target-supports.exp (check_effective_target_arm_arch_FUNC_ok):
diff --git a/gcc/testsuite/gcc.target/nvptx/label-values.c b/gcc/testsuite/gcc.target/nvptx/label-values.c
new file mode 100644 (file)
index 0000000..350510e
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-Wno-pedantic" } */
+
+int
+main (void)
+{
+  goto L2;
+ L1:
+  return 0;
+ L2:
+  {
+    void *ptr = &&L1; /* { dg-message "sorry, unimplemented: target cannot support label values" "" } */
+  }
+}