]> gcc.gnu.org Git - gcc.git/commit
Avoid registering __builtin_setjmp_receiver label twice [PR101347]
authorAlexander Monakov <amonakov@ispras.ru>
Tue, 19 Jul 2022 15:04:30 +0000 (18:04 +0300)
committerAlexander Monakov <amonakov@ispras.ru>
Wed, 20 Jul 2022 13:12:34 +0000 (16:12 +0300)
commitdaa36cfc2fc2538810db071b81d250f4d621f7ea
treea78721af7760c9278ccf5993944f08ed0b22ee07
parent8694390e2b6ae3af3212f1c829e62fb086cf7707
Avoid registering __builtin_setjmp_receiver label twice [PR101347]

The testcase in the PR demonstrates how it is possible for one
__builtin_setjmp_receiver label to appear in
nonlocal_goto_handler_labels list twice (after the block with
__builtin_setjmp_setup referring to it was duplicated).

remove_node_from_insn_list did not account for this possibility and
removed only the first copy from the list. Add an assert verifying that
duplicates are not present.

To avoid adding a label to the list twice, move registration of the
label from __builtin_setjmp_setup handling to __builtin_setjmp_receiver.

gcc/ChangeLog:

PR rtl-optimization/101347
* builtins.cc (expand_builtin) [BUILT_IN_SETJMP_SETUP]: Move
population of nonlocal_goto_handler_labels from here ...
(expand_builtin) [BUILT_IN_SETJMP_RECEIVER]: ... to here.
* rtlanal.cc (remove_node_from_insn_list): Verify that a
duplicate is not present in the remainder of the list.
gcc/builtins.cc
gcc/rtlanal.cc
This page took 0.057725 seconds and 5 git commands to generate.