public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Roger Sayle <sayle@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-2009] [Committed] PR other/106575: Use "signed char" in new fold-eqandshift-4.c
Date: Wed, 10 Aug 2022 06:08:05 +0000 (GMT)	[thread overview]
Message-ID: <20220810060805.5C10C3858401@sourceware.org> (raw)

https://gcc.gnu.org/g:c16d9f78dc81664e3341157c5a6efb85c0c141f4

commit r13-2009-gc16d9f78dc81664e3341157c5a6efb85c0c141f4
Author: Roger Sayle <roger@nextmovesoftware.com>
Date:   Wed Aug 10 07:05:33 2022 +0100

    [Committed] PR other/106575: Use "signed char" in new fold-eqandshift-4.c
    
    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
            PR other/106575
            * gcc.dg/fold-eqandshift-4.c: Use "signed char" explicitly.

Diff:
---
 gcc/testsuite/gcc.dg/fold-eqandshift-4.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

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; }


                 reply	other threads:[~2022-08-10  6:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220810060805.5C10C3858401@sourceware.org \
    --to=sayle@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).