From 37f30285a934bf6eaf08e102658e3070030556ab Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 9 Jun 2017 13:11:52 +0000 Subject: [PATCH] Add "sorry, target cannot support label values" for nvptx 2017-06-09 Tom de Vries PR target/80855 * config/nvptx/nvptx.md (define_expand "mov"): 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 | 6 ++++++ gcc/config/nvptx/nvptx.md | 3 +++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/nvptx/label-values.c | 14 ++++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 gcc/testsuite/gcc.target/nvptx/label-values.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b9612cf0ba8..c61cba39f95 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-06-09 Tom de Vries + + PR target/80855 + * config/nvptx/nvptx.md (define_expand "mov"): Error out with + "target cannot support label values" when encountering LABEL_REF. + 2017-06-09 Martin Liska * tree-profile.c (gimple_gen_ic_profiler): Update comment. diff --git a/gcc/config/nvptx/nvptx.md b/gcc/config/nvptx/nvptx.md index f2ed63bf06b..f2b090594e3 100644 --- a/gcc/config/nvptx/nvptx.md +++ b/gcc/config/nvptx/nvptx.md @@ -254,6 +254,9 @@ emit_move_insn (operands[0], tmp); DONE; } + + if (GET_CODE (operands[1]) == LABEL_REF) + sorry ("target cannot support label values"); }) (define_insn "zero_extendqihi2" diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1a709466b2e..431e2e8368f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-06-09 Tom de Vries + + PR target/80855 + * gcc.target/nvptx/label-values.c: New test. + 2017-06-09 Thomas Preud'homme * 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 index 00000000000..350510e961e --- /dev/null +++ b/gcc/testsuite/gcc.target/nvptx/label-values.c @@ -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" "" } */ + } +} -- 2.30.2