Skip to content

Commit 014202a

Browse files
committed
Clear the cache of nonstandard integer type to fix an issue with using bitcasts and optimizations
1 parent 2867bc3 commit 014202a

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

gcc/jit/dummy-frontend.c

+2
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,8 @@ jit_langhook_init (void)
592592
global_dc->begin_diagnostic = jit_begin_diagnostic;
593593
global_dc->end_diagnostic = jit_end_diagnostic;
594594

595+
clear_nonstandard_integer_type_cache ();
596+
595597
build_common_tree_nodes (false);
596598

597599
/* I don't know why this has to be done explicitly. */

gcc/tree.c

+8
Original file line numberDiff line numberDiff line change
@@ -6963,6 +6963,14 @@ build_reference_type (tree to_type)
69636963
(HOST_BITS_PER_WIDE_INT > 64 ? HOST_BITS_PER_WIDE_INT : 64)
69646964
static GTY(()) tree nonstandard_integer_type_cache[2 * MAX_INT_CACHED_PREC + 2];
69656965

6966+
void clear_nonstandard_integer_type_cache (void)
6967+
{
6968+
for (size_t i = 0 ; i < 2 * MAX_INT_CACHED_PREC + 2 ; i++)
6969+
{
6970+
nonstandard_integer_type_cache[i] = NULL;
6971+
}
6972+
}
6973+
69666974
/* Builds a signed or unsigned integer type of precision PRECISION.
69676975
Used for C bitfields whose precision does not match that of
69686976
built-in target types. */

gcc/tree.h

+1
Original file line numberDiff line numberDiff line change
@@ -5385,6 +5385,7 @@ extern bool real_minus_onep (const_tree);
53855385
extern void init_ttree (void);
53865386
extern void build_common_tree_nodes (bool);
53875387
extern void build_common_builtin_nodes (void);
5388+
extern void clear_nonstandard_integer_type_cache (void);
53885389
extern tree build_nonstandard_integer_type (unsigned HOST_WIDE_INT, int);
53895390
extern tree build_nonstandard_boolean_type (unsigned HOST_WIDE_INT);
53905391
extern tree build_range_type (tree, tree, tree);

0 commit comments

Comments
 (0)