From 1e92bbb90760c6d3a55d9685228cf2e99dd40e8f Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Mon, 22 Mar 2004 00:40:44 +0000 Subject: real.h (struct real_value): Use the same type for all bitfields. * real.h (struct real_value): Use the same type for all bitfields. Rename exp to uexp. (REAL_EXP, SET_REAL_EXP): New accessor macros for uexp. Adjust all uses of exp... * builtins.c: ... here, ... * emit-rtl.c: ... here, and ... * real.c: ... and here. From-SVN: r79802 --- gcc/real.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'gcc/real.h') diff --git a/gcc/real.h b/gcc/real.h index 3ff0356..475ab45 100644 --- a/gcc/real.h +++ b/gcc/real.h @@ -42,14 +42,23 @@ enum real_value_class { struct real_value GTY(()) { - ENUM_BITFIELD (real_value_class) class : 2; + /* Use the same underlying type for all bit-fields, so as to make + sure they're packed together, otherwise REAL_VALUE_TYPE_SIZE will + be miscomputed. */ + unsigned int /* ENUM_BITFIELD (real_value_class) */ class : 2; unsigned int sign : 1; unsigned int signalling : 1; unsigned int canonical : 1; - signed int exp : EXP_BITS; + unsigned int uexp : EXP_BITS; unsigned long sig[SIGSZ]; }; +#define REAL_EXP(REAL) \ + ((int)((REAL)->uexp ^ (unsigned int)(1 << (EXP_BITS - 1))) \ + - (1 << (EXP_BITS - 1))) +#define SET_REAL_EXP(REAL, EXP) \ + ((REAL)->uexp = ((unsigned int)(EXP) & (unsigned int)((1 << EXP_BITS) - 1))) + /* Various headers condition prototypes on #ifdef REAL_VALUE_TYPE, so it needs to be a macro. We do need to continue to have a structure tag so that other headers can forward declare it. */ -- cgit v1.1