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/102586] [12 Regression] ICE in clear_padding_type, at gimple-fold.c:4798 since r12-3433-ga25e0b5e6ac8a77a Date: Mon, 14 Mar 2022 09:49:34 +0000 [thread overview] Message-ID: <bug-102586-4-XOjafdGxXG@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-102586-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102586 --- Comment #29 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:c879b92c30d088ff01eb0c3e912eb8a01f9fc6e3 commit r12-7641-gc879b92c30d088ff01eb0c3e912eb8a01f9fc6e3 Author: Jakub Jelinek <jakub@redhat.com> Date: Mon Mar 14 10:47:38 2022 +0100 c++: Reject __builtin_clear_padding on non-trivially-copyable types with one exception [PR102586] As mentioned by Jason in the PR, non-trivially-copyable types (or non-POD for purposes of layout?) types can be base classes of derived classes in which the padding in those non-trivially-copyable types can be reused for some real data members or even the layout can change and data members can be moved to other positions. __builtin_clear_padding is right now used for multiple purposes, in <atomic> where it isn't used yet but was planned as the main spot it can be used for trivially copyable types only, ditto for std::bit_cast where we also use it. It is used for OpenMP long double atomics too but long double is trivially copyable, and lastly for -ftrivial-auto-var-init=. The following patch restricts the builtin to pointers to trivially-copyable types, with the exception when it is called directly on an address of a variable, in that case already the FE can verify it is the complete object type and so it is safe to clear all the paddings in it. 2022-03-14 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/102586 gcc/ * doc/extend.texi (__builtin_clear_padding): Clearify that for C++ argument type should be pointer to trivially-copyable type unless it is address of a variable or parameter. gcc/cp/ * call.cc (build_cxx_call): Diagnose __builtin_clear_padding where first argument's type is pointer to non-trivially-copyable type unless it is address of a variable or parameter. gcc/testsuite/ * g++.dg/cpp2a/builtin-clear-padding1.C: New test.
next prev parent reply other threads:[~2022-03-14 9:49 UTC|newest] Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-10-04 7:30 [Bug tree-optimization/102586] New: " marxin at gcc dot gnu.org 2021-10-04 7:30 ` [Bug tree-optimization/102586] " marxin at gcc dot gnu.org 2021-10-04 8:21 ` jakub at gcc dot gnu.org 2021-10-04 8:22 ` marxin at gcc dot gnu.org 2021-10-04 11:43 ` jakub at gcc dot gnu.org 2021-10-04 12:04 ` jakub at gcc dot gnu.org 2021-11-15 13:03 ` jakub at gcc dot gnu.org 2021-11-15 13:05 ` jakub at gcc dot gnu.org 2022-01-17 13:14 ` rguenth at gcc dot gnu.org 2022-02-09 17:21 ` jason at gcc dot gnu.org 2022-02-10 14:08 ` jakub at gcc dot gnu.org 2022-02-10 14:18 ` jakub at gcc dot gnu.org 2022-02-10 15:29 ` jakub at gcc dot gnu.org 2022-02-10 15:35 ` jakub at gcc dot gnu.org 2022-02-10 15:56 ` jason at gcc dot gnu.org 2022-02-10 18:30 ` jakub at gcc dot gnu.org 2022-02-10 18:45 ` jason at gcc dot gnu.org 2022-02-10 19:27 ` jakub at gcc dot gnu.org 2022-02-10 22:07 ` jason at gcc dot gnu.org 2022-02-10 22:27 ` jakub at gcc dot gnu.org 2022-02-10 22:29 ` jakub at gcc dot gnu.org 2022-02-10 22:34 ` jakub at gcc dot gnu.org 2022-02-11 1:47 ` rodgertq at gcc dot gnu.org 2022-02-11 12:31 ` jakub at gcc dot gnu.org 2022-02-11 15:29 ` jason at gcc dot gnu.org 2022-02-11 16:23 ` qing.zhao at oracle dot com 2022-02-11 16:39 ` jakub at gcc dot gnu.org 2022-02-11 17:36 ` qinzhao at gcc dot gnu.org 2022-02-11 17:47 ` jakub at gcc dot gnu.org 2022-02-11 21:52 ` qing.zhao at oracle dot com 2022-03-12 4:40 ` jason at gcc dot gnu.org 2022-03-14 9:49 ` cvs-commit at gcc dot gnu.org [this message] 2022-04-07 7:15 ` cvs-commit at gcc dot gnu.org 2022-04-07 7:19 ` jakub 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-102586-4-XOjafdGxXG@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).