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

Re: [PATCH] Added information about inline assembler in stack calculations (.su files)


Hi!

On Fri, Dec 07, 2018 at 07:51:35AM +0000, Niklas DAHLQUIST wrote:
> On 12/1/18 1:15 AM, Jeff Law wrote:
> > One could argue that allocating stack space inside an ASM is a really
> > bad idea.  Consider things like dwarf debugging and unwind tables.  If
> > you're allocating stack inside an ASM that stuff is going to be totally
> > wrong.
> >
> > So I think my question before moving forward with something like this is
> > whether or not it makes sense at all to bother dumping data for a
> > scenario that we'd probably suggest developers avoid to begin with.
> 
> The purpose of the patch is to notify when the reported stack usage might be
> incorrect. Even if it's bad practice to alter stack in asm, there are 
> use cases
> in the embedded world that makes sense. A notable common use case is 
> FreeRTOS
> task switch using ARM "naked" attribute and inline asm, which reports "0 
> static",
> which gives a faulty stack usage. We have considered the other option to
> report a warning for these cases, but that alternative hasn't appealed 
> to us.

Would that work well?  Only warn for naked functions?  It would work
better for all users that do *not* mess with the stack in their asm ;-)


Segher


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