Skip to content

Commit 0f52ada

Browse files
authored
Merge pull request #54 from GuillaumeGomez/target-builtins
Fix wrong reinitialization of `target_builtins`
2 parents 426316e + 872980a commit 0f52ada

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

gcc/jit/dummy-frontend.cc

+10-8
Original file line numberDiff line numberDiff line change
@@ -1035,8 +1035,6 @@ jit_end_diagnostic (diagnostic_context *context,
10351035
gcc::jit::active_playback_ctxt->add_diagnostic (context, *diagnostic);
10361036
}
10371037

1038-
static bool builtins_initialized = false;
1039-
10401038
/* Language hooks. */
10411039

10421040
static bool
@@ -1075,12 +1073,16 @@ jit_langhook_init (void)
10751073
eventually be controllable by a command line option. */
10761074
mpfr_set_default_prec (256);
10771075

1078-
// TODO: check if this is a good fix.
1079-
if (!builtins_initialized)
1080-
{
1081-
targetm.init_builtins ();
1082-
builtins_initialized = true;
1083-
}
1076+
// FIXME: This code doesn't work as it erases the `target_builtins` map
1077+
// without checking if it's already filled before. A better check would be
1078+
// `if target_builtins.len() == 0` (or whatever this `hash_map` type method
1079+
// name is).
1080+
// static bool builtins_initialized = false;
1081+
// if (!builtins_initialized)
1082+
// {
1083+
targetm.init_builtins ();
1084+
// builtins_initialized = true;
1085+
// }
10841086

10851087
return true;
10861088
}

0 commit comments

Comments
 (0)