diff options
author | Tristan Gingold | 2014-11-27 07:24:33 +0100 |
---|---|---|
committer | Tristan Gingold | 2014-11-27 07:24:33 +0100 |
commit | 6bf8619f95d1bbc44b7fad7da0c0a2596967d335 (patch) | |
tree | 3cae7711c2cde288c7ff1fba8378c07d0e3315b6 /src/ortho/gcc | |
parent | 0e5bae59d60dd7c65b892a43c655b4d774e0a9c8 (diff) | |
download | ghdl-6bf8619f95d1bbc44b7fad7da0c0a2596967d335.tar.gz ghdl-6bf8619f95d1bbc44b7fad7da0c0a2596967d335.tar.bz2 ghdl-6bf8619f95d1bbc44b7fad7da0c0a2596967d335.zip |
ortho-lang: set enum sign early.
Diffstat (limited to 'src/ortho/gcc')
-rw-r--r-- | src/ortho/gcc/ortho-lang.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ortho/gcc/ortho-lang.c b/src/ortho/gcc/ortho-lang.c index f1a9e2c..2acaab4 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); } |