public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/16195] New: Miscompilation of GCC 3.3.x by 3.4.x
@ 2004-06-25 12:00 jakub at gcc dot gnu dot org
  2004-06-25 12:25 ` [Bug target/16195] " jakub at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2004-06-25 12:00 UTC (permalink / raw)
  To: gcc-bugs

The following testcase distilled from ggc-common.c in GCC 3.3.4 is miscompiled
on ppc64.  It loads a floating point value (70.0) into the pic register and
dereferences it, thus the testcase segfaults.

/* { dg-do run } */
/* { dg-options "-O2" } */
/* { dg-options "-mminimal-toc" { target powerpc64-*-* } } */

extern void abort (void);
extern void exit (int);

double __attribute__((noinline))
foo (void)
{
  return 16441577472.0;
}

double __attribute__((noinline))
bar (double x)
{
  return x;
}

int __attribute__((noinline))
test (void)
{
  double x = foo ();
  x = bar (x);
  x /= 1024 * 1024 * 1024;
  x *= 70;
  x = x < 70 ? x : 70;
  x += 30;
  return x;
}

int main (void)
{
  if (test () != 100)
    abort ();
  exit (0);
}

-- 
           Summary: Miscompilation of GCC 3.3.x by 3.4.x
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: ppc64-redhat-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16195


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

end of thread, other threads:[~2004-08-19 23:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-25 12:00 [Bug target/16195] New: Miscompilation of GCC 3.3.x by 3.4.x jakub at gcc dot gnu dot org
2004-06-25 12:25 ` [Bug target/16195] " jakub at gcc dot gnu dot org
2004-06-25 12:27 ` jakub at gcc dot gnu dot org
2004-06-25 12:27 ` jakub at gcc dot gnu dot org
2004-06-25 21:21 ` pinskia at gcc dot gnu dot org
2004-06-29 19:48 ` cvs-commit at gcc dot gnu dot org
2004-07-03 12:11 ` cvs-commit at gcc dot gnu dot org
2004-08-19 21:24 ` [Bug target/16195] [3.4 only] " mmitchel at gcc dot gnu dot org
2004-08-19 22:39 ` cvs-commit at gcc dot gnu dot org
2004-08-19 23:30 ` pinskia at gcc dot gnu dot 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).