From: Richard Biener <rguenther@suse.de>
To: Bernd Edlinger <bernd.edlinger@hotmail.de>
Cc: Eric Botcazou <ebotcazou@adacore.com>,
"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
Jeff Law <law@redhat.com>, Jakub Jelinek <jakub@redhat.com>
Subject: Re: [PATCH] Increase alignment for bit-field access when predictive commoning (PR 71083)
Date: Fri, 12 Aug 2016 07:13:00 -0000 [thread overview]
Message-ID: <alpine.LSU.2.11.1608120913350.26629@t29.fhfr.qr> (raw)
In-Reply-To: <AM4PR0701MB2162B4ACAA12902897CAFB48E41E0@AM4PR0701MB2162.eurprd07.prod.outlook.com>
On Thu, 11 Aug 2016, Bernd Edlinger wrote:
> On 08/11/16 09:07, Richard Biener wrote:
> > The patch looks mostly ok, but
> >
> > + else
> > + {
> > + boff >>= LOG2_BITS_PER_UNIT;
> > + boff += tree_to_uhwi (component_ref_field_offset (ref));
> > + coff = size_binop (MINUS_EXPR, coff, ssize_int (boff));
> >
> > how can we be sure that component_ref_field_offset is an INTEGER_CST?
> > At least Ada can have variably-length fields before a bitfield. We'd
> > need to apply component_ref_field_offset to off in that case. Which
> > makes me wonder if we can simply avoid the COMPONENT_REF path in
> > a first iteration of the patch and always build a BIT_FIELD_REF?
> > It should solve the correctness issues as well and be more applicable
> > for branches.
> >
>
> I believe that it will be necessary to check for tree_fits_uhwi_p here,
> but while it happens quite often hat a normal COMPONENT_REF has a
> variable offset, it happens rarely that a bit-field COMPONENT_REF has a
> variable offset: In the whole Ada test suite it was only on the pack16
> test case. However I was not able to use that trick in the
> loop_optimization23 test case. When I tried, it did no longer get
> optimized by pcom. So there will be no new test case at this time.
>
> Therefore I left the comment as-is, because it is not clear, if a
> variable offset will ever happen here; but if it happens, it will be
> in Ada, and it will be safe to create a BIT_FIELD_REF instead.
>
> So this is the follow-up patch that tries to create a more aligned
> access using the COMPONENT_REF.
>
>
> Boot-strap and reg-test on x86_64-pc-linux-gnu.
> Is it OK for trunk?
Ok.
Thanks,
Richard.
prev parent reply other threads:[~2016-08-12 7:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-08 19:57 [PATCH] Fix unaligned " Bernd Edlinger
2016-08-09 7:29 ` Richard Biener
2016-08-09 17:31 ` Bernd Edlinger
2016-08-09 20:48 ` Eric Botcazou
2016-08-09 22:23 ` Bernd Edlinger
2016-08-10 8:47 ` AW: " Bernd Edlinger
2016-08-10 12:19 ` Eric Botcazou
2016-08-10 12:29 ` Richard Biener
2016-08-10 16:24 ` Bernd Edlinger
2016-08-11 7:07 ` Richard Biener
2016-08-11 10:09 ` Bernd Edlinger
2016-08-11 10:30 ` Richard Biener
2016-08-11 19:47 ` [PATCH] Increase alignment for bit-field " Bernd Edlinger
2016-08-12 7:13 ` Richard Biener [this message]
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=alpine.LSU.2.11.1608120913350.26629@t29.fhfr.qr \
--to=rguenther@suse.de \
--cc=bernd.edlinger@hotmail.de \
--cc=ebotcazou@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=law@redhat.com \
/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).