]> git.ipfire.org Git - thirdparty/gcc.git/commit
Avoid ICE in except.cc on targets that don't support exceptions.
authorRoger Sayle <roger@nextmovesoftware.com>
Wed, 22 May 2024 12:48:52 +0000 (13:48 +0100)
committerRoger Sayle <roger@nextmovesoftware.com>
Wed, 22 May 2024 12:48:52 +0000 (13:48 +0100)
commit26df7b4684e201e66c09dd018603a248ddc5f437
tree8a79c1bcc3d1c975318a9dc0e23662232f678aa8
parent3507ab1b018a68500e49fa9f1de7caa0f1b53dda
Avoid ICE in except.cc on targets that don't support exceptions.

A number of testcases currently fail on nvptx with the ICE:

during RTL pass: final
openmp-simd-2.c: In function 'foo':
openmp-simd-2.c:28:1: internal compiler error: in get_personality_function, at expr.cc:14037
   28 | }
      | ^
0x98a38f get_personality_function(tree_node*)
        /home/roger/GCC/nvptx-none/gcc/gcc/expr.cc:14037
0x969d3b output_function_exception_table(int)
        /home/roger/GCC/nvptx-none/gcc/gcc/except.cc:3226
0x9b760d rest_of_handle_final
        /home/roger/GCC/nvptx-none/gcc/gcc/final.cc:4252

The simple oversight in output_function_exception_table is that it calls
get_personality_function (immediately) before checking the target's
except_unwind_info hook (which on nvptx always returns UI_NONE).
The (perhaps obvious) fix is to move the assignments of fname and
personality after the tests that they are needed, and before their
first use.

2024-05-22  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
* except.cc (output_function_exception_table): Move call to
get_personality_function after targetm_common.except_unwind_info
check, to avoid ICE on targets that don't support exceptions.
gcc/except.cc