unsigned char s;
} __attribute__ ((packed, aligned (4), scalar_storage_order ("big-endian")));
-#define vc 0xaa
-#define vi 0x12345678
+#define vc (unsigned char)0xaa
+#define vi (unsigned int)0x12345678
struct TL vL = { vc, vi, vc, vi, vc, vi, vc };
struct TB vB = { vc, vi, vc, vi, vc, vi, vc };
int c;
} __attribute__ ((aligned (4)));
-struct s p = { 42, (short)(0xef1 - 0x1000), 0x12345678 };
+struct s p = {
+ (short)(unsigned short)42,
+ (short)(unsigned short)(0xef1 - 0x1000),
+ (int)(unsigned int)0x12345678
+};
void f (void) {
if (0
|| (int)(signed char)p.b != (int)(signed char)(0xef1 - 0x1000)
|| (unsigned)(unsigned char)p.b != (unsigned)(unsigned char)(0xef1 - 0x1000)
|| (unsigned)p.b != (unsigned short)(0xef1 - 0x1000)
- || (int)(short)p.b != (int)(0xef1 - 0x1000)
+ || (int)(short)p.b != (int)(short)(unsigned short)(0xef1 - 0x1000)
|| (long)(unsigned char)(p.c >> 8) != (long)(unsigned char)0x123456
- || p.c != 0x12345678
+ || p.c != (int)(unsigned int)0x12345678
)
__builtin_abort ();
}
/* Check that we can optimize misaligned double-words. */
+#include <stddef.h>
+
struct s {
short a;
long long b;
if (fp () > 0)
__builtin_abort ();
unsigned char *pc = (unsigned char *)&p;
- for (int i = 0; i < sizeof (p); i++)
+ for (int i = 0; i < offsetof (struct s, e) + sizeof (p.e); i++)
{
pc[i] = 1;
if (fp () < 0)
unsigned int z;
} __attribute__((__aligned__(8)));
-#define vc 0xaa
-#define vi 0x12345678
+#define vc (unsigned char)0xaa
+#define vi (unsigned int)0x12345678
struct T1 v1 = { { vc + !BIG_ENDIAN_P, vc + BIG_ENDIAN_P }, vc, vi };
struct T2 v2 = { (vc << 8) | (vc - 1), vc, vi };
unsigned int z;
} __attribute__((__packed__, __aligned__(4)));
-#define vc 0xaa
-#define vs 0xccdd
-#define vi 0x12345678
+#define vc (unsigned char)0xaa
+#define vs (unsigned short)0xccdd
+#define vi (unsigned int)0x12345678
struct T1 v1 = { -1, vc, 1, vs, vi };
struct T2 v2 = { -1, 0, vc, 1, vs, vi };
unsigned int z;
} __attribute__((__packed__, __aligned__(8)));
-#define vc 0xaa
-#define vs 0xccdd
-#define vi 0x12345678
+#define vc (unsigned char)0xaa
+#define vs (unsigned short)0xccdd
+#define vi (unsigned int)0x12345678
struct T1 v1 = { -1, vc, 1, vs, vi };
struct T2 v2 = { -1, 0, vc, 1, vs, vi };