This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
GCC complains about nested functions despite none being present
- From: Maxim Blinov <maxim dot a dot blinov at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Sat, 24 Jun 2017 16:39:44 +0100
- Subject: GCC complains about nested functions despite none being present
- Authentication-results: sourceware.org; auth=none
This question is in context of my own custom target for GCC. I just
want the compiler to be able to emit assembly for arbitrary C code, no
libraries.
I am currently in the state where I have a very minimal but compile-able
back-end complete.
However, I recieve the following error when trying to compile a minimal
C program:
test.c: In function 'main':
test.c:4:1: sorry, unimplemented: nested functions not supported on this
target
}
^
The test.c file:
int main() {
int a;
}
compiled with:
./xgcc -B $XGCCDIR -O0 -nostdlib -ffreestanding -nostartfiles -S -o a.S test.c
where $XGCCDIR is used to let xgcc locate cc1.
Clearly I have no nested functions. I am wondering as to whether this
is perhaps due to incomplete knowledge of how to perform stack
operations: I thought of catching the compiler execution as follows:
void lnx1_expand_prologue() {
gcc_unreachable();
}
void lnx1_expand_epilogue() {
gcc_unreachable();
}
But is seems that these functions don't get called at any point.