[Bug debug/14977] New: -gstabs+ breaks AMD 64-bit linking
salevin at lgc dot com
gcc-bugzilla@gcc.gnu.org
Fri Apr 16 16:23:00 GMT 2004
The attached shar demonstrates the problem. Run the "doit.sh"
script. Removing the -gstabs+ flag lets the test run just fine.
Reading specs from /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --
infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-
checking --with-system-zlib --enable-__cxa_atexit --host=x86_64-redhat-linux
Thread model: posix
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-24)
#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2.1).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 2004-04-16 08:53 MDT by <salevin@denamd64001>.
# Source directory was
`/.automount/denfiler01/vol/vol0_den/home/salevin/falloctest'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
# 1100 -rw-r--r-- testalloc.f
# 231 -rw-r--r-- doit.f
# 236 -rw-r--r-- doit2.f
# 822 -rw-r--r-- myalloc.f
# 310 -rw-r--r-- getmem.c
# 125 -rw-r--r-- cppmain.cpp
# 1157 -rw-r--r-- mem.inc
# 452 -rw-r--r-- dimen.inc
# 44 -rw-r--r-- spacez_reloc.ldscript
# 537 -rwxr-xr-x doit.sh
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
if test "$gettext_dir" = FAILED && test -f $dir/gettext \
&& ($dir/gettext --version >/dev/null 2>&1)
then
set `$dir/gettext --version 2>&1`
if test "$3" = GNU
then
gettext_dir=$dir
fi
fi
if test "$locale_dir" = FAILED && test -f $dir/shar \
&& ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
then
locale_dir=`$dir/shar --print-text-domain-dir`
fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
echo=echo
else
TEXTDOMAINDIR=$locale_dir
export TEXTDOMAINDIR
TEXTDOMAIN=sharutils
export TEXTDOMAIN
echo="$gettext_dir/gettext -s"
fi
if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f
200112312359.59 -a -f $$.touch; then
shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f
123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then
shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -
f $$.touch; then
shar_touch='touch -am $3$4$5$6$2 "$8"'
else
shar_touch=:
echo
$echo 'WARNING: not restoring timestamps. Consider getting and'
$echo "installing GNU \`touch', distributed in GNU File Utilities..."
echo
fi
rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch
#
if mkdir _sh22636; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
exit 1
fi
# ============= testalloc.f ==============
if test -f 'testalloc.f' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'testalloc.f' '(file already exists)'
else
$echo 'x -' extracting 'testalloc.f' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'testalloc.f' &&
X SUBROUTINE TESTIT
X IMPLICIT NONE
X INCLUDE 'dimen.inc'
X INCLUDE 'mem.inc'
X INTEGER*8 GETMEM
X EXTERNAL GETMEM
X
X INTEGER*8 LOCSP1, NEWMEM, I8OFF, I8NDX
X INTEGER NWORDS , I4NDX
X
X INTEGER I,IBOT,ITOP
X
X LOCSP1 = %LOC(ISPACEz(1))
X WRITE(*,'(A,Z16)') 'ADDRESS OF ISPACEz ', LOCSP1
X WRITE(*,'(A,Z16)') 'ADDRESS OF ITEMPz ', %LOC(ITEMPz(1))
X NCALLSrz = 6
X IBOT=28
X ITOP=31 - 3
X NWORDS=2**(IBOT-1)
X WRITE(*,*) 'NWORDS ',NWORDS
X CALL MYALLOC(NWORDS,I4NDX)
X ISPACEz(I4NDX) = I4NDX
X
X CALL DOIT(6,RSPACEz(I4NDX+3),ISPACEz(I4NDX+9),RSPACEz(I4NDX+20))
X CALL DOIT2(RSPACEz(I4NDX+20),ISPACEz(I4NDX+9),RSPACEz(I4NDX+3),6)
X CALL DOIT3(RSPACEz(I4NDX+20),ISPACEz(I4NDX+9),RSPACEz(I4NDX+3),6)
X
X RETURN
X END
X SUBROUTINE DOIT3(C,IB,A,N)
X IMPLICIT NONE
X INCLUDE 'dimen.inc'
X INCLUDE 'mem.inc'
X INTEGER N
X REAL A(N),C(NCALLSrz)
X INTEGER IB(N)
X INTEGER I
X DO I=1,N
X C(I) = A(I)*IB(I)
X ENDDO
X RETURN
X END
SHAR_EOF
(set 20 04 04 05 15 39 19 'testalloc.f'; eval "$shar_touch") &&
chmod 0644 'testalloc.f' ||
$echo 'restore of' 'testalloc.f' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'testalloc.f:' 'MD5 check failed'
3d72c698e691dbdc92e9e20101e8c8b4 testalloc.f
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'testalloc.f'`"
test 1100 -eq "$shar_count" ||
$echo 'testalloc.f:' 'original size' '1100,' 'current size' "$shar_count!"
fi
fi
# ============= doit.f ==============
if test -f 'doit.f' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'doit.f' '(file already exists)'
else
$echo 'x -' extracting 'doit.f' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'doit.f' &&
X SUBROUTINE DOIT(N,A,IB,C)
X IMPLICIT NONE
X INTEGER N
X REAL A(N),C(*)
X INTEGER IB(N)
X INCLUDE 'mem.inc'
X INTEGER I
X DO I=1,N
X C(I) = SIN(A(I)*IB(I))
X ENDDO
X RETURN
X END
SHAR_EOF
(set 20 04 04 05 14 45 37 'doit.f'; eval "$shar_touch") &&
chmod 0644 'doit.f' ||
$echo 'restore of' 'doit.f' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'doit.f:' 'MD5 check failed'
42cbe27055ca639e5a05f4cb8d6f66e7 doit.f
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'doit.f'`"
test 231 -eq "$shar_count" ||
$echo 'doit.f:' 'original size' '231,' 'current size' "$shar_count!"
fi
fi
# ============= doit2.f ==============
if test -f 'doit2.f' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'doit2.f' '(file already exists)'
else
$echo 'x -' extracting 'doit2.f' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'doit2.f' &&
X SUBROUTINE DOIT2(C,IB,A,N)
X IMPLICIT NONE
X INCLUDE 'dimen.inc'
X INTEGER N
X REAL A(N),C(NCALLSrz)
X INTEGER IB(N)
X INTEGER I
X DO I=1,N
X C(I) = A(I)*IB(I)
X ENDDO
X RETURN
X END
SHAR_EOF
(set 20 04 04 05 15 36 11 'doit2.f'; eval "$shar_touch") &&
chmod 0644 'doit2.f' ||
$echo 'restore of' 'doit2.f' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'doit2.f:' 'MD5 check failed'
bed7bf552a5a4981eb723eae742b605d doit2.f
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'doit2.f'`"
test 236 -eq "$shar_count" ||
$echo 'doit2.f:' 'original size' '236,' 'current size' "$shar_count!"
fi
fi
# ============= myalloc.f ==============
if test -f 'myalloc.f' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'myalloc.f' '(file already exists)'
else
$echo 'x -' extracting 'myalloc.f' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'myalloc.f' &&
X SUBROUTINE MYALLOC(NWORDS,IXPTR)
X IMPLICIT NONE
X INCLUDE 'mem.inc'
X INTEGER*8 GETMEM
X EXTERNAL GETMEM
X
X INTEGER*8 LOCSP1, NEWMEM, I8OFF, I8NDX
X INTEGER NWORDS , I4NDX, IXPTR
X
X INTEGER I,IBOT,ITOP
X
X LOCSP1 = %LOC(ISPACEz(1))
X WRITE(*,'(A,Z16)') 'ADDRESS OF ISPACEz ', LOCSP1
X WRITE(*,'(A,Z16)') 'ADDRESS OF ITEMPz ', %LOC(ITEMPz(1))
X NWORDS=2**(IBOT-1)
X WRITE(*,*) 'NWORDS ',NWORDS
X NEWMEM = GETMEM(NWORDS)
X I8OFF = NEWMEM - LOCSP1
X I8NDX = 1+I8OFF/4
X I4NDX = I8NDX
X WRITE(*,'(A,Z16,A,Z16,A,Z16)') 'GETMEM ADDRESS ',NEWMEM,
X & ' I8OFF ',I8OFF, ' I8NDX ',I8NDX
X WRITE(*,'(A,Z8)')
X & ' I4NDX ',I4NDX
X IXPTR = I4NDX
X
X RETURN
X END
SHAR_EOF
(set 20 04 04 04 15 08 25 'myalloc.f'; eval "$shar_touch") &&
chmod 0644 'myalloc.f' ||
$echo 'restore of' 'myalloc.f' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'myalloc.f:' 'MD5 check failed'
00179f6e11a0aaf5837cb899725ed31f myalloc.f
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'myalloc.f'`"
test 822 -eq "$shar_count" ||
$echo 'myalloc.f:' 'original size' '822,' 'current size' "$shar_count!"
fi
fi
# ============= getmem.c ==============
if test -f 'getmem.c' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'getmem.c' '(file already exists)'
else
$echo 'x -' extracting 'getmem.c' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'getmem.c' &&
#include <malloc.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
long int getmem_(int *nwords)
{
X struct mallinfo minfo;
X
X mallopt(M_MMAP_MAX, 0);
X
X fprintf(stdout," sbrk(0) %p\n", sbrk(0));
X fflush(stdout);
/* malloc_stats(); */
X
X return (long int) malloc((*nwords) * sizeof(int));
X
}
SHAR_EOF
(set 20 04 03 01 13 39 13 'getmem.c'; eval "$shar_touch") &&
chmod 0644 'getmem.c' ||
$echo 'restore of' 'getmem.c' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'getmem.c:' 'MD5 check failed'
c9800b3718226dffe4db3c6b47de4aa7 getmem.c
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'getmem.c'`"
test 310 -eq "$shar_count" ||
$echo 'getmem.c:' 'original size' '310,' 'current size' "$shar_count!"
fi
fi
# ============= cppmain.cpp ==============
if test -f 'cppmain.cpp' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'cppmain.cpp' '(file already exists)'
else
$echo 'x -' extracting 'cppmain.cpp' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'cppmain.cpp' &&
extern "C" {
extern int *spacez_;
extern void testit_(void);
}
X
int main(int argc, char **argv) {
X testit_();
X return 0;
}
SHAR_EOF
(set 20 04 04 04 15 13 18 'cppmain.cpp'; eval "$shar_touch") &&
chmod 0644 'cppmain.cpp' ||
$echo 'restore of' 'cppmain.cpp' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'cppmain.cpp:' 'MD5 check failed'
006061bcb794aab431551c02595b4044 cppmain.cpp
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'cppmain.cpp'`"
test 125 -eq "$shar_count" ||
$echo 'cppmain.cpp:' 'original size' '125,' 'current size' "$shar_count!"
fi
fi
# ============= mem.inc ==============
if test -f 'mem.inc' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'mem.inc' '(file already exists)'
else
$echo 'x -' extracting 'mem.inc' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'mem.inc' &&
X
C------------------------------------------------------------------------------
C Include file for the use of managed memory
C------------------------------------------------------------------------------
X
C ..... MEMBLKpz is the length (in words) of the the first block of memory.
X INTEGER MEMBLKpz
X PARAMETER ( MEMBLKpz = 2 )
X
C ..... ISPACEz and RSPACEz are the space array, the managed memory buffers
X
X INTEGER ISPACEz( MEMBLKpz )
X REAL RSPACEz( MEMBLKpz )
C DOUBLE PRECISION DSPACEz( MEMBLKpz/2 )
X COMMON /SPACEz/ ISPACEz
X SAVE /SPACEz/
C EQUIVALENCE( ISPACEz, RSPACEz, DSPACEz )
X EQUIVALENCE( ISPACEz, RSPACEz )
X
C ..... ITEMPz, RTEMPz, CARRTEMPz, and CTEMPz are unmanaged scratch buffers
X
X INTEGER LTEMPpz
X PARAMETER ( LTEMPpz=50000 )
X
X COMMON /TEMPz/ ITEMPz
X INTEGER ITEMPz( LTEMPpz )
X REAL RTEMPz( LTEMPpz )
X CHARACTER CARRTEMPz( LTEMPpz*4 )
X EQUIVALENCE( ITEMPz, RTEMPz )
X EQUIVALENCE( ITEMPz, CARRTEMPz )
X
X COMMON /TEMPzc/ CCTEMPz
X CHARACTER*500 CCTEMPz(100), CTEMPz
X EQUIVALENCE ( CCTEMPz, CTEMPz )
X
SHAR_EOF
(set 20 04 04 04 14 48 39 'mem.inc'; eval "$shar_touch") &&
chmod 0644 'mem.inc' ||
$echo 'restore of' 'mem.inc' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'mem.inc:' 'MD5 check failed'
2e5e7ddd1278dd7ec1b2bd19725f5e04 mem.inc
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'mem.inc'`"
test 1157 -eq "$shar_count" ||
$echo 'mem.inc:' 'original size' '1157,' 'current size' "$shar_count!"
fi
fi
# ============= dimen.inc ==============
if test -f 'dimen.inc' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'dimen.inc' '(file already exists)'
else
$echo 'x -' extracting 'dimen.inc' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'dimen.inc' &&
X
C------------------------------------------------------------------------------
C Include file for the use of managed memory
C------------------------------------------------------------------------------
X
C ..... MEMBLKpz is the length (in words) of the the first block of memory.
X INTEGER NCALLSrz
X
C ..... ISPACEz and RSPACEz are the space array, the managed memory buffers
X
X COMMON /RUNTIMEz/ NCALLSrz
X SAVE /RUNTIMEz/
X
SHAR_EOF
(set 20 04 04 05 15 34 59 'dimen.inc'; eval "$shar_touch") &&
chmod 0644 'dimen.inc' ||
$echo 'restore of' 'dimen.inc' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'dimen.inc:' 'MD5 check failed'
67b2ba49872da68341194d81e83ddcf6 dimen.inc
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'dimen.inc'`"
test 452 -eq "$shar_count" ||
$echo 'dimen.inc:' 'original size' '452,' 'current size' "$shar_count!"
fi
fi
# ============= spacez_reloc.ldscript ==============
if test -f 'spacez_reloc.ldscript' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'spacez_reloc.ldscript' '(file already exists)'
else
$echo 'x -' extracting 'spacez_reloc.ldscript' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'spacez_reloc.ldscript' &&
spacez_ = ( _end + 8589934584 + 8 ) & ~ 7 ;
SHAR_EOF
(set 20 04 04 03 00 36 45 'spacez_reloc.ldscript'; eval "$shar_touch") &&
chmod 0644 'spacez_reloc.ldscript' ||
$echo 'restore of' 'spacez_reloc.ldscript' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'spacez_reloc.ldscript:' 'MD5 check failed'
9f60633f72cc54122b941007d461725b spacez_reloc.ldscript
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'spacez_reloc.ldscript'`"
test 44 -eq "$shar_count" ||
$echo 'spacez_reloc.ldscript:' 'original size' '44,' 'current
size' "$shar_count!"
fi
fi
# ============= doit.sh ==============
if test -f 'doit.sh' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'doit.sh' '(file already exists)'
else
$echo 'x -' extracting 'doit.sh' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'doit.sh' &&
#! /bin/sh -v
g77 -g -gstabs+ -m64 -mieee-fp -fPIC -fno-second-underscore -c testalloc.f
g77 -g -gstabs+ -m64 -mieee-fp -fPIC -fno-second-underscore -c doit.f
g77 -g -gstabs+ -m64 -mieee-fp -fPIC -fno-second-underscore -c doit2.f
g77 -g -gstabs+ -m64 -mieee-fp -fPIC -fno-second-underscore -c myalloc.f
gcc -g -gstabs+ -m64 -mieee-fp -fPIC -c getmem.c
g++ -g -gstabs+ -m64 -mieee-fp -fPIC -c cppmain.cpp
g++ -g -gstabs+ -m64 -mieee-fp -fPIC cppmain.o doit.o doit2.o getmem.o
myalloc.o testalloc.o -Wl,spacez_reloc.ldscript -lg2c
X./a.out
SHAR_EOF
(set 20 04 04 16 08 50 50 'doit.sh'; eval "$shar_touch") &&
chmod 0755 'doit.sh' ||
$echo 'restore of' 'doit.sh' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'doit.sh:' 'MD5 check failed'
5f944cbb79315bd0b56226d4cec65831 doit.sh
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'doit.sh'`"
test 537 -eq "$shar_count" ||
$echo 'doit.sh:' 'original size' '537,' 'current size' "$shar_count!"
fi
fi
rm -fr _sh22636
exit 1
--
Summary: -gstabs+ breaks AMD 64-bit linking
Product: gcc
Version: 3.2.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: debug
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: salevin at lgc dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: 3.3.2 20030502 (Red Hat Linux 3.2.3-24)
GCC host triplet: x86_64-redhat-linux
GCC target triplet: x86_64-redhat-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14977
More information about the Gcc-bugs
mailing list