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]

c/645: gcc snapshot-20001016 IA64 incorrect assembler



>Number:         645
>Category:       c
>Synopsis:       gcc snapshot-20001016 IA64 incorrect assembler
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 16 07:46:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Keith Owens
>Release:        snapshot-20001016
>Organization:
>Environment:
TurboLinux 2.4.0test8-000913-44 ia64 unknown.  Base C compiler
/usr/lib/gcc-lib/ia64-cygnus-linux/2.9-ia64-000216-final/specs.
>Description:
Downloaded cygnus/src and cygnus/gcc from CVS, last file 
change was Oct 15 18:11 GMT.  Compiled a subset of /src and
/gcc with one patch to src/bfd using base gcc (TurboLinux
2.9-ia64-000216-final) see later for compile scripts and
patch.  Got an unexpected compile error of kernel
2.4.0-test9 in mm/memory.c, routine zeromap_pte_range
complained about a value being too large to fit into 4 bytes.
I shrunk the problem down to a 12 line fragment, bug.c.

$$$ bug.c $$$

typedef struct { unsigned long pte; } pte_t;
extern unsigned long empty_zero_page[];

void zeromap_pte_range(pte_t * pte, unsigned long address)
{
    pte_t zero_pte;
    while(1)    /* comment this out to remove the bug */
    {
        zero_pte.pte = (unsigned long) (empty_zero_page) - 0xe000000000000000;
        *(pte) = (zero_pte);
    };
}

# ./snapshot-20001016/install/bin/gcc -Wall -O2 -g -c -o bug.o bug.c 
/tmp/ccIYCfkh.s: Assembler messages:
/tmp/ccIYCfkh.s:23: Error: Value of 2305843009213693952 too large for field of 4 bytes at 0

$$$ Assembler output $$$

        .file   "bug.c"
        .pred.safe_across_calls p1-p5,p16-p63
        .section        .debug_abbrev, "", "progbits"
.Ldebug_abbrev0:
        .section        .text
.Ltext0:
        .section        .debug_info, "", "progbits"
.Ldebug_info0:
        .section        .debug_line, "", "progbits"
.Ldebug_line0:
        .text
        .align 16
        .global zeromap_pte_range#
        .proc zeromap_pte_range#
zeromap_pte_range:
.LFB1:
        .file 0 "bug.c"
        .loc 0 12 0
        .prologue
.LBB2:
        .body
        .loc 0 7 0
        addl r14 = @ltoff(empty_zero_page#+2305843009213693952), gp
        ;;
        ld8 r14 = [r14]
        ;;
.L5:


Comment out the "while" statement and the problem goes
away.  Move the assignment to zero_pte outside the loop and
the problem goes away.

Compile scripts and patch.  The patch stops the sort of the
IA64 unwind information because it tries to read from the
output file and fails, the file is only open for writing.
FWIW, I get the same error when cross compiling from ix86 to
IA64.

$$$ snapshot-src $$$

#!/bin/sh
set -e
top=/build/kaos
cd $top
s=`pwd`/snapshot-`date -u +%Y%m%d`
rm -rf $s/src
mkdir -p $s
cd cygnus
find src -type d \
\( \
-name CVS \
-o -path src/cgen \
-o -path src/dejagnu \
-o -path src/expect \
-o -path src/itcl \
-o -path src/libgloss \
-o -path src/libgui \
-o -path src/newlib \
-o -path src/tcl \
-o -path src/texinfo \
-o -path src/tix \
-o -path src/tk \
-o -path src/winsup \
\) -prune -o -print | cpio -pmda $s

cd $s
for i in $top/src-*-patch
do
 patch -p1 < $i
done
rm -fr src-objdir
mkdir src-objdir
cd src-objdir
../src/configure --prefix=$s/install --target=ia64-unknown-linux
make all install


$$$ snapshot-gcc $$$

#!/bin/sh
set -e
top=/build/kaos
cd $top
s=`pwd`/snapshot-`date -u +%Y%m%d`
t=$s/install/bin/ia64-unknown-linux
rm -rf $s/gcc
mkdir -p $s
cd cygnus
find gcc -type d \
\( \
-name CVS \
-o -path gcc/gcc/ch \
-o -path gcc/gcc/cp \
-o -path gcc/gcc/f \
-o -path gcc/gcc/java \
-o -path gcc/gcc/objc \
-o -path gcc/gcc/testsuite/g++.dg \
-o -path gcc/gcc/testsuite/g++.old-deja \
-o -path gcc/gcc/testsuite/g77.f-torture \
-o -path gcc/gcc/testsuite/gcc.dg \
-o -path gcc/gcc/testsuite/gcc.failure \
-o -path gcc/gcc/testsuite/gcc.misc-tests \
-o -path gcc/gcc/testsuite/lib \
-o -path gcc/libchill \
-o -path gcc/libf2c \
-o -path gcc/libobjc \
-o -path gcc/libstdc++\* \
-o -path gcc/texinfo \
-o -path gcc/xiberty \
-o -path gcc/zlib \
-o -path gcc/zlib/nt \
-o -path gcc/zlib/os2 \
\) -prune -o -print | cpio -pmda $s

cd $s
for i in $top/gcc-*-patch
do
 patch -p1 < $i
done
rm -fr gcc-objdir
mkdir gcc-objdir
cd gcc-objdir
../gcc/configure --prefix=$s/install --with-gnu-as --with-gnu-ld --target=ia64-unknown-linux
make all install

$$$ src-unwindsort-patch $$$

--- cygnus/src/bfd/elf64-ia64.c.orig    Fri Oct 13 19:55:45 2000
+++ cygnus/src/bfd/elf64-ia64.c Fri Oct 13 19:55:20 2000
@@ -3158,6 +3158,7 @@
 
   /* If we're producing a final executable, we need to sort the contents
      of the .IA_64.unwind section.  */
+#if 0  /*KAO*/
   if (!info->relocateable)
     {
       asection *s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_unwind);
@@ -3180,6 +3181,7 @@
      return false;
  }
     }
+#endif
 
   return true;
 }

>How-To-Repeat:

>Fix:

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

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