public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rsandifo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/102681] [12 Regression] AArch64 bootstrap failure
Date: Thu, 14 Oct 2021 12:25:45 +0000	[thread overview]
Message-ID: <bug-102681-4-llHCUDNDQC@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102681-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102681

rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rsandifo at gcc dot gnu.org

--- Comment #5 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #3)
> Simply initializing the variable as in the patch below avoids the warning. 
> The control flow in the code is sufficiently opaque to make it worthwhile
> from a readability point irrespective of whether or not the variable can, in
> fact, be used uninitialized.
> 
> index e50d3fc3b62..c7f0a405ff6 100644
> --- a/gcc/calls.c
> +++ b/gcc/calls.c
> @@ -199,7 +199,7 @@ stack_region_maybe_used_p (poly_uint64 lower_bound,
> poly_uint64 upper_bound,
>  static void
>  mark_stack_region_used (poly_uint64 lower_bound, poly_uint64 upper_bound)
>  {
> -  unsigned HOST_WIDE_INT const_lower, const_upper;
> +  unsigned HOST_WIDE_INT const_lower, const_upper = 0;
>    const_lower = constant_lower_bound (lower_bound);
>    if (upper_bound.is_constant (&const_upper))
>      for (unsigned HOST_WIDE_INT i = const_lower; i < const_upper; ++i)
I disagree that this is better for readability.  Initialising to zero
implies that the zero can reach code dominated by is_constant returning
true.  In other words, it implies that the zero might be used and that
initialising to a different value would give different behaviour,
which in turn raises the question why 0 is the right choice.

The control flow for is_constant is just:

  if (is_constant ())
    {
      *const_value = this->coeffs[0];
      return true;
    }
  return false;

where it is clear that const_value is assigned to iff the
function returns true.  If we can't handle this kind of
construct then I think we should try to punt on it.

It doesn't seem all that different from what would happen
for std::optional<std::array<int, 2>> after SRA, where AIUI
the second array element would be uninitialised if
_M_engaged is false.

  parent reply	other threads:[~2021-10-14 12:25 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-11  5:58 [Bug tree-optimization/102681] New: " fxue at os dot amperecomputing.com
2021-10-11  6:34 ` [Bug tree-optimization/102681] " aldyh at gcc dot gnu.org
2021-10-11  8:07 ` tnfchris at gcc dot gnu.org
2021-10-11  9:09 ` [Bug bootstrap/102681] [12 Regression] " rguenth at gcc dot gnu.org
2021-10-11 16:35 ` msebor at gcc dot gnu.org
2021-10-14  7:00 ` fxue at os dot amperecomputing.com
2021-10-14 12:25 ` rsandifo at gcc dot gnu.org [this message]
2021-10-16 20:03 ` pinskia at gcc dot gnu.org
2021-10-21  9:22 ` pinskia at gcc dot gnu.org
2021-10-21 18:21 ` pinskia at gcc dot gnu.org
2021-10-21 18:43 ` pinskia at gcc dot gnu.org
2021-10-21 18:58 ` pinskia at gcc dot gnu.org
2021-10-21 19:52 ` pinskia at gcc dot gnu.org
2021-10-21 22:23 ` pinskia at gcc dot gnu.org
2021-10-21 22:35 ` pinskia at gcc dot gnu.org
2021-10-21 23:21 ` pinskia at gcc dot gnu.org
2021-10-22  5:42 ` pinskia at gcc dot gnu.org
2021-10-22  5:47 ` pinskia at gcc dot gnu.org
2021-10-22  6:12 ` tnfchris at gcc dot gnu.org
2021-10-22  7:21 ` aldyh at gcc dot gnu.org
2021-10-22  7:30 ` aldyh at gcc dot gnu.org
2021-10-22  7:47 ` aldyh at gcc dot gnu.org
2021-10-22  8:32 ` rguenth at gcc dot gnu.org
2021-10-22  9:41 ` cvs-commit at gcc dot gnu.org
2021-10-22  9:42 ` rguenth at gcc dot gnu.org
2021-10-22 11:21 ` rsandifo at gcc dot gnu.org

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=bug-102681-4-llHCUDNDQC@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).