mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +00:00
Fix a bug found by inspection; in the __GNUC__ code, the alignment
doesn't apply to the type, only to the variable, so subsequent uses of U which expect it to be aligned weren't actually aligned. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98843 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -57,17 +57,18 @@ protected:
|
|||||||
// something else. An array of char would work great, but might not be
|
// something else. An array of char would work great, but might not be
|
||||||
// aligned sufficiently. Instead, we either use GCC extensions, or some
|
// aligned sufficiently. Instead, we either use GCC extensions, or some
|
||||||
// number of union instances for the space, which guarantee maximal alignment.
|
// number of union instances for the space, which guarantee maximal alignment.
|
||||||
|
struct U {
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
typedef char U;
|
char X __attribute__((aligned));
|
||||||
U FirstEl __attribute__((aligned));
|
|
||||||
#else
|
#else
|
||||||
union U {
|
union U {
|
||||||
double D;
|
double D;
|
||||||
long double LD;
|
long double LD;
|
||||||
long long L;
|
long long L;
|
||||||
void *P;
|
void *P;
|
||||||
} FirstEl;
|
} X;
|
||||||
#endif
|
#endif
|
||||||
|
} FirstEl;
|
||||||
// Space after 'FirstEl' is clobbered, do not add any instance vars after it.
|
// Space after 'FirstEl' is clobbered, do not add any instance vars after it.
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Reference in New Issue
Block a user