This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GCC complains about nested functions despite none being present


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]