diff options
author | Jakub Jelinek <jakub@redhat.com> | 2023-02-09 16:07:40 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2023-02-09 16:07:40 +0100 |
commit | bcca64d70ce91e29717fb70cff252639df6902be (patch) | |
tree | 46f7de247dc146a15ec4949b9a00bd5c26f1a49b /gcc/fortran/intrinsic.cc | |
parent | 44f308e59bfa0f93ae05b17e257d8563c12399fd (diff) | |
download | gcc-bcca64d70ce91e29717fb70cff252639df6902be.zip gcc-bcca64d70ce91e29717fb70cff252639df6902be.tar.gz gcc-bcca64d70ce91e29717fb70cff252639df6902be.tar.bz2 |
match.pd: Simplify BFR of insert when extracting exactly all inserted bits [PR108688]
On Thu, Feb 09, 2023 at 09:16:17AM +0100, Richard Biener via Gcc-patches wrote:
> Hmm. Can we handle the case of the extraction exactly covering the
> insertion separately then and simplify to plain @1?
I was suggesting that in the PR. Here it is as an incremental patch
on top of Andrew's patch.
On the newly added testcase the ifcvt-folding difference without/with the
incremental patch is:
--- pr108688.c.171t.ifcvt_ 2023-02-09 10:47:30.169916845 +0100
+++ pr108688.c.171t.ifcvt 2023-02-09 10:48:44.942793453 +0100
@@ -25,6 +25,8 @@ Number of blocks in CFG: 11
Number of blocks to update: 5 ( 45%)
+Applying pattern match.pd:7487, gimple-match.cc:243200
+Applying pattern match.pd:3987, gimple-match.cc:75423
Matching expression match.pd:1677, gimple-match.cc:209
Applying pattern match.pd:1733, gimple-match.cc:109481
Matching expression match.pd:2393, gimple-match.cc:852
@@ -70,7 +72,6 @@ void foo ()
signed char _29;
<unnamed-signed:7> _30;
unsigned int ivtmp_33;
- <unnamed-signed:7> _ifc__35;
unsigned char _ifc__37;
unsigned char _ifc__38;
unsigned char _ifc__39;
@@ -91,8 +92,7 @@ void foo ()
_2 = (<unnamed-signed:7>) a.0_1;
_ifc__38 = u.D.2741;
_ifc__39 = BIT_INSERT_EXPR <_ifc__38, _2, 0 (7 bits)>;
- _ifc__35 = BIT_FIELD_REF <_ifc__39, 7, 0>;
- _4 = (signed char) _ifc__35;
+ _4 = (signed char) _2;
b.1_5 = b;
_6 = (signed char) b.1_5;
_7 = _4 ^ _6;
2023-02-09 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/108688
* match.pd (bit_field_ref [bit_insert]): Simplify BIT_FIELD_REF
of BIT_INSERT_EXPR extracting exactly all inserted bits even
when without mode precision. Formatting fixes.
* gcc.c-torture/compile/pr108688-1.c: Add PR number as comment.
* gcc.dg/pr108688.c: New test.
Diffstat (limited to 'gcc/fortran/intrinsic.cc')
0 files changed, 0 insertions, 0 deletions