From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 3/4] ssa: avoid SSA conversion of packed bitfields
Date: Wed, 10 Mar 2021 00:42:31 +0100 [thread overview]
Message-ID: <20210309234232.50889-4-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20210309234232.50889-1-luc.vanoostenryck@gmail.com>
Packed bitfields are incompatible with the SSA conversion
which works on the assumption that memory operations are done
on the whole symbol.
So, directly exclude packed bitfields from the SSA conversion.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
ssa.c | 3 +++
validation/mem2reg/packed-bitfield.c | 1 -
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/ssa.c b/ssa.c
index 3f4fa1a831df..26d46baaa16c 100644
--- a/ssa.c
+++ b/ssa.c
@@ -32,6 +32,9 @@ static inline bool is_promotable(struct symbol *type)
case SYM_STRUCT:
// we allow a single scalar field
// but a run of bitfields count for 1
+ // (and packed bifields are excluded).
+ if (type->packed)
+ return 0;
nbr = 0;
bf_seen = 0;
FOR_EACH_PTR(type->symbol_list, member) {
diff --git a/validation/mem2reg/packed-bitfield.c b/validation/mem2reg/packed-bitfield.c
index 4eaf0befeaf5..f3ee259a62b8 100644
--- a/validation/mem2reg/packed-bitfield.c
+++ b/validation/mem2reg/packed-bitfield.c
@@ -12,7 +12,6 @@ static void foo(struct s s)
/*
* check-name: packed-bitfield
* check-command: test-linearize -fmem2reg $file
- * check-known-to-fail
*
* check-output-contains: store.32
* check-output-contains: load.16
--
2.30.0
next prev parent reply other threads:[~2021-03-09 23:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-09 23:42 [PATCH 0/4] fix SSA conversion of mismatched memops Luc Van Oostenryck
2021-03-09 23:42 ` [PATCH 1/4] ssa: add some testcases for " Luc Van Oostenryck
2021-03-09 23:42 ` [PATCH 2/4] ssa: the sparse set is not needed Luc Van Oostenryck
2021-03-09 23:42 ` Luc Van Oostenryck [this message]
2021-03-09 23:42 ` [PATCH 4/4] ssa: fix conversion with mismatched size or offset Luc Van Oostenryck
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=20210309234232.50889-4-luc.vanoostenryck@gmail.com \
--to=luc.vanoostenryck@gmail.com \
--cc=linux-sparse@vger.kernel.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 NNTP newsgroup(s).