public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/108151] New: gcc.dg/pr64536.c stores pointers in a long, broken for llp64
@ 2022-12-17  7:17 nightstrike at gmail dot com
  2022-12-17  7:21 ` [Bug testsuite/108151] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: nightstrike at gmail dot com @ 2022-12-17  7:17 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-05-03 15:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-17  7:17 [Bug testsuite/108151] New: gcc.dg/pr64536.c stores pointers in a long, broken for llp64 nightstrike at gmail dot com
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

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).