qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Peter Maydell" <peter.maydell@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: Fabiano Rosas <farosas@suse.de>,
	qemu-devel@nongnu.org, qemu-arm@nongnu.org
Subject: Re: [PATCH] target/arm: gdbstub: Guard M-profile code with CONFIG_TCG
Date: Wed, 5 Jul 2023 16:32:15 +0200	[thread overview]
Message-ID: <837e45df-08c9-44c9-b4c7-489251901860@linaro.org> (raw)
In-Reply-To: <CAFEAcA9QSS7qs2kcCuyrDrRc6tb_0euMD3vFJ=_Q8s8dJYBRfw@mail.gmail.com>

On 7/4/23 17:44, Peter Maydell wrote:
>> IIUC tcg_enabled(), this guard shouldn't be necessary; if CONFIG_TCG
>> is not defined, tcg_enabled() evaluates to 0, and the compiler should
>> elide the whole block.
> 
> IME it's a bit optimistic to assume that the compiler will always
> do that, especially with no optimisation enabled.

There's plenty of other places that we do.
The compiler is usually pretty good with "if (0)".

My question is if

>       if (arm_feature(env, ARM_FEATURE_M) && tcg_enabled()) { 

needs to be written

     if (tcg_enabled()) {
         if (arm_feature(..., M) {
            ...
         }
     }


r~


  parent reply	other threads:[~2023-07-05 14:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-28 16:48 [PATCH] target/arm: gdbstub: Guard M-profile code with CONFIG_TCG Fabiano Rosas
2023-06-28 20:09 ` Philippe Mathieu-Daudé
2023-06-28 21:51   ` Fabiano Rosas
2023-06-28 22:01     ` Fabiano Rosas
2023-07-04 13:15 ` Peter Maydell
2023-07-04 15:21 ` Philippe Mathieu-Daudé
2023-07-04 15:44   ` Peter Maydell
2023-07-04 15:55     ` Philippe Mathieu-Daudé
2023-07-05 14:32     ` Richard Henderson [this message]
2023-07-05 20:38       ` Fabiano Rosas

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=837e45df-08c9-44c9-b4c7-489251901860@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=farosas@suse.de \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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 NNTP newsgroup(s).