public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/94542] New: test gcc/testsuite/gcc.dg/tls/pr24428-2.c generates incorrect code on ppc64le with -mpcrel -mcpu=future -O2
@ 2020-04-09 17:09 acsawdey at gcc dot gnu.org
  2020-04-09 17:13 ` [Bug target/94542] " acsawdey at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: acsawdey at gcc dot gnu.org @ 2020-04-09 17:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94542
           Summary: test gcc/testsuite/gcc.dg/tls/pr24428-2.c generates
                    incorrect code on ppc64le with -mpcrel -mcpu=future
                    -O2
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: acsawdey at gcc dot gnu.org
  Target Milestone: ---

The test case is:

__thread double thrtest[81];
int main ()
{
  double *p, *e;
  e = &thrtest[81];
  for (p = &thrtest[0]; p < e; ++p)
    *p = 1.0;
  return 0;
}

Generated code for p and e is

        paddi 9,13,thrtest@tprel
        pla 8,thrtest+648@pcrel

The second should also be using a @tprel relocation. Because it didn't, the
loop runs off the end of allocated memory and segfaults. This test runs
correctly when compiled with -O0.

Compile command:

/home2/sawdey/work/gcc/mamboCI/build-mambo/gcc/xgcc
-B/home2/sawdey/work/gcc/mamboCI/build-mambo/gcc/
/home2/sawdey/work/gcc/mamboCI/pike-trunk/gcc/testsuite/gcc.dg/tls/pr24428-2.c
-O2 -mpcrel -mcpu=future -S -o pr24428-2.exe.s

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

end of thread, other threads:[~2021-05-04 12:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-09 17:09 [Bug target/94542] New: test gcc/testsuite/gcc.dg/tls/pr24428-2.c generates incorrect code on ppc64le with -mpcrel -mcpu=future -O2 acsawdey at gcc dot gnu.org
2020-04-09 17:13 ` [Bug target/94542] " acsawdey at gcc dot gnu.org
2020-04-14 19:41 ` cvs-commit at gcc dot gnu.org
2021-05-04 12:32 ` rguenth 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).