public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-4778] testsuite: Fix up pr64536.c for LLP64 targets [PR108151]
Date: Mon, 19 Dec 2022 12:52:55 +0000 (GMT)	[thread overview]
Message-ID: <20221219125255.921E63858D1E@sourceware.org> (raw)

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

commit r13-4778-gea37e96a37b50dad17b91d46edc518bbb9132d8e
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Dec 19 13:49:52 2022 +0100

    testsuite: Fix up pr64536.c for LLP64 targets [PR108151]
    
    The test casts a pointer to long, which is ok for ilp32 and lp64
    targets but not for llp64 targets.  Nothing reads the values later,
    it is a link test, so all we care about is that it is the same
    cast on s390x-linux where it used to fail before the PR64536 fix,
    and that we don't warn about it.
    
    2022-12-19  Jakub Jelinek  <jakub@redhat.com>
    
            PR testsuite/108151
            * gcc.dg/pr64536.c (bar): Use casts to __INTPTR_TYPE__ rather than
            long when casting pointer to integral type.

Diff:
---
 gcc/testsuite/gcc.dg/pr64536.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/pr64536.c b/gcc/testsuite/gcc.dg/pr64536.c
index f2728fbc938..bca2d4f0efe 100644
--- a/gcc/testsuite/gcc.dg/pr64536.c
+++ b/gcc/testsuite/gcc.dg/pr64536.c
@@ -41,7 +41,7 @@ bar (int x)
 	    }
 	  else
 	    i = (long *) (h->q = *f);
-	  *c++ = (long) f;
+	  *c++ = (__INTPTR_TYPE__) f;
 	  e += 6;
 	}
       else
@@ -55,7 +55,7 @@ bar (int x)
 	    }
 	  else
 	    i = (long *) (h->q = *f);
-	  *c++ = (long) f;
+	  *c++ = (__INTPTR_TYPE__) f;
 	  e += 6;
 	}
     }

                 reply	other threads:[~2022-12-19 12:52 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=20221219125255.921E63858D1E@sourceware.org \
    --to=jakub@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).