The recent improvements to bswap & rotates from Roger compromised a test
on the c6x port. Essentially it optimized away a rotate by adjusting the
subsequent test of the result. This is good ;-)
Fixing the test is trivial. We just need to extract the rotate idiom
into its own function and insure it doesn't get inlined, cloned, etc.
I've committed this patch to the trunk to fix the test by extracting the
rotate idiom into its own function and ensuring it doesn't get
inlined,cloned, etc.
Jeff
commit fd26ce83981c6b50519805500272ab26b4e4c4b0
Author: Jeff Law <jlaw@localhost.localdomain>
Date: Sun Aug 8 11:20:41 2021 -0400
Fix c6x test compromised by recent improvements to bswap & rotates
gcc/testsuite
* gcc.target/tic6x/rotdi16-scan.c: Pull rotate into its own
function.
diff --git a/gcc/testsuite/gcc.target/tic6x/rotdi16-scan.c
b/gcc/testsuite/gcc.target/tic6x/rotdi16-scan.c
index 4d7816c1537..550418324e6 100644
--- a/gcc/testsuite/gcc.target/tic6x/rotdi16-scan.c
+++ b/gcc/testsuite/gcc.target/tic6x/rotdi16-scan.c
@@ -7,10 +7,14 @@
unsigned long long z = 0x012389ab4567cdefull;
+unsigned long long __attribute__ ((noinline,noclone,noipa)) bar ()
+{
+ return (z << 48) | (z >> 16);
+}
+
int main ()
{
- unsigned long long z2 = (z << 48) | (z >> 16);
- if (z2 != 0xcdef012389ab4567ull)
+ if (bar() != 0xcdef012389ab4567ull)
abort ();
exit (0);
}