[LLVMdev] gfortran: patch, question

Chris Lattner sabre at nondot.org
Fri Sep 1 11:54:13 PDT 2006


On Fri, 1 Sep 2006, Michael McCracken wrote:
> 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.

Thanks, applied!

> 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.

Don't worry about them.  The rules for use are finicky and they are easy 
to add.  I'll add them to any patches.  Thanks!

> 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.

Ok

> #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
> ../../src/gcc/fortran/f95-lang.c:733

This is crashing because make_decl_rtl is an RTL backend specific 
function.  I haven't looked at the callsite but you probably want 
something like this:

#ifndef ENABLE_LLVM
     make_decl_rtl (olddecl);
#else
     make_decl_llvm (olddecl);
#endif


make_decl_rtl is also sometimes called implicitly by "DECL_RTL".  Any uses 
of DECL_RTL need to be replaced with DECL_LLVM.  If you have questions on 
a particular use, I'd be happy to help.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list