Miscompilation of Portable.NET release 0.18

glenn.chambers@webmd.net glenn.chambers@webmd.net
Thu Oct 4 09:52:00 GMT 2001


While attempting to compile the newest release of Portable.NET[1], I
received the attached error message.

Examining the generated assembly code, I find that 'LL46' is referenced,
but never defined.

I am using the precompiled 3.0.1 binaries from http://www.sunfreeware.com
on a Solaris 8 system.

Attached are the original link command line, the gcc -v output, clippings
from the source file and assembly output, and the cg_cast.i file for use in
debugging.

I have not attempted to compile this code with 2.95.x, so I don't know if
this is a regression.

[1]: http://www.southern-storm.com.au/portable_net.html

--------------------
gcc  -g -O2  -o cscc-cs  cs_nodes.o cs_semantics.o cs_errors.o cs_gather.o
cs_gr
ammar.o cs_lookup.o cs_modifiers.o cs_options.o cs_preproc.o cs_scanner.o
cs_val
doc.o cs_main.o ../codegen/libILCodeGen.a ../dumpasm/libILDumpAsm.a
                  ../image/libILImage.a ../support/libILSupport.a -lm
../codegen/libILCodeGen.a(cg_cast.o): In function `ILGenCastConst':
cg_cast.o(.text+0x1238): undefined reference to `LL46'
collect2: ld returned 1 exit status

--------------------
gcc -v --save-temps on the cg_cast.c file yields:

Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.0.1/specs
Configured with: ../configure --with-as=/usr/local/bin/as
--with-ld=/usr/local/bin/ld --enable-libgcj
Thread model: posix
gcc version 3.0.1
 /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.0.1/cpp0 -lang-c -v -I. -I.
-I../include -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=1
-Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__
-D__svr4__ -D__SVR4 -D__sparc -D__sun -D__unix -Asystem=unix -Asystem=svr4
-D__OPTIMIZE__ -D__STDC_HOSTED__=1 -Wall -D__GCC_NEW_VARARGS__ -Acpu=sparc
-Amachine=sparc -DHAVE_CONFIG_H cg_cast.c cg_cast.i
GNU CPP version 3.0.1 (cpplib) (sparc)
ignoring nonexistent directory "/usr/local/sparc-sun-solaris2.8/include"
ignoring duplicate directory "."
#include "..." search starts here:
#include <...> search starts here:
 .
 ../include
 /usr/local/include
 /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.0.1/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.0.1/cc1 -fpreprocessed
cg_cast.i -quiet -dumpbase cg_cast.c -O2 -Wall -version -o cg_cast.s
GNU CPP version 3.0.1 (cpplib) (sparc)
GNU C version 3.0.1 (sparc-sun-solaris2.8)
     compiled by GNU C version 3.0.1.
 /usr/local/bin/as -V -Qy -s -o cg_cast.o cg_cast.s
GNU assembler version 2.11.2 (sparc-sun-solaris2.8) using BFD version
2.11.2

--------------------
The relevant portion of the cg_cast.s file:

ILGenCastConst:
        !#PROLOGUE# 0
        save    %sp, -136, %sp
        !#PROLOGUE# 1
        cmp     %i2, 22
        bgu     .LL18
        mov     0, %i0
        sethi   %hi(.LL717), %o1
        sll     %i2, 2, %o0
        or      %o1, %lo(.LL717), %o1
        ld      [%o1+%o0], %o2
        jmp     %o2
         nop
.LL20:
        cmp     %i3, 22
        bleu,a  .LL713
        sethi   %hi(.LL46), %o1          <--- the only occurance of LL46
        b       .LL18
        mov     0, %i0
.LL47:
        cmp     %i3, 22
        bgu     .LL18
        mov     0, %i0
        sethi   %hi(.LL73), %o1
        sll     %i3, 2, %o0
        or      %o1, %lo(.LL73), %o1
        ld      [%o1+%o0], %o2
        jmp     %o2
         nop
.LL51:
        b       .LL740
        mov     2, %o0
.LL52:
        b       .LL740
        mov     3, %o0

--------------------
The original .c file:

    64  #line 65 "cg_cast.c"
    65
    66  int ILGenCastConst(ILGenInfo * info, ILEvalValue * value,
ILMachineType
fromType, ILMachineType toType)
    67  {
    68          switch(fromType)
    69          {
    70                  case ILMachineType_Void:
    71                  {
    72                          switch(toType)
    73                          {
    74                                  case ILMachineType_Void:
    75                                  {
    76  #line 1671 "../codegen/cg_cast.tc"
    77                                          {
    78                                                  return 0;
    79                                          }
    80  #line 81 "cg_cast.c"
--------------------

Attached is cg_cast.i

(See attached file: cg_cast.i.gz)
cg_cast.i.gz

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cg_cast.i.gz
Type: application/x-gzip
Size: 45230 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20011004/4066b4db/attachment.bin>


More information about the Gcc-bugs mailing list