public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6551] c/104002 - shufflevector variable indexing
@ 2022-01-13 15:07 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2022-01-13 15:07 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:f45a2232bc8d6b88f52859cac502611395f3caf5
commit r12-6551-gf45a2232bc8d6b88f52859cac502611395f3caf5
Author: Richard Biener <rguenther@suse.de>
Date: Thu Jan 13 11:55:14 2022 +0100
c/104002 - shufflevector variable indexing
Variable indexing of a __builtin_shufflevector result is broken because
we fail to properly mark the TARGET_EXPR decl as addressable.
2022-01-13 Richard Biener <rguenther@suse.de>
PR c/104002
gcc/c-family/
* c-common.c (c_common_mark_addressable_vec): Handle TARGET_EXPR.
gcc/testsuite/
* c-c++-common/builtin-shufflevector-3.c: Move ...
* c-c++-common/torture/builtin-shufflevector-3.c: ... here.
Diff:
---
gcc/c-family/c-common.c | 5 ++++-
gcc/testsuite/c-c++-common/{ => torture}/builtin-shufflevector-3.c | 0
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 4a6a4edb763..a34f32f51a4 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -6989,12 +6989,15 @@ c_common_mark_addressable_vec (tree t)
}
if (!VAR_P (t)
&& TREE_CODE (t) != PARM_DECL
- && TREE_CODE (t) != COMPOUND_LITERAL_EXPR)
+ && TREE_CODE (t) != COMPOUND_LITERAL_EXPR
+ && TREE_CODE (t) != TARGET_EXPR)
return;
if (!VAR_P (t) || !DECL_HARD_REGISTER (t))
TREE_ADDRESSABLE (t) = 1;
if (TREE_CODE (t) == COMPOUND_LITERAL_EXPR)
TREE_ADDRESSABLE (COMPOUND_LITERAL_EXPR_DECL (t)) = 1;
+ else if (TREE_CODE (t) == TARGET_EXPR)
+ TREE_ADDRESSABLE (TARGET_EXPR_SLOT (t)) = 1;
}
diff --git a/gcc/testsuite/c-c++-common/builtin-shufflevector-3.c b/gcc/testsuite/c-c++-common/torture/builtin-shufflevector-3.c
similarity index 100%
rename from gcc/testsuite/c-c++-common/builtin-shufflevector-3.c
rename to gcc/testsuite/c-c++-common/torture/builtin-shufflevector-3.c
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-01-13 15:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-13 15:07 [gcc r12-6551] c/104002 - shufflevector variable indexing Richard Biener
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).