diff options
author | Tristan Gingold | 2014-11-04 03:14:58 +0100 |
---|---|---|
committer | Tristan Gingold | 2014-11-04 03:14:58 +0100 |
commit | d1cd3db01d5b43a7103e5d0fda1bdd1729a240f2 (patch) | |
tree | 45f0aede96adf1c63a7ee09d3f9bc5c4ccdd76ce /ortho/gcc/ortho-lang.c | |
parent | e2f3247a550c4289d706734d6fe8a246d8cddc39 (diff) | |
download | ghdl-d1cd3db01d5b43a7103e5d0fda1bdd1729a240f2.tar.gz ghdl-d1cd3db01d5b43a7103e5d0fda1bdd1729a240f2.tar.bz2 ghdl-d1cd3db01d5b43a7103e5d0fda1bdd1729a240f2.zip |
ticket 13: Fix crash on mips (patch from Joris van Rantwijk).
Diffstat (limited to 'ortho/gcc/ortho-lang.c')
-rw-r--r-- | ortho/gcc/ortho-lang.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/ortho/gcc/ortho-lang.c b/ortho/gcc/ortho-lang.c index d2eb243..c19012e 100644 --- a/ortho/gcc/ortho-lang.c +++ b/ortho/gcc/ortho-lang.c @@ -702,13 +702,6 @@ type_for_size (unsigned int precision, int unsignedp) if (precision <= MAX_BITS_PER_WORD) signed_and_unsigned_types[precision][unsignedp] = t; - else - // Handle larger requests by returning a NULL tree and letting - // the back end default to another approach. - // the exact test is unknown : distinguishing between 32 and 64 bits - // may be enough for all likely platforms - if (MAX_BITS_PER_WORD >= 64) - t = NULL_TREE; return t; } @@ -718,7 +711,22 @@ type_for_size (unsigned int precision, int unsignedp) static tree type_for_mode (enum machine_mode mode, int unsignedp) { - return type_for_size (GET_MODE_BITSIZE (mode), unsignedp); + if (SCALAR_INT_MODE_P (mode)) + return type_for_size (GET_MODE_BITSIZE (mode), unsignedp); + + if (mode == TYPE_MODE (void_type_node)) + return void_type_node; + + if (mode == TYPE_MODE (float_type_node)) + return float_type_node; + + if (mode == TYPE_MODE (double_type_node)) + return double_type_node; + + if (mode == TYPE_MODE (long_double_type_node)) + return long_double_type_node; + + return NULL_TREE; } #undef LANG_HOOKS_NAME |