public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Committed] PR other/106575: Use "signed char" in new fold-eqandshift-4.c
@ 2022-08-10  6:09 Roger Sayle
  0 siblings, 0 replies; only message in thread
From: Roger Sayle @ 2022-08-10  6:09 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 447 bytes --]


My recently added testcase gcc.dg/fold-eqandshift-4.c, incorrectly assumed
that "char" was "signed char", and hence fails on powerpc64 where this
isn't the case.  Fixed by making "signed char" explicit where needed in
this test.  Committed as obvious.


2022-08-10  Roger Sayle  <roger@nextmovesoftware.com>

gcc/testsuite/ChangeLog
        * gcc.dg/fold-eqandshift-4.c: Use "signed char" explicitly.


Apologies for the inconvenience.
Roger
--


[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1489 bytes --]

diff --git a/gcc/testsuite/gcc.dg/fold-eqandshift-4.c b/gcc/testsuite/gcc.dg/fold-eqandshift-4.c
index 42d5190703e..fbba438556e 100644
--- a/gcc/testsuite/gcc.dg/fold-eqandshift-4.c
+++ b/gcc/testsuite/gcc.dg/fold-eqandshift-4.c
@@ -1,14 +1,14 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fdump-tree-optimized" } */
 
-int sr30eq00(char x) { return ((x >> 4) & 0x30) == 0; }
-int sr30ne00(char x) { return ((x >> 4) & 0x30) != 0; }
-int sr30eq20(char z) { return ((z >> 4) & 0x30) == 0x20; }
-int sr30ne20(char z) { return ((z >> 4) & 0x30) != 0x20; }
-int sr30eq30(char x) { return ((x >> 4) & 0x30) == 0x30; }
-int sr30ne30(char x) { return ((x >> 4) & 0x30) != 0x30; }
-int sr33eq33(char x) { return ((x >> 4) & 0x33) == 0x33; }
-int sr33ne33(char x) { return ((x >> 4) & 0x33) != 0x33; }
+int sr30eq00(signed char x) { return ((x >> 4) & 0x30) == 0; }
+int sr30ne00(signed char x) { return ((x >> 4) & 0x30) != 0; }
+int sr30eq20(signed char z) { return ((z >> 4) & 0x30) == 0x20; }
+int sr30ne20(signed char z) { return ((z >> 4) & 0x30) != 0x20; }
+int sr30eq30(signed char x) { return ((x >> 4) & 0x30) == 0x30; }
+int sr30ne30(signed char x) { return ((x >> 4) & 0x30) != 0x30; }
+int sr33eq33(signed char x) { return ((x >> 4) & 0x33) == 0x33; }
+int sr33ne33(signed char x) { return ((x >> 4) & 0x33) != 0x33; }
 
 int ur30eq00(unsigned char z) { return ((z >> 4) & 0x30) == 0; }
 int ur30ne00(unsigned char z) { return ((z >> 4) & 0x30) != 0; }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-10  6:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-10  6:09 [Committed] PR other/106575: Use "signed char" in new fold-eqandshift-4.c Roger Sayle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).