+2014-04-04 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * gcc.dg/builtin-bswap-6.c: Adjust return value to disable GCC
+ optimization.
+ * gcc.dg/builtin-bswap-7.c: Likewise.
+
2014-04-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58207
/* { dg-options "-O -fdump-rtl-combine" } */
/* { dg-options "-O -fdump-rtl-combine -march=z900" { target s390-*-* } } */
+/* The test intentionally returns 1/2 instead of the obvious 0/1 to
+ prevent GCC from calculating the return value with arithmetic
+ instead of a comparison. */
+
#include <stdint.h>
#define BS(X) __builtin_bswap32(X)
{
if (BS (a) == 0xA0000)
return 1;
- return 0;
+ return 2;
}
int foo2 (uint32_t a)
{
if (BS (a) != 0xA0000)
return 1;
- return 0;
+ return 2;
}
int foo3 (uint32_t a, uint32_t b)
{
if (BS (a) == BS (b))
return 1;
- return 0;
+ return 2;
}
int foo4 (uint32_t a, uint32_t b)
{
if (BS (a) != BS (b))
return 1;
- return 0;
+ return 2;
}
/* { dg-final { scan-rtl-dump-not "bswapsi" "combine" } } */
/* { dg-require-effective-target lp64 } */
/* { dg-options "-O -fdump-rtl-combine" } */
+/* The test intentionally returns 1/2 instead of the obvious 0/1 to
+ prevent GCC from calculating the return value with arithmetic
+ instead of a comparison. */
+
#include <stdint.h>
#define BS(X) __builtin_bswap64(X)
{
if (BS (a) == 0xA00000000)
return 1;
- return 0;
+ return 2;
}
int foo2 (uint64_t a)
{
if (BS (a) != 0xA00000000)
return 1;
- return 0;
+ return 2;
}
int foo3 (uint64_t a, uint64_t b)
{
if (BS (a) == BS (b))
return 1;
- return 0;
+ return 2;
}
int foo4 (uint64_t a, uint64_t b)
{
if (BS (a) != BS (b))
return 1;
- return 0;
+ return 2;
}
/* { dg-final { scan-rtl-dump-not "bswapdi" "combine" } } */