This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/11127] New: Bad arithmetic in complex parameter


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: Bad arithmetic in complex parameter
           Product: gcc
           Version: 2.95.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: john.harper@vuw.ac.nz
                CC: gcc-bugs@gcc.gnu.org

The following g77 program prints 2.0 where it should have printed 3.14159
What follows is (a) the program (b) what happened when I compiled it
(c) what happened when I ran it (d) a printout of its .s file 
mahoe{~/Jfh} % cat  testparm2.f
      REAL PI
      COMPLEX Z,I
      PARAMETER(PI = 3.14159, I = (0.0,1.0), Z = PI*I )
      PRINT*,'Pi*i should be (0.0,3.14159) but is ', Z
      END
mahoe{~/Jfh} % g77 -save-temps -v testparm2.f
g77 version 2.95.3 20010315 (release) (from FSF-g77 version 0.5.25 20010315
(release))
Driving: g77 -save-temps -v testparm2.f -lg2c -lm
Reading specs from /usr/local/lib/gcc-lib/alphaev6-dec-osf4.0f/2.95.3/specs
gcc version 2.95.3 20010315 (release)
 /usr/local/lib/gcc-lib/alphaev6-dec-osf4.0f/2.95.3/f771 testparm2.f -quiet
-dumpbase testparm2.f -version -fversion -o testparm2.s
GNU F77 version 2.95.3 20010315 (release) (alphaev6-dec-osf4.0f) compiled by GNU
C version 2.7.2.3.f.1.
GNU Fortran Front End version 0.5.25 20010315 (release)
 as -g -nocpp -O0 -o testparm2.o testparm2.s
 /usr/local/lib/gcc-lib/alphaev6-dec-osf4.0f/2.95.3/mips-tfile -v -I
testparm2.o~ -o testparm2.o testparm2.s
mips-tfile version 2.95.3 20010315 (release)
 /usr/local/lib/gcc-lib/alphaev6-dec-osf4.0f/2.95.3/collect2 -G 8 -O1
-call_shared /usr/lib/cmplrs/cc/crt0.o
-L/usr/local/lib/gcc-lib/alphaev6-dec-osf4.0f/2.95.3 -L/usr/lib/cmplrs/cc
-L/usr/local/lib testparm2.o -lg2c -lm -lgcc -lc -lgcc
mahoe{~/Jfh} % ./a.out
 Pi*i should be (0.0,3.14159) but is  (0.,2.)
mahoe{~/Jfh} % cat testparm2.s
 	.verstamp 3 11
	.set noreorder
	.set volatile
	.set noat
	.arch ev6
	.file	1 "testparm2.f"
.data
	.align 3
__g77_cilist_0.0:
	.long 0
	.long 6
	.long 0
	.space 4
	.quad 0
	.long 0
	.space 4
.rdata
	.quad 0
$LC2:
	.ascii "Pi*i should be (0.0,3.14159) but is "
	.align 2
$LC4:
	.long 0x0
	.long 0x40000000
$LC5:
	.align 2
$LC0:
	.long 9
	.align 2
$LC1:
	.long 1
	.align 2
$LC3:
	.long 6
.text
	.align 5
	.globl MAIN__
	.ent MAIN__
MAIN__:
	.frame $15,16,$26,0
	.mask 0x4008000,-16
	ldgp $29,0($27)
$MAIN__..ng:
	lda $30,-16($30)
	stq $26,0($30)
	stq $15,8($30)
	mov $30,$15
	.prologue 1
	lda $16,__g77_cilist_0.0
	jsr $26,s_wsle
	ldgp $29,0($26)
	lda $16,$LC0
	lda $17,$LC1
	lda $18,$LC2
	lda $19,36
	jsr $26,do_lio
	ldgp $29,0($26)
	lda $16,$LC3
	lda $17,$LC1
	lda $18,$LC4
	lda $19,8
	jsr $26,do_lio
	ldgp $29,0($26)
	jsr $26,e_wsle
	ldgp $29,0($26)
	lda $16,$LC5
	mov $31,$17
	jsr $26,s_stop
	ldgp $29,0($26)
$L2:
	mov $15,$30
	ldq $26,0($30)
	ldq $15,8($30)
	lda $30,16($30)
	ret $31,($26),1
	.end MAIN__


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]