This is the mail archive of the
mailing list for the GCC project.
stack-protection vs alloca vs dwarf2
- From: DJ Delorie <dj at redhat dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 16 Apr 2014 23:03:05 -0400
- Subject: stack-protection vs alloca vs dwarf2
- Authentication-results: sourceware.org; auth=none
While debugging some gdb-related FAILs, I discovered that gcc's
-fstack-check option effectively calls alloca() to adjust the stack
However, it doesn't mark the stack adjustment as FRAME_RELATED even
when it's setting up the local variables for the function.
In the case of rx-elf, for this testcase, the CFA for the function is
defined in terms of the stack pointer - and thus is incorrect after
the alloca call.
My question is: who's fault is this? Should alloca() tell the debug
stuff that the stack pointer has changed? Should it tell it to not
use $sp at all? Should the debug stuff "just know" that $sp isn't a
valid choice for the CFA?
The testcase from gdb is pretty simple:
void medium_frame ()
char S ;