public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Segher Boessenkool <segher@kernel.crashing.org>,
	Niklas DAHLQUIST <niklas.dahlquist@st.com>
Cc: Torbjorn SVENSSON <torbjorn.svensson@st.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	"Joey.Ye@arm.com" <Joey.Ye@arm.com>,
	Samuel HULTGREN <samuel.hultgren@st.com>,
	Christophe LYON <christophe.lyon@st.com>,
	Christophe MONAT <christophe.monat@st.com>
Subject: Re: [PATCH] Added information about inline assembler in stack calculations (.su files)
Date: Fri, 14 Dec 2018 00:31:00 -0000	[thread overview]
Message-ID: <b89ffc2b-70b3-3889-9a9c-9d439d4d470a@redhat.com> (raw)
In-Reply-To: <20181207233525.GF3803@gate.crashing.org>

On 12/7/18 4:35 PM, Segher Boessenkool wrote:
> 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 ;-)
What I'm questioning is whether or not this is at all useful.  ie, if
I've written a something like task switching in C+asms, then I would
fully expect any  data related to stack usage in that function to be
totally bogus.  Telling me it's bogus in the assembly output really
isn't of value.  It's telling me something I should clearly already know.

And in the common case of an asm that doesn't mess with the stack at
all, the stack usage info is valid and warning me that it may not be is
just a huge annoyance.

jeff

  reply	other threads:[~2018-12-14  0:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-26 14:03 Torbjorn SVENSSON
2018-11-27 19:03 ` Segher Boessenkool
2018-11-27 19:46   ` Torbjorn SVENSSON
2018-12-07 23:28     ` Segher Boessenkool
2018-12-01  0:16 ` Jeff Law
2018-12-07  7:51   ` Niklas DAHLQUIST
2018-12-08 12:05     ` Segher Boessenkool
2018-12-14  0:31       ` Jeff Law [this message]
2018-12-14  8:58         ` Segher Boessenkool

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b89ffc2b-70b3-3889-9a9c-9d439d4d470a@redhat.com \
    --to=law@redhat.com \
    --cc=Joey.Ye@arm.com \
    --cc=christophe.lyon@st.com \
    --cc=christophe.monat@st.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=niklas.dahlquist@st.com \
    --cc=samuel.hultgren@st.com \
    --cc=segher@kernel.crashing.org \
    --cc=torbjorn.svensson@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).