public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/102633] [11/12/13 Regression] warning for self-initialization despite -Wno-init-self Date: Tue, 26 Jul 2022 14:09:48 +0000 [thread overview] Message-ID: <bug-102633-4-3dS5brF0oq@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-102633-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102633 Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mpolacek at gcc dot gnu.org --- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> --- The problem is that since the patch above, we create a NOP_EXPR: 2172 if (convert_p && !error_operand_p (exp.value) 2173 && (TREE_CODE (TREE_TYPE (exp.value)) != ARRAY_TYPE)) 2174 exp.value = convert (build_qualified_type (TREE_TYPE (exp.value), TYPE_UNQUALIFIED), exp.value); so the DECL_INITIAL is '(int) i' and not 'i' anymore. Then we don't suppress_warning here: 711 case DECL_EXPR: 712 /* This is handled mostly by gimplify.cc, but we have to deal with 713 not warning about int x = x; as it is a GCC extension to turn off 714 this warning but only if warn_init_self is zero. */ 715 if (VAR_P (DECL_EXPR_DECL (*expr_p)) 716 && !DECL_EXTERNAL (DECL_EXPR_DECL (*expr_p)) 717 && !TREE_STATIC (DECL_EXPR_DECL (*expr_p)) 718 && (DECL_INITIAL (DECL_EXPR_DECL (*expr_p)) == DECL_EXPR_DECL (*expr_p)) 719 && !warn_init_self) 720 suppress_warning (DECL_EXPR_DECL (*expr_p), OPT_Winit_self); because of the check on line 718.
next prev parent reply other threads:[~2022-07-26 14:09 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-10-06 21:40 [Bug middle-end/102633] New: " msebor at gcc dot gnu.org 2021-10-06 21:42 ` [Bug middle-end/102633] [11/12 Regression] " msebor at gcc dot gnu.org 2021-10-06 21:47 ` msebor at gcc dot gnu.org 2021-10-07 9:02 ` rguenth at gcc dot gnu.org 2022-04-21 7:50 ` rguenth at gcc dot gnu.org 2022-07-26 13:25 ` [Bug middle-end/102633] [11/12/13 " rguenth at gcc dot gnu.org 2022-07-26 14:09 ` mpolacek at gcc dot gnu.org [this message] 2022-07-26 14:28 ` mpolacek at gcc dot gnu.org 2022-07-27 6:11 ` muecker at gwdg dot de 2022-08-11 14:29 ` cvs-commit at gcc dot gnu.org 2022-08-11 14:30 ` [Bug middle-end/102633] [11/12 " mpolacek at gcc dot gnu.org 2023-02-10 15:16 ` mpolacek at gcc dot gnu.org 2023-02-10 17:47 ` cvs-commit at gcc dot gnu.org 2023-02-10 17:55 ` jakub at gcc dot gnu.org 2023-02-22 16:10 ` [Bug middle-end/102633] [11 " mpolacek 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-102633-4-3dS5brF0oq@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: linkBe 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).