public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "nightstrike at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug testsuite/108151] New: gcc.dg/pr64536.c stores pointers in a long, broken for llp64
Date: Sat, 17 Dec 2022 07:17:06 +0000	[thread overview]
Message-ID: <bug-108151-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108151

            Bug ID: 108151
           Summary: gcc.dg/pr64536.c stores pointers in a long, broken for
                    llp64
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nightstrike at gmail dot com
  Target Milestone: ---

gcc/testsuite/gcc.dg/pr64536.c contains lines such as the following:

struct S { long q; } *h;
long a, b, g, j, k, *c, *d, *e, *f, *i;
i = (long *) (h->q = *f);
*c++ = (long) f;

These lines were added with the following commit:
adfac8dfed7b (Jakub Jelinek 2015-01-09 22:17:10 +0100 56)

This has the erroneous assumption that a long can hold a pointer.  This should
probably just use intptr_t or __INTPTR_TYPE__ for all occurrences.  Changing q
to be an __INTPTR_TYPE__ and both casts of f to be likewise makes the test
pass.

Note: I didn't put mingw in the target field, because this affects any LLP64
platform.

             reply	other threads:[~2022-12-17  7:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-17  7:17 nightstrike at gmail dot com [this message]
2022-12-17  7:21 ` [Bug testsuite/108151] " pinskia at gcc dot gnu.org
2022-12-19 12:52 ` cvs-commit at gcc dot gnu.org
2022-12-19 12:54 ` jakub at gcc dot gnu.org
2022-12-19 14:06 ` cvs-commit at gcc dot gnu.org
2023-02-10 17:44 ` cvs-commit at gcc dot gnu.org
2023-02-10 17:44 ` cvs-commit at gcc dot gnu.org
2023-05-02 20:12 ` cvs-commit at gcc dot gnu.org
2023-05-02 20:13 ` cvs-commit at gcc dot gnu.org
2023-05-03 15:20 ` cvs-commit at gcc dot gnu.org
2023-05-03 15:20 ` cvs-commit at gcc dot gnu.org

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=bug-108151-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).