This is the mail archive of the gcc@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]

stack-protection vs alloca vs dwarf2


While debugging some gdb-related FAILs, I discovered that gcc's
-fstack-check option effectively calls alloca() to adjust the stack
pointer.

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 [16384];
        small_frame ();
      }


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