public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Martin Sebor <msebor@gmail.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] -Walloca-larger-than with constant sizes at -O0 (PR 100425)
Date: Wed, 5 May 2021 09:32:59 +0200	[thread overview]
Message-ID: <CAFiYyc25ixCa0mEv5ZwyC-LpR-0Kkx+KJ3MqCR4xna-X6x7pOQ@mail.gmail.com> (raw)
In-Reply-To: <73469b28-307f-d2ad-6ac8-3502f6c12ba7@gmail.com>

On Wed, May 5, 2021 at 4:20 AM Martin Sebor via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Even when explicitly enabled, -Walloca-larger-than doesn't run
> unless optimization is enabled as well.  This prevents diagnosing
> alloca calls with constant arguments in excess of the limit that
> could otherwise be flagged even at -O0, making the warning less
> consistent and less useful than is possible.
>
> The attached patch enables -Walloca-larger-than for calls with
> constant arguments in excess of the limit even at -O0 (variable
> arguments are only handled with optimization, when VRP runs).

Hmm, but then the pass runs even without -Walloca or -Walloca-larger-than
or -Wvla[-larger-than].  It performs an IL walk we should avoid in those
cases.

So the patch is OK but can you please come up with a gate that disables
the pass when all of the warnings it handles won't fire anyway?

Thanks,
Richard.

> Martin

  reply	other threads:[~2021-05-05  7:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05  1:32 Martin Sebor
2021-05-05  7:32 ` Richard Biener [this message]
2021-05-05 17:29   ` Martin Sebor
2021-05-06  7:02     ` Richard Biener

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=CAFiYyc25ixCa0mEv5ZwyC-LpR-0Kkx+KJ3MqCR4xna-X6x7pOQ@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=msebor@gmail.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).