public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/95237] LOCAL_DECL_ALIGNMENT shrinks alignment, FAIL gcc.target/i386/pr69454-2.c Date: Tue, 02 Jun 2020 12:00:28 +0000 [thread overview] Message-ID: <bug-95237-4-mrwuLGn6G1@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-95237-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95237 --- Comment #9 from rguenther at suse dot de <rguenther at suse dot de> --- On Tue, 2 Jun 2020, hjl.tools at gmail dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95237 > > --- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> --- > (In reply to Kito Cheng from comment #6) > > Created attachment 48658 [details] > > i386-Implement-ROUND_TYPE_ALIGN-to-make-sure-alignme.patch > > > > Some optimization might made decision depend on the alignment, and alignment > > shrinking might made the decision become wrong. > > Nothing will happen on i386 if alignment of long long isn't 8 bytes. GIMPLE passes see DECL_ALIGN and can for example elide runtime checks like if(_Alignof(var) != 8) which is bogus when the actual alignment is not ensured. For this reason we cannot permit a larger aligment early and resort to a lower one later. > > So I prefer keep the assertion checking and implement ROUND_TYPE_ALIGN for > > x86, so that it will set the alignment properly from the beginning. > > > > PoC/untested patch attached. > > The i386 psABI specifies 4 byte alignment for long long. But we want to > use 8 byte alignment if there is no ABI implication and no stack realignment > is needed. Will ROUND_TYPE_ALIGN always align long long to 8 bytes? So what we want here is RTL expansion pad out stack slots if they know to be aligned but not adjust DECL_ALIGN. Not sure if there's already a target hook to pad out variables, if not this may be the way to get what you desire here. I guess the actual reason is crossing of cache-lines?
next prev parent reply other threads:[~2020-06-02 12:00 UTC|newest] Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-20 12:58 [Bug target/95237] New: " rguenth at gcc dot gnu.org 2020-05-20 15:34 ` [Bug target/95237] " hjl.tools at gmail dot com 2020-05-28 7:36 ` rguenth at gcc dot gnu.org 2020-06-01 8:38 ` ubizjak at gmail dot com 2020-06-01 20:47 ` skpgkp2 at gmail dot com 2020-06-01 21:24 ` hjl.tools at gmail dot com 2020-06-02 3:31 ` kito at gcc dot gnu.org 2020-06-02 7:53 ` rguenth at gcc dot gnu.org 2020-06-02 11:06 ` hjl.tools at gmail dot com 2020-06-02 12:00 ` rguenther at suse dot de [this message] 2020-06-02 12:55 ` hjl.tools at gmail dot com 2020-06-02 13:07 ` rguenther at suse dot de 2020-06-02 13:18 ` hjl.tools at gmail dot com 2020-06-02 13:35 ` rguenther at suse dot de 2020-06-02 16:55 ` skpgkp2 at gmail dot com 2020-06-02 17:52 ` rguenther at suse dot de 2020-06-11 17:09 ` jakub at gcc dot gnu.org 2020-06-19 17:40 ` skpgkp2 at gmail dot com 2020-06-20 0:36 ` skpgkp2 at gmail dot com 2020-06-26 13:47 ` jakub at gcc dot gnu.org 2020-07-20 13:05 ` dcb314 at hotmail dot com 2020-07-21 23:30 ` cvs-commit at gcc dot gnu.org 2020-07-21 23:30 ` hjl.tools at gmail dot com 2020-07-22 6:34 ` skpgkp2 at gmail dot com 2020-07-22 14:41 ` cvs-commit at gcc dot gnu.org 2020-07-24 21:19 ` cvs-commit at gcc dot gnu.org 2020-07-24 21:20 ` hjl.tools at gmail dot com
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-95237-4-mrwuLGn6G1@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).