aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2020-01-09 11:59:41 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2020-01-09 04:59:41 -0700
commit2b5d3dc22c321e1c8928735c47733806a1163827 (patch)
tree68f2fb21ea9fe277bee0ee7ad514cb539661b535 /gcc/builtins.c
parentfdfd7f53ba8f363c31a1cbb5310f92ecfc52cbfe (diff)
downloadgcc-2b5d3dc22c321e1c8928735c47733806a1163827.zip
gcc-2b5d3dc22c321e1c8928735c47733806a1163827.tar.gz
gcc-2b5d3dc22c321e1c8928735c47733806a1163827.tar.bz2
PR middle-end/93200 - spurious -Wstringop-overflow due to assignment vectorization to multiple members
PR middle-end/93200 - spurious -Wstringop-overflow due to assignment vectorization to multiple members PR fortran/92956 - 'libgomp.fortran/examples-4/async_target-2.f90' fails with offloading due to bogus -Wstringop-overflow warning gcc/testsuite/ChangeLog: PR middle-end/93200 * gcc.dg/Wstringop-overflow-30.c: New test. gcc/ChangeLog: PR middle-end/93200 PR fortran/92956 * builtins.c (compute_objsize): Avoid handling MEM_REFs of vector type. From-SVN: r280041
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 1f70298..e4a8694 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -3966,6 +3966,18 @@ compute_objsize (tree dest, int ostype, tree *pdecl /* = NULL */,
|| TREE_CODE (dest) == MEM_REF)
{
tree ref = TREE_OPERAND (dest, 0);
+ tree reftype = TREE_TYPE (ref);
+ if (TREE_CODE (dest) == MEM_REF && TREE_CODE (reftype) == POINTER_TYPE)
+ {
+ /* Give up for MEM_REFs of vector types; those may be synthesized
+ from multiple assignments to consecutive data members. See PR
+ 93200.
+ FIXME: Deal with this more generally, e.g., by marking up such
+ MEM_REFs at the time they're created. */
+ reftype = TREE_TYPE (reftype);
+ if (TREE_CODE (reftype) == VECTOR_TYPE)
+ return NULL_TREE;
+ }
tree off = TREE_OPERAND (dest, 1);
if (tree size = compute_objsize (ref, ostype, pdecl, poff))
{