i386: Add __attribute__ ((gcc_struct)) to struct fenv [PR95418]
Windows ABI (MinGW) is different than Linux ABI when bitfileds are involved. The following patch adds __attribute__ ((gcc_struct)) to struct fenv in order to match the layout of x87 state image in memory. 2020-06-01 Uroš Bizjak <ubizjak@gmail.com> libatomic/ChangeLog: * config/x86/fenv.c (struct fenv): Add __attribute__ ((gcc_struct)). libgcc/ChangeLog: * config/i386/sfp-exceptions.c (struct fenv): Add __attribute__ ((gcc_struct)). libgfortran/ChangeLog: PR libfortran/95418 * config/fpu-387.h (struct fenv): Add __attribute__ ((gcc_struct)).
This commit is contained in:
parent
88f48e2967
commit
832c1192eb
|
@ -45,7 +45,7 @@ struct fenv
|
||||||
unsigned int __data_offset;
|
unsigned int __data_offset;
|
||||||
unsigned short int __data_selector;
|
unsigned short int __data_selector;
|
||||||
unsigned short int __unused5;
|
unsigned short int __unused5;
|
||||||
};
|
} __attribute__ ((gcc_struct));
|
||||||
|
|
||||||
#ifdef __SSE_MATH__
|
#ifdef __SSE_MATH__
|
||||||
# define __math_force_eval_div(x, y) \
|
# define __math_force_eval_div(x, y) \
|
||||||
|
|
|
@ -39,7 +39,7 @@ struct fenv
|
||||||
unsigned int __data_offset;
|
unsigned int __data_offset;
|
||||||
unsigned short int __data_selector;
|
unsigned short int __data_selector;
|
||||||
unsigned short int __unused5;
|
unsigned short int __unused5;
|
||||||
};
|
} __attribute__ ((gcc_struct));
|
||||||
|
|
||||||
#ifdef __SSE_MATH__
|
#ifdef __SSE_MATH__
|
||||||
# define __math_force_eval_div(x, y) \
|
# define __math_force_eval_div(x, y) \
|
||||||
|
|
|
@ -85,7 +85,7 @@ struct fenv
|
||||||
unsigned short int __data_selector;
|
unsigned short int __data_selector;
|
||||||
unsigned short int __unused5;
|
unsigned short int __unused5;
|
||||||
unsigned int __mxcsr;
|
unsigned int __mxcsr;
|
||||||
};
|
} __attribute__ ((gcc_struct));
|
||||||
|
|
||||||
/* Check we can actually store the FPU state in the allocated size. */
|
/* Check we can actually store the FPU state in the allocated size. */
|
||||||
_Static_assert (sizeof(struct fenv) <= (size_t) GFC_FPE_STATE_BUFFER_SIZE,
|
_Static_assert (sizeof(struct fenv) <= (size_t) GFC_FPE_STATE_BUFFER_SIZE,
|
||||||
|
|
Loading…
Reference in New Issue