jit: fix ICE on BUILT_IN_TRAP [PR99126]
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 19 Feb 2021 02:28:26 +0000 (21:28 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Fri, 19 Feb 2021 02:28:26 +0000 (21:28 -0500)
commitb258e263e0d74ca1f76aeaac5f4d1abef6b13707
tree10ba2366bcfa77c851197f56f429d4f3ba921b06
parent187d0d5871b1fa572b0238b4989fa067df56778f
jit: fix ICE on BUILT_IN_TRAP [PR99126]

gcc/jit/ChangeLog:
PR jit/99126
* jit-builtins.c
(gcc::jit::builtins_manager::get_builtin_function_by_id):
Update assertion to reject BUILT_IN_NONE.
(gcc::jit::builtins_manager::ensure_optimization_builtins_exist):
New.
* jit-builtins.h
(gcc::jit::builtins_manager::ensure_optimization_builtins_exist):
New decl.
* jit-playback.c (gcc::jit::playback::context::replay): Call it.
Remove redundant conditional on bm.

gcc/testsuite/ChangeLog:
PR jit/99126
* jit.dg/test-trap.c: New test.
gcc/jit/jit-builtins.c
gcc/jit/jit-builtins.h
gcc/jit/jit-playback.c
gcc/testsuite/jit.dg/test-trap.c [new file with mode: 0644]