diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2023-10-29 00:27:49 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2023-10-29 00:36:30 +0200 |
commit | 10f1489dcb3bd9adccc88898bc12f53398fa3583 (patch) | |
tree | 34a837c0418846d2fd1ec9562c0bd067cd515122 /gcc/d/d-tree.h | |
parent | 5d2a360f0a541646abb11efdbabc33c6a04de7ee (diff) | |
download | gcc-10f1489dcb3bd9adccc88898bc12f53398fa3583.zip gcc-10f1489dcb3bd9adccc88898bc12f53398fa3583.tar.gz gcc-10f1489dcb3bd9adccc88898bc12f53398fa3583.tar.bz2 |
d: Fix ICE: in verify_gimple_in_seq on powerpc-darwin9 [PR112270]
This ICE was seen during stage2 on powerpc-darwin9 only. There were
still some uses of GCC's boolean_type_node in the D front-end, which
caused a type mismatch to trigger as D bool size is fixed to 1 byte on
all targets.
So two new nodes have been introduced - d_bool_false_node and
d_bool_true_node - which have replaced all remaining uses of
boolean_false_node and boolean_true_node respectively.
PR d/112270
gcc/d/ChangeLog:
* d-builtins.cc (d_build_d_type_nodes): Initialize d_bool_false_node,
d_bool_true_node.
* d-codegen.cc (build_array_struct_comparison): Use d_bool_false_node
instead of boolean_false_node.
* d-convert.cc (d_truthvalue_conversion): Use d_bool_false_node and
d_bool_true_node instead of boolean_false_node and boolean_true_node.
* d-tree.h (enum d_tree_index): Add DTI_BOOL_FALSE and DTI_BOOL_TRUE.
(d_bool_false_node): New macro.
(d_bool_true_node): New macro.
* modules.cc (build_dso_cdtor_fn): Use d_bool_false_node and
d_bool_true_node instead of boolean_false_node and boolean_true_node.
(register_moduleinfo): Use d_bool_type instead of boolean_type_node.
gcc/testsuite/ChangeLog:
* gdc.dg/pr112270.d: New test.
Diffstat (limited to 'gcc/d/d-tree.h')
-rw-r--r-- | gcc/d/d-tree.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/d/d-tree.h b/gcc/d/d-tree.h index ed26533..7763695 100644 --- a/gcc/d/d-tree.h +++ b/gcc/d/d-tree.h @@ -444,6 +444,9 @@ enum d_tree_index DTI_NULL_ARRAY, DTI_BOTTOM_TYPE, + DTI_BOOL_FALSE, + DTI_BOOL_TRUE, + DTI_MAX }; @@ -480,6 +483,9 @@ extern GTY(()) tree d_global_trees[DTI_MAX]; #define null_array_node d_global_trees[DTI_NULL_ARRAY] /* The bottom type, referred to as `noreturn` in code. */ #define noreturn_type_node d_global_trees[DTI_BOTTOM_TYPE] +/* D boolean values are always byte-sized, unlike boolean_type_node. */ +#define d_bool_false_node d_global_trees[DTI_BOOL_FALSE] +#define d_bool_true_node d_global_trees[DTI_BOOL_TRUE] /* A prefix for internal variables, which are not user-visible. */ #if !defined (NO_DOT_IN_LABEL) |