public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* target/4731: SPARC gives wrong output on simple combination of Fortran main program and C functions
@ 2001-10-29  8:06 toon
  0 siblings, 0 replies; 3+ messages in thread
From: toon @ 2001-10-29  8:06 UTC (permalink / raw)
  To: gcc-gnats; +Cc: Hillel (Sabba) Markowitz

>Number:         4731
>Category:       target
>Synopsis:       SPARC gives wrong output on simple combination of Fortran main program and C functions
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 29 08:06:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Hillel (Sabba) Markowitz
>Release:        GCC 3.0.1
>Organization:
>Environment:
SPARC, Solaris 8
uname -a
SunOS mumble 5.8 Generic_108528-10 sun4u sparc SUNW,Sun-Blade-100
>Description:
This Fortran main program:

      PROGRAM TEST_G77
      REAL*4 PRINT_A
      REAL*4 TEST_GCC
      REAL*4 S, V, T
      REAL*8 PRINT_DA
      REAL*8 TEST_DGCC
      REAL*8 DS, DV, DT

      T = 20.0
      S = TEST_GCC(T)
      WRITE(*,'(A, F16.5, 3X, Z8)') "S = ", S, S
      WRITE(*,'(A, F16.5, 3X, Z8)') "T = ", T, T

      DT = 20.0
      DS = TEST_DGCC(DT)
      WRITE(*,'(A, F16.5, 3X, Z16)') "DS = ", DS, DS
      WRITE(*,'(A, F16.5, 3X, Z16)') "DT = ", DT, DT
      END

combined with these C functions:


float test_gcc_(float *b)
{
  float a;

  a = 10.0;
  printf("a=%f (%#x)\n",a,a);
  printf("b=%f (%#x)\n",*b,*b);
  return(a);
}

double test_dgcc_(double *db)
{
  double da;

  da = 10.0;
  printf("da=%f (%#x)\n",da,da);
  printf("db=%f (%#x)\n",*db,*db);
  return(da);
}

float print_a_(float *a)
{
  printf("A = %f (%#x)\n", *a, *a);
  return(0);
}

double print_da_(double *da)
{
  printf("DA = %f (%#x)\n", *da, *da);
  return(0);
}

give the wrong output:

a=10.000000 (0x40240000)
b=20.000000 (0x40340000)
S =     524288.00000   49000000
T =         20.00000   41A00000
da=10.000000 (0x40240000)
db=20.000000 (0x40340000)
DS =         10.00000   4024000000000000
DT =         20.00000   4034000000000000

[ The first value of S should be 10.00000 ]
>How-To-Repeat:
g77 -o bla fortran.f c.c
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

* Re: target/4731: SPARC gives wrong output on simple combination of Fortran main program and C functions
@ 2002-06-22  5:16 davem
  0 siblings, 0 replies; 3+ messages in thread
From: davem @ 2002-06-22  5:16 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, sabbahem, toon, toon

Synopsis: SPARC gives wrong output on simple combination of Fortran main program and C functions

State-Changed-From-To: feedback->closed
State-Changed-By: davem
State-Changed-When: Sat Jun 22 05:15:13 2002
State-Changed-Why:
    3 months and no response to feedback.  User can reopen
    if he still cares.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4731


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

* Re: target/4731: SPARC gives wrong output on simple combination of Fortran main program and C functions
@ 2002-03-16  7:54 toon
  0 siblings, 0 replies; 3+ messages in thread
From: toon @ 2002-03-16  7:54 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, sabbahem, toon, toon

Synopsis: SPARC gives wrong output on simple combination of Fortran main program and C functions

Responsible-Changed-From-To: unassigned->toon
Responsible-Changed-By: toon
Responsible-Changed-When: Sat Mar 16 07:53:57 2002
Responsible-Changed-Why:
    My job.
State-Changed-From-To: open->feedback
State-Changed-By: toon
State-Changed-When: Sat Mar 16 07:53:57 2002
State-Changed-Why:
    Please try to compile the Fortran code with the compiler
    option -fno-f2c and report the result - thanks.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4731


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

end of thread, other threads:[~2002-06-22 12:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-29  8:06 target/4731: SPARC gives wrong output on simple combination of Fortran main program and C functions toon
2002-03-16  7:54 toon
2002-06-22  5:16 davem

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