aboutsummaryrefslogtreecommitdiffstats
path: root/src/ortho/gcc/ortho-lang.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ortho/gcc/ortho-lang.c')
-rw-r--r--src/ortho/gcc/ortho-lang.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ortho/gcc/ortho-lang.c b/src/ortho/gcc/ortho-lang.c
index f1a9e2cfe..2acaab4ea 100644
--- a/src/ortho/gcc/ortho-lang.c
+++ b/src/ortho/gcc/ortho-lang.c
@@ -1299,8 +1299,9 @@ void
start_enum_type (struct o_enum_list *list, int size)
{
list->res = make_node (ENUMERAL_TYPE);
- // as of gcc4.8, TYPE_PRECISION of 0 is rigorously enforced!
- TYPE_PRECISION(list->res) = size;
+ /* Set precision and sign now, as this is used to normalize literals. */
+ TYPE_PRECISION (list->res) = size;
+ TYPE_UNSIGNED (list->res) = 1;
chain_init (&list->chain);
list->num = 0;
list->size = size;
@@ -1319,8 +1320,6 @@ finish_enum_type (struct o_enum_list *list, tree *res)
{
*res = list->res;
TYPE_VALUES (*res) = list->chain.first;
- TYPE_UNSIGNED (*res) = 1;
- TYPE_PRECISION (*res) = list->size;
set_min_and_max_values_for_integral_type (*res, list->size, 1);
layout_type (*res);
}