+2019-09-28 Alan Modra <amodra@gmail.com>
+
+ PR testsuite/91676
+ PR rtl-optimization/91656
+ * gcc.dg/torture/pr91656-1.c: Correct for big and pdp endian.
+ * gcc.dg/torture/pr91656-2.c: Likewise.
+ * gcc.dg/torture/pr91656-3.c: Likewise.
+
2019-09-27 Jakub Jelinek <jakub@redhat.com>
PR c++/88203
static __attribute__ ((__noipa__))
int foo (int i)
{
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
__builtin_memmove (&i, &e, 1);
+#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ __builtin_memmove ((char *) &i + sizeof (i) - 1,
+ (char *) &e + sizeof (e) - 1, 1);
+#elif __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__
+ __builtin_memmove ((char *) &i + sizeof (i) - 2,
+ (char *) &e + sizeof (e) - 2, 1);
+#else
+#error "endian unknown?"
+#endif
if (a > 0)
i /= e;
e /= 5;
{
u64 f = __builtin_bswap64 (c);
f = g == a;
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
__builtin_memmove (&f, &e, 1);
+#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ __builtin_memmove ((char *) &f + sizeof (f) - 1,
+ (char *) &e + sizeof (e) - 1, 1);
+#elif __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__
+ __builtin_memmove ((char *) &f + sizeof (f) - 2,
+ (char *) &e + sizeof (e) - 2, 1);
+#else
+#error "endian unknown?"
+#endif
e >>= b;
return a + f;
}
d (u16 e, u64 f)
{
b |= e;
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
__builtin_memset (&f, e, 2);
+#elif (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ \
+ || __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__)
+ __builtin_memset ((char *) &f + sizeof (f) - 2, e, 2);
+#else
+#error "endian unknown?"
+#endif
a = (u16) - e >= 2 ? : __builtin_popcountll (f);
return a + c;
}