public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/29302] isfinite returns wrong result at -O1
Date: Sun, 05 Nov 2006 08:19:00 -0000	[thread overview]
Message-ID: <20061105081930.16791.qmail@sourceware.org> (raw)
In-Reply-To: <bug-29302-11113@http.gcc.gnu.org/bugzilla/>



------- Comment #25 from fxcoudert at gcc dot gnu dot org  2006-11-05 08:19 -------
This is completely a target bug, and I have made a simple C testcase. I filed
this with Apple bug reporter under id# 4820385. Adding geoffk in CC list since
he wanted a C-only testcase, and now we have one.

$ cat ppc_longdouble.c 
#include <stdlib.h>
#include <stdio.h>
#include <math.h>

void foo_ (long double *y)
{
  long double x;
  int n;

  x = *y;
  n = isfinite(x);
  if (n == 0)
    printf ("!finite: %d %Lg\n", n, x);
  else
    printf ("finite: %d %Lg\n", n, x);
}

int main (void)
{
  long double x;
  x = 0.0;
  x = 1 / x;
  foo_ (&x);
  return 0;
}
$ gcc-4.0 -g ppc_longdouble.c -O0 && ./a.out
finite: 1 inf
$ gcc-4.0 -g ppc_longdouble.c -O1 && ./a.out
finite: 1 inf


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |geoffk at gcc dot gnu dot
                   |                            |org
          Component|libfortran                  |target
           Keywords|                            |wrong-code
      Known to fail|                            |4.0.1 4.3.0
   Last reconfirmed|0000-00-00 00:00:00         |2006-11-05 08:19:29
               date|                            |
            Summary|nan_inf_fmt.f90 segfaults on|isfinite returns wrong
                   |Darwin PPC starting with    |result at -O1
                   |Xcode 2.4                   |


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


  parent reply	other threads:[~2006-11-05  8:19 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-30 20:45 [Bug libfortran/29302] New: nan_inf_fmt.f90 segfaults on Darwin PPC starting with Xcode 2.4 howarth at nitro dot med dot uc dot edu
2006-09-30 20:46 ` [Bug libfortran/29302] " howarth at nitro dot med dot uc dot edu
2006-09-30 21:09 ` jvdelisle at gcc dot gnu dot org
2006-09-30 21:36 ` jvdelisle at gcc dot gnu dot org
2006-09-30 21:53 ` jvdelisle at gcc dot gnu dot org
2006-09-30 22:50 ` howarth at nitro dot med dot uc dot edu
2006-10-01  0:40 ` kargl at gcc dot gnu dot org
2006-10-04 23:57 ` geoffk at gcc dot gnu dot org
2006-10-05  2:04 ` howarth at nitro dot med dot uc dot edu
2006-10-06  1:32 ` howarth at nitro dot med dot uc dot edu
2006-10-31  1:02 ` geoffk at gcc dot gnu dot org
2006-10-31  1:03 ` geoffk at gcc dot gnu dot org
2006-10-31  3:18 ` jvdelisle at gcc dot gnu dot org
2006-10-31 14:14 ` howarth at nitro dot med dot uc dot edu
2006-10-31 23:24 ` jvdelisle at gcc dot gnu dot org
2006-11-01  4:33 ` howarth at nitro dot med dot uc dot edu
2006-11-01  4:48 ` pinskia at gcc dot gnu dot org
2006-11-01  4:56 ` jvdelisle at gcc dot gnu dot org
2006-11-01  5:05 ` howarth at nitro dot med dot uc dot edu
2006-11-01  5:10 ` howarth at nitro dot med dot uc dot edu
2006-11-01  6:06 ` howarth at nitro dot med dot uc dot edu
2006-11-01 14:00 ` howarth at nitro dot med dot uc dot edu
2006-11-02  2:51 ` howarth at nitro dot med dot uc dot edu
2006-11-02  3:16 ` howarth at nitro dot med dot uc dot edu
2006-11-02  3:19 ` howarth at nitro dot med dot uc dot edu
2006-11-05  8:19 ` fxcoudert at gcc dot gnu dot org [this message]
2006-11-05  8:20 ` [Bug target/29302] isfinite returns wrong result at -O1 fxcoudert at gcc dot gnu dot org
2006-11-08  0:07 ` echristo at apple dot com
2006-12-15 22:42 ` echristo at apple dot com
2006-12-19  4:17 ` sayle at gcc dot gnu dot org
2006-12-19 14:04 ` howarth at nitro dot med dot uc dot edu
2006-12-19 20:26 ` echristo at gcc dot gnu dot org
2007-01-17 23:30 ` echristo at gcc dot gnu dot org
2007-01-21  7:00 ` pinskia at gcc dot gnu dot 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=20061105081930.16791.qmail@sourceware.org \
    --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).