https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125047
Bug ID: 125047
Summary: [16 regression] ICE in get_int_type, at
jit/jit-recording.cc:838
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: jit
Assignee: dmalcolm at gcc dot gnu.org
Reporter: [email protected]
CC: antoyo at gcc dot gnu.org
Target Milestone: ---
Target: armv7l-*-*
$ gcc -o conftest conftest.c -lgccjit
$ ./conftest
libgccjit.so: <built-in>:0:0: internal compiler error: : in get_int_type, at
jit/jit-recording.cc:838
libgccjit.so /tmp/libgccjit-FrobUu/fake.c -fPIC -O0 -quiet
-mcpu=generic-armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -mabi=aapcs-linux
-mtls-dialect=gnu
$ cat conftest.c
#include <libgccjit.h>
void exit (int);
int
main (int argc, char **argv)
{
gcc_jit_context *ctxt;
gcc_jit_result *result;
ctxt = gcc_jit_context_acquire ();
if (!ctxt)
exit (1);
gcc_jit_type *int_type =
gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_INT);
gcc_jit_function *func =
gcc_jit_context_new_function (ctxt, NULL,
GCC_JIT_FUNCTION_EXPORTED,
int_type, "foo", 0, NULL, 0);
gcc_jit_block *block = gcc_jit_function_new_block (func, "foo");
gcc_jit_block_end_with_return (
block,
NULL,
gcc_jit_context_new_rvalue_from_int (ctxt, int_type, 1));
result = gcc_jit_context_compile (ctxt);
if (!result)
exit (1);
typedef int (*fn_type) (void);
fn_type foo =
(fn_type)gcc_jit_result_get_code (result, "foo");
if (!foo)
exit (1);
if (foo () != 1)
exit (1);
gcc_jit_context_release (ctxt);
gcc_jit_result_release (result);
return 0;
}