There was a thinko in the testcase field-merge-9.c: I overcorrected it
for big-endian.
As a bonus, I'm including stdbool.h in field-merge-12.c, because I
used bool without the header there.
for gcc/testsuite/ChangeLog
PR testsuite/118025
* gcc.dg/field-merge-9.c (q): Drop overcorrection for
big-endian.
* gcc.dg/field-merge-12.c: Include stdbool.h.
/* Check that we don't crash when trying to handle masks that don't match the
width of the original type. */
+#include <stdbool.h>
+
struct s {
long long q;
};
static const char le = __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ ? 1 : 0;
struct s1 p = { { -!le , -le }, 42 };
-struct s2 q = { (le
- ? -2 << (__CHAR_BIT__ - 1)
- : -1 & ((1 << (__CHAR_BIT__ - 1) << 1) - 1)), 42 };
+struct s2 q = { -2 << (__CHAR_BIT__ - 1), 42 };
void f (void) {
if (0