aboutsummaryrefslogtreecommitdiff
path: root/gcc/stor-layout.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r--gcc/stor-layout.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index f69fad8..433fd99 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -2205,14 +2205,17 @@ layout_type (tree type)
break;
case REAL_TYPE:
- /* Allow the caller to choose the type mode, which is how decimal
- floats are distinguished from binary ones. */
- if (TYPE_MODE (type) == VOIDmode)
- SET_TYPE_MODE (type,
- mode_for_size (TYPE_PRECISION (type), MODE_FLOAT, 0));
- TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)));
- TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (TYPE_MODE (type)));
- break;
+ {
+ /* Allow the caller to choose the type mode, which is how decimal
+ floats are distinguished from binary ones. */
+ if (TYPE_MODE (type) == VOIDmode)
+ SET_TYPE_MODE
+ (type, float_mode_for_size (TYPE_PRECISION (type)).require ());
+ scalar_float_mode mode = as_a <scalar_float_mode> (TYPE_MODE (type));
+ TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (mode));
+ TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (mode));
+ break;
+ }
case FIXED_POINT_TYPE:
/* TYPE_MODE (type) has been set already. */