We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 73a2882 commit b70e0e1Copy full SHA for b70e0e1
gcc/emit-rtl.cc
@@ -6191,8 +6191,13 @@ init_emit_once (void)
6191
/* Don't use gen_rtx_CONST_INT here since gen_rtx_CONST_INT in this case
6192
tries to use these variables. */
6193
for (i = - MAX_SAVED_CONST_INT; i <= MAX_SAVED_CONST_INT; i++)
6194
- const_int_rtx[i + MAX_SAVED_CONST_INT] =
6195
- gen_rtx_raw_CONST_INT (VOIDmode, (HOST_WIDE_INT) i);
+ {
+ // Do not initialize twice the constants because there are used elsewhere
6196
+ // and libgccjit execute this function twice.
6197
+ if (const_int_rtx[i + MAX_SAVED_CONST_INT] == NULL)
6198
+ const_int_rtx[i + MAX_SAVED_CONST_INT] =
6199
+ gen_rtx_raw_CONST_INT (VOIDmode, (HOST_WIDE_INT) i);
6200
+ }
6201
6202
if (STORE_FLAG_VALUE >= - MAX_SAVED_CONST_INT
6203
&& STORE_FLAG_VALUE <= MAX_SAVED_CONST_INT)
0 commit comments