public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/103899] [12 Regression] make profiledbootstrap fails due to uninitialized warning in expr.c
Date: Thu, 06 Jan 2022 14:33:36 +0000	[thread overview]
Message-ID: <bug-103899-4-s2QsDIMJe5@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103899-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:db33b1059bcee3eeb36d174d59abf19f2bef5d66

commit r12-6280-gdb33b1059bcee3eeb36d174d59abf19f2bef5d66
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Jan 6 15:32:57 2022 +0100

    expr: Workaround profiledbootstrap uninit false positive [PR103899]

    The threader changes resulted in a false positive warning during
    profiledbootstrap:
    In file included from ../../gcc/expr.c:26:
    ../../gcc/tree.h: In function ârtx_def* expand_expr_real_1(tree, rtx,
machine_mode, expand_modifier, rtx_def**, bool)â:
    ../../gcc/tree.h:244:56: error: âcontextâ may be used uninitialized in
this function [-Werror=maybe-uninitialized]
      244 | #define TREE_CODE(NODE) ((enum tree_code) (NODE)->base.code)
          |                                                        ^~~~
    ../../gcc/expr.c:10343:8: note: âcontextâ was declared here
    10343 |   tree context;
          |        ^~~~~~~
    While it will be nice to improve the uninit pass to handle it if possible
    (I do not want to close the PR until that is done), doing profiledbootstrap
    is a common thing to do, so a workaround is handy, especially as in this
    case when the workaround seems to be the right thing to do, as it moves
    a variable declaration to the only place where it is set and used and
avoids
    the weird and for uninit asking
      tree context;
    ...
      if (exp)
        context = ...;
      gcc_assert (!exp
                  || use (context)
                  || use_some_more (context));

    2022-01-06  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/103899
            * expr.c (expand_expr_real_1): Add a workaround for bogus uninit
            warning by moving context variable to the only spot where it is
used
            and moving gcc_assert into if body.

  parent reply	other threads:[~2022-01-06 14:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04  5:50 [Bug bootstrap/103899] New: " pinskia at gcc dot gnu.org
2022-01-04  6:01 ` [Bug bootstrap/103899] " pinskia at gcc dot gnu.org
2022-01-04  6:05 ` pinskia at gcc dot gnu.org
2022-01-04  6:44 ` pinskia at gcc dot gnu.org
2022-01-05  8:17 ` [Bug tree-optimization/103899] [12 Regression] " pinskia at gcc dot gnu.org
2022-01-05  8:25 ` marxin at gcc dot gnu.org
2022-01-05 13:55 ` jakub at gcc dot gnu.org
2022-01-05 14:06 ` jakub at gcc dot gnu.org
2022-01-05 21:28 ` pinskia at gcc dot gnu.org
2022-01-06 14:33 ` cvs-commit at gcc dot gnu.org [this message]
2022-01-06 14:46 ` jakub at gcc dot gnu.org
2022-01-18 13:56 ` rguenth 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-103899-4-s2QsDIMJe5@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).