[LLVMdev] Nested functions

Duncan Sands baldrick at free.fr
Wed Mar 4 12:59:13 PST 2009


Hi Bharadwaj,

> I get the following error during compilation using the LLVM cross-compiler
> (x86_64->arm).
> 
> error: nested functions are disabled, use -fnested-functions to re-enable

yes, nested functions are disabled by default in llvm-gcc (not sure why -
maybe a historical hang over from the days when they were not supported?).

> With -fnested-functions switch, I get the following error:
> 
> <llvm-src-dir>/llvm/lib/Target/ARM/ARMISelLowering.cpp:1439: virtual
> llvm::SDValue llvm::ARMTargetLowering::LowerOperation(llvm::SDValue,
> llvm::SelectionDAG&): Assertion `0 && "Don't know how to custom lower
> this!"' failed.
> frobos/tests/hello.c:453: internal compiler error: Aborted
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <URL:http://developer.apple.com/bugreporter> for instructions.
> 
> I'd like to investigate this but am wondering if anyone has any
> thoughts/suggestions in this area.

I don't know anything about cross-compiling, but the usual way
to debug this kind of thing is to re-run by hand the line that
caused this assertion, but adding -emit-llvm to the command line.
The output will then contain LLVM bitcode.  If you are lucky,
then running llc on the bitcode will give the same assertion
failure.  If so, then "bugpoint --run-llc the_bit_code" should
automatically reduce a minimal testcase.

Ciao,

Duncan.



More information about the llvm-dev mailing list