]> git.ipfire.org Git - thirdparty/gcc.git/commit
Give better error messages for musttail
authorAndi Kleen <ak@linux.intel.com>
Tue, 21 May 2024 14:01:57 +0000 (07:01 -0700)
committerAndi Kleen <ak@gcc.gnu.org>
Thu, 18 Jul 2024 04:26:16 +0000 (21:26 -0700)
commit81824596361cf4919d6dc026155160581c99b860
tree5aabebbb586c28e5b06ea87fd59a0b95c8d49454
parentb738a63e528db410a1c51fc27db37fe22f0cb397
Give better error messages for musttail

When musttail is set, make tree-tailcall give error messages
when it cannot handle a call. This avoids vague "other reasons"
error messages later at expand time when it sees a musttail
function not marked tail call.

In various cases this requires delaying the error until
the call is discovered.

Also print more information on the failure to the dump file.

gcc/ChangeLog:

PR c/83324
* tree-tailcall.cc (maybe_error_musttail): New function.
(suitable_for_tail_opt_p): Report error reason.
(suitable_for_tail_call_opt_p): Report error reason.
(find_tail_calls): Accept basic blocks with abnormal edges.
Delay reporting of errors until the call is discovered.
Move top level suitability checks to here.
(tree_optimize_tail_calls_1): Remove top level checks.
gcc/tree-tailcall.cc