Improve sorry message for -fzero-call-used-regs
authorTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Thu, 15 Sep 2022 06:59:30 +0000 (08:59 +0200)
committerTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Mon, 19 Sep 2022 11:06:58 +0000 (13:06 +0200)
commit6efc494a24bb423f1f9ef8dbdc65ca189072eb8d
treee4bbfa48e7afa2e937677bbd618a8ffea4957434
parent4637a1d293c978816ad622ba33e3a32a78640edd
Improve sorry message for -fzero-call-used-regs

When the -fzero-call-used-regs command line option is used with an
unsupported value, indicate that it's a value problem instead of an
option problem.

Without the patch, the error is:
In file included from gcc/testsuite/c-c++-common/zero-scratch-regs-8.c:5:
gcc/testsuite/c-c++-common/zero-scratch-regs-1.c: In function 'foo':
gcc/testsuite/c-c++-common/zero-scratch-regs-1.c:10:1: sorry, unimplemented: '-fzero-call-used-regs' not supported on this target
   10 | }
      | ^

With the patch, the error would be like this:
 In file included from gcc/testsuite/c-c++-common/zero-scratch-regs-8.c:5:
gcc/testsuite/c-c++-common/zero-scratch-regs-1.c: In function 'foo':
gcc/testsuite/c-c++-common/zero-scratch-regs-1.c:10:1: sorry, unimplemented: argument 'all-arg' is not supported for '-fzero-call-used-regs' on this target
   10 | }
      | ^

2022-09-19  Torbjörn SVENSSON  <torbjorn.svensson@foss.st.com>

gcc/ChangeLog:

* targhooks.cc (default_zero_call_used_regs): Improve sorry
message.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
gcc/targhooks.cc