From cbc0c2840906ad6fee93a7423a0212713949e90e Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 3 Aug 2017 11:18:09 +0000 Subject: [PATCH 03/22] Backport Error out on nvptx for fpatchable-function-entry 2021-10-07 Giuliano Belinassi Backport from mainline 2017-08-03 Tom de Vries PR target/81662 * config/nvptx/nvptx.c (nvptx_option_override): Emit sorry if function_entry_patch_area_size > 0. * gcc.target/nvptx/patchable_function_entry-default.c: New test. --- gcc/config/nvptx/nvptx.c | 4 ++++ .../nvptx/patchable_function_entry-default.c | 15 +++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 gcc/testsuite/gcc.target/nvptx/patchable_function_entry-default.c diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index 74bce3ec8d0..b0470836fb8 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -178,6 +178,10 @@ nvptx_option_override (void) if (!global_options_set.x_flag_no_common) flag_no_common = 1; + /* The patch area requires nops, which we don't have. */ + if (function_entry_patch_area_size > 0) + sorry ("not generating patch area, nops not supported"); + /* Assumes that it will see only hard registers. */ flag_var_tracking = 0; diff --git a/gcc/testsuite/gcc.target/nvptx/patchable_function_entry-default.c b/gcc/testsuite/gcc.target/nvptx/patchable_function_entry-default.c new file mode 100644 index 00000000000..42544562725 --- /dev/null +++ b/gcc/testsuite/gcc.target/nvptx/patchable_function_entry-default.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */ + +extern int a; + +int f3 (void); + +int +__attribute__((noinline)) +f3 (void) +{ + return 5*a; +} + +/* { dg-excess-errors "sorry, unimplemented: not generating patch area, nops not supported" } */ -- 2.33.1