[LLVMdev] gfortran: patch, question

Michael McCracken michael.mccracken at gmail.com
Fri Sep 1 10:42:49 PDT 2006

Hi, I have a first quick patch and a question. The patch links f951
with g++ when LLVM is enabled. It's at the end of this email.

I wanted to know if I should submit patches with comments around them
like the "APPLE LOCAL LLVM" ones that mark the LLVM-only changes to
the tree. I'd like to make it as easy as possible to apply these, so
let me know any rules I should be following.

Right now, I can build f951 but it crashes while compiling the first
fortran file of libgfortran. I'm still working on it, but if the
following error and backtrace ring any bells for anyone, I'd
appreciate any tips.

-isystem /Users/mike/Documents/hpcl/LLVM/fortran/gcc4/obj/../install/powerpc-apple-darwin8.6.0/include
-isystem /Users/mike/Documents/hpcl/LLVM/fortran/gcc4/obj/../install/powerpc-apple-darwin8.6.0/sys-include
-Wall -Wall -fno-repack-arrays -fno-underscoring -c
../../../src/libgfortran/intrinsics/selected_int_kind.f90  -fno-common
-DPIC -o .libs/selected_int_kind.o
../../../src/libgfortran/intrinsics/selected_int_kind.f90:0: internal
compiler error: in make_decl_rtl, at varasm.c:1018
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://llvm.org/bugs> for instructions.

(gdb) bt
#0  fancy_abort (file=0x5eecc8 "../../src/gcc/varasm.c", line=0,
function=0x41c1a680 "") at ../../src/gcc/diagnostic.c:587
#1  0x00275ab4 in make_decl_rtl (decl=0x5bb1dc) at ../../src/gcc/varasm.c:1018
#2  0x000555a0 in gfc_define_builtin (name=0x5eecc8
"../../src/gcc/varasm.c", type=0x3fa, code=0, library_name=0xffb59c52
<Address 0xffb59c52 out of bounds>, const_p=true) at
#3  0x00055760 in gfc_be_parse_file (set_yydebug=6221000) at
#4  0x002654cc in toplev_main (argc=1081721732, argv=0x407a2ee4) at
#5  0x00002a74 in _start (argc=16, argv=0xbfffec50, envp=0xbfffec94)
at /SourceCache/Csu/Csu-58.1.1/crt.c:272
#6  0x0000291c in start ()


Index: gcc/fortran/Make-lang.in
--- gcc/fortran/Make-lang.in    (revision 160)
+++ gcc/fortran/Make-lang.in    (working copy)
@@ -106,7 +106,7 @@
 # The compiler itself is called f951.
 f951$(exeext): $(F95_OBJS) \
                $(BACKEND) $(LIBDEPS)
-       $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
+               $(LINKCC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
                $(F95_OBJS) $(BACKEND) $(F95_LIBS)

 gt-fortran-f95-lang.h gtype-fortran.h        : s-gtype; @true

Michael McCracken
UCSD CSE PhD Candidate
research: http://www.cse.ucsd.edu/~mmccrack/
misc: http://michael-mccracken.net/wp/

More information about the llvm-dev mailing list