From: Richard Biener <rguenther@suse.de>
To: "Andre Vieira (lists)" <andre.simoesdiasvieira@arm.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] ifcvt: Don't lower bitfields with non-constant offsets [PR 111882]
Date: Fri, 20 Oct 2023 13:41:51 +0000 (UTC) [thread overview]
Message-ID: <nycvar.YFH.7.77.849.2310201339480.5106@jbgna.fhfr.qr> (raw)
In-Reply-To: <29e81713-e0a7-47da-bb4b-01b6629962c1@arm.com>
On Fri, 20 Oct 2023, Andre Vieira (lists) wrote:
> Hi,
>
> This patch stops lowering of bitfields by ifcvt when they have non-constant
> offsets as we are not likely to be able to do anything useful with those
> during
> vectorization. That also fixes the issue reported in PR 111882, which was
> being caused by an offset with a side-effect being lowered, but constants have
> no side-effects so we will no longer run into that problem.
>
> Bootstrapped and regression tested on aarch64-unknown-linux-gnu.
>
> OK for trunk?
+ if (!TREE_CONSTANT (DECL_FIELD_OFFSET (rep_decl))
+ || !TREE_CONSTANT (DECL_FIELD_BIT_OFFSET (rep_decl))
+ || !TREE_CONSTANT (ref_offset)
+ || !TREE_CONSTANT (DECL_FIELD_BIT_OFFSET (field_decl)))
+ return NULL_TREE;
DECL_FIELD_BIT_OFFSET is always constant. Please test
TREE_CODE (..) == INTEGER_CST instead of TREE_CONSTANT.
OK with those changes.
Richard.
> gcc/ChangeLog:
>
> PR tree-optimization/111882
> * tree-if-conv.cc (get_bitfield_rep): Return NULL_TREE for bitfields
> with
> non-constant offsets.
>
> gcc/testsuite/ChangeLog:
>
> * gcc.dg/vect/pr111882.c: New test.
>
--
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)
next prev parent reply other threads:[~2023-10-20 13:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-20 13:38 Andre Vieira (lists)
2023-10-20 13:41 ` Richard Biener [this message]
2023-10-20 13:46 ` Andre Vieira (lists)
2023-10-20 15:22 ` Richard Biener
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=nycvar.YFH.7.77.849.2310201339480.5106@jbgna.fhfr.qr \
--to=rguenther@suse.de \
--cc=andre.simoesdiasvieira@arm.com \
--cc=gcc-patches@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).