public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members
@ 2020-09-07 20:46 gcc_bugzilla at venus dot thegavinli.com
2020-09-07 23:15 ` [Bug tree-optimization/96963] " msebor at gcc dot gnu.org
` (18 more replies)
0 siblings, 19 replies; 20+ messages in thread
From: gcc_bugzilla at venus dot thegavinli.com @ 2020-09-07 20:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
Bug ID: 96963
Summary: -Wstringop-overflow false positive on -O3 or -O2
-ftree-vectorize when assigning consecutive char
struct members
Product: gcc
Version: 10.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: gcc_bugzilla at venus dot thegavinli.com
Target Milestone: ---
Created attachment 49194
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49194&action=edit
Test case that triggers bug
Versions affected: 10.2.0 and git master (commit 703bc188f4)
System type: both x86_64-pc-linux-gnu and arm-none-eabi affected
Compilation flags: I tested a couple compilers with the same result:
1) Arch Linux toolchain, configured with: /build/gcc/src/gcc/configure
--prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl
--with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit
--enable-cet=auto --enable-checking=release --enable-clocale=gnu
--enable-default-pie --enable-default-ssp --enable-gnu-indirect-function
--enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id
--enable-lto --enable-multilib --enable-plugin --enable-shared
--enable-threads=posix --disable-libssp --disable-libstdcxx-pch
--disable-libunwind-exceptions --disable-werror
gdc_include_dir=/usr/include/dlang/gdc
2) Built from git, configured with: ./configure --prefix=/tmp/gcc-master
--disable-multilib
Command lines that trigger bug:
$ gcc sample.c -c -O3
$ gcc sample.c -c -O2 -ftree-vectorize
Code that triggers bug:
struct foo {
int i;
char a;
char b;
};
void heh(char *);
void clr(struct foo *f) {
heh(&f->a);
f->a = 0;
f->b = 0;
}
Output of compiler:
sample.c: In function ‘clr’:
sample.c:11:10: warning: writing 2 bytes into a region of size 1
[-Wstringop-overflow=]
11 | f->a = 0;
| ~~~~~^~~
sample.c:3:10: note: at offset 0 to object ‘a’ with size 1 declared here
3 | char a;
| ^
-fdump-tree-optimized:
;; Function clr (clr, funcdef_no=0, decl_uid=1936, cgraph_uid=1,
symbol_order=0)
clr (struct foo * f)
{
char * _1;
<bb 2> [local count: 1073741824]:
_1 = &f_2(D)->a;
heh (_1);
MEM <vector(2) char> [(char *)f_2(D) + 4B] = { 0, 0 };
return;
}
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug tree-optimization/96963] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members
2020-09-07 20:46 [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members gcc_bugzilla at venus dot thegavinli.com
@ 2020-09-07 23:15 ` msebor at gcc dot gnu.org
2020-09-08 6:45 ` rguenth at gcc dot gnu.org
` (17 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-09-07 23:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Keywords| |diagnostic
Last reconfirmed| |2020-09-07
Ever confirmed|0 |1
Blocks| |88443
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=93200
CC| |msebor at gcc dot gnu.org
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed. The vectorizer replaces the two character assignments with a store
into f->a. The fix for pr93200 added a hack to handle some these cases but not
this one. This instance of the warning is issued from the strlen pass whose
dump shows the cause of the problem:
$ gcc -O3 -S -Wall -fdump-tree-strlen=/dev/stdout pr96963.c
;; Function clr (clr, funcdef_no=0, decl_uid=1937, cgraph_uid=1,
symbol_order=0)
;; 1 loops found
;;
;; Loop 0
;; header 0, latch 1
;; depth 0, outer -1
;; nodes: 0 1 2
;; 2 succs { 1 }
pr96963.c: In function ‘clr’:
pr96963.c:11:14: warning: writing 2 bytes into a region of size 1
[-Wstringop-overflow=]
11 | f->a = 0;
| ~~~~~^~~
pr96963.c:3:14: note: at offset 0 to object ‘a’ with size 1 declared here
3 | char a;
| ^
clr (struct foo * f)
{
vector(2) char * vectp.4;
vector(2) char * vectp_f.3;
char * _1;
<bb 2> [local count: 1073741824]:
_1 = &f_2(D)->a;
heh (_1);
MEM <vector(2) char> [(char *)_1] = { 0, 0 }; <<< _1 points to f_2(D)->a
return;
}
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443
[Bug 88443] [meta-bug] bogus/missing -Wstringop-overflow warnings
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug tree-optimization/96963] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members
2020-09-07 20:46 [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members gcc_bugzilla at venus dot thegavinli.com
2020-09-07 23:15 ` [Bug tree-optimization/96963] " msebor at gcc dot gnu.org
@ 2020-09-08 6:45 ` rguenth at gcc dot gnu.org
2020-09-08 8:18 ` gcc_bugzilla at venus dot thegavinli.com
` (16 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-09-08 6:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
store-merging will also happily store a (short)0 there, but likely runs after
strlen.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug tree-optimization/96963] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members
2020-09-07 20:46 [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members gcc_bugzilla at venus dot thegavinli.com
2020-09-07 23:15 ` [Bug tree-optimization/96963] " msebor at gcc dot gnu.org
2020-09-08 6:45 ` rguenth at gcc dot gnu.org
@ 2020-09-08 8:18 ` gcc_bugzilla at venus dot thegavinli.com
2020-12-06 21:55 ` msebor at gcc dot gnu.org
` (15 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: gcc_bugzilla at venus dot thegavinli.com @ 2020-09-08 8:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
--- Comment #3 from Gavin <gcc_bugzilla at venus dot thegavinli.com> ---
Correct. Due to store-merging, -O2 and -O3 generate the same machine code on
both x86_64 and armv7m.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug tree-optimization/96963] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members
2020-09-07 20:46 [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members gcc_bugzilla at venus dot thegavinli.com
` (2 preceding siblings ...)
2020-09-08 8:18 ` gcc_bugzilla at venus dot thegavinli.com
@ 2020-12-06 21:55 ` msebor at gcc dot gnu.org
2020-12-07 10:40 ` redi at gcc dot gnu.org
` (14 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-12-06 21:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |darklythinking at yahoo dot com
--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
*** Bug 98158 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug tree-optimization/96963] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members
2020-09-07 20:46 [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members gcc_bugzilla at venus dot thegavinli.com
` (3 preceding siblings ...)
2020-12-06 21:55 ` msebor at gcc dot gnu.org
@ 2020-12-07 10:40 ` redi at gcc dot gnu.org
2020-12-07 10:43 ` [Bug tree-optimization/96963] [10/11 Regression] " redi at gcc dot gnu.org
` (13 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: redi at gcc dot gnu.org @ 2020-12-07 10:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Gavin from comment #0)
> 2) Built from git, configured with: ./configure --prefix=/tmp/gcc-master
Nothing to do with the bug, but don't build in the source tree:
https://gcc.gnu.org/wiki/FAQ#configure
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug tree-optimization/96963] [10/11 Regression] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members
2020-09-07 20:46 [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members gcc_bugzilla at venus dot thegavinli.com
` (4 preceding siblings ...)
2020-12-07 10:40 ` redi at gcc dot gnu.org
@ 2020-12-07 10:43 ` redi at gcc dot gnu.org
2020-12-07 12:03 ` jakub at gcc dot gnu.org
` (12 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: redi at gcc dot gnu.org @ 2020-12-07 10:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |10.2.0, 11.0
Known to work| |9.3.0
Target Milestone|--- |10.3
Summary|-Wstringop-overflow false |[10/11 Regression]
|positive on -O3 or -O2 |-Wstringop-overflow false
|-ftree-vectorize when |positive on -O3 or -O2
|assigning consecutive char |-ftree-vectorize when
|struct members |assigning consecutive char
| |struct members
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This produces tons of false positives for correct code that uses std::string
and std::vector, due to the empty std::allocator objects used as default
arguments of constructors.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug tree-optimization/96963] [10/11 Regression] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members
2020-09-07 20:46 [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members gcc_bugzilla at venus dot thegavinli.com
` (5 preceding siblings ...)
2020-12-07 10:43 ` [Bug tree-optimization/96963] [10/11 Regression] " redi at gcc dot gnu.org
@ 2020-12-07 12:03 ` jakub at gcc dot gnu.org
2020-12-07 21:41 ` egallager at gcc dot gnu.org
` (11 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-12-07 12:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The PR93200 "fix" was incorrect, as you should know in GIMPLE most pointer
conversions are useless, so the pointer type of the MEM_REF's first operand is
completely arbitrary.
If you wanted to exclude vector types from the overflow warnings, you should
have punted for MEM_REFs with vector type being TREE_TYPE (memref).
It is still just a hack, because the whole relying on &something->field vs.
something in addresses stands on sand, in GIMPLE those are all just about
address values and nothing else, they don't carry semantic information.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug tree-optimization/96963] [10/11 Regression] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members
2020-09-07 20:46 [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members gcc_bugzilla at venus dot thegavinli.com
` (6 preceding siblings ...)
2020-12-07 12:03 ` jakub at gcc dot gnu.org
@ 2020-12-07 21:41 ` egallager at gcc dot gnu.org
2021-01-14 9:19 ` rguenth at gcc dot gnu.org
` (10 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: egallager at gcc dot gnu.org @ 2020-12-07 21:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |egallager at gcc dot gnu.org
--- Comment #8 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #5)
> (In reply to Gavin from comment #0)
> > 2) Built from git, configured with: ./configure --prefix=/tmp/gcc-master
>
> Nothing to do with the bug, but don't build in the source tree:
> https://gcc.gnu.org/wiki/FAQ#configure
See bug 37210
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug tree-optimization/96963] [10/11 Regression] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members
2020-09-07 20:46 [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members gcc_bugzilla at venus dot thegavinli.com
` (7 preceding siblings ...)
2020-12-07 21:41 ` egallager at gcc dot gnu.org
@ 2021-01-14 9:19 ` rguenth at gcc dot gnu.org
2021-01-21 21:21 ` msebor at gcc dot gnu.org
` (9 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-14 9:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug tree-optimization/96963] [10/11 Regression] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members
2020-09-07 20:46 [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members gcc_bugzilla at venus dot thegavinli.com
` (8 preceding siblings ...)
2021-01-14 9:19 ` rguenth at gcc dot gnu.org
@ 2021-01-21 21:21 ` msebor at gcc dot gnu.org
2021-01-21 23:49 ` msebor at gcc dot gnu.org
` (8 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-01-21 21:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot gnu.org
Status|NEW |ASSIGNED
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug tree-optimization/96963] [10/11 Regression] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members
2020-09-07 20:46 [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members gcc_bugzilla at venus dot thegavinli.com
` (9 preceding siblings ...)
2021-01-21 21:21 ` msebor at gcc dot gnu.org
@ 2021-01-21 23:49 ` msebor at gcc dot gnu.org
2021-03-04 0:05 ` cvs-commit at gcc dot gnu.org
` (7 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-01-21 23:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2020-09-07 00:00:00 |2021-1-21
Keywords| |patch
--- Comment #9 from Martin Sebor <msebor at gcc dot gnu.org> ---
Patch: https://gcc.gnu.org/pipermail/gcc-patches/2021-January/564059.html
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug tree-optimization/96963] [10/11 Regression] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members
2020-09-07 20:46 [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members gcc_bugzilla at venus dot thegavinli.com
` (10 preceding siblings ...)
2021-01-21 23:49 ` msebor at gcc dot gnu.org
@ 2021-03-04 0:05 ` cvs-commit at gcc dot gnu.org
2021-04-08 12:02 ` [Bug tree-optimization/96963] [10 " rguenth at gcc dot gnu.org
` (6 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-04 0:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Sebor <msebor@gcc.gnu.org>:
https://gcc.gnu.org/g:8d57bdadd2d9c2e5c95515ca7a583d7b407b55c4
commit r11-7497-g8d57bdadd2d9c2e5c95515ca7a583d7b407b55c4
Author: Martin Sebor <msebor@redhat.com>
Date: Wed Mar 3 16:56:45 2021 -0700
Correct a workaround for vectorized stores.
Resolves:
PR middle-end/96963 - -Wstringop-overflow false positive with
-ftree-vectorize when assigning consecutive char struct members
PR middle-end/94655 - -Wstringop-overflow on implicit string assignment
with vectorized char store
gcc/ChangeLog:
PR middle-end/96963
PR middle-end/94655
* builtins.c (handle_array_ref): New helper.
(handle_mem_ref): New helper.
(compute_objsize_r): Factor out ARRAY_REF and MEM_REF handling
into new helper functions. Correct a workaround for vectorized
assignments.
gcc/testsuite/ChangeLog:
PR middle-end/96963
PR middle-end/94655
* gcc.dg/Wstringop-overflow-47.c: Xfail tests.
* gcc.dg/Wstringop-overflow-65.c: New test.
* gcc.dg/Warray-bounds-69.c: Same.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug tree-optimization/96963] [10 Regression] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members
2020-09-07 20:46 [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members gcc_bugzilla at venus dot thegavinli.com
` (11 preceding siblings ...)
2021-03-04 0:05 ` cvs-commit at gcc dot gnu.org
@ 2021-04-08 12:02 ` rguenth at gcc dot gnu.org
2021-07-21 16:24 ` pinskia at gcc dot gnu.org
` (5 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-08 12:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|10.3 |10.4
--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10.3 is being released, retargeting bugs to GCC 10.4.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug tree-optimization/96963] [10 Regression] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members
2020-09-07 20:46 [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members gcc_bugzilla at venus dot thegavinli.com
` (12 preceding siblings ...)
2021-04-08 12:02 ` [Bug tree-optimization/96963] [10 " rguenth at gcc dot gnu.org
@ 2021-07-21 16:24 ` pinskia at gcc dot gnu.org
2021-09-08 23:37 ` pinskia at gcc dot gnu.org
` (4 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-21 16:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |franco at francocorbelli dot com
--- Comment #12 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 101558 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug tree-optimization/96963] [10 Regression] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members
2020-09-07 20:46 [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members gcc_bugzilla at venus dot thegavinli.com
` (13 preceding siblings ...)
2021-07-21 16:24 ` pinskia at gcc dot gnu.org
@ 2021-09-08 23:37 ` pinskia at gcc dot gnu.org
2022-03-17 19:45 ` msebor at gcc dot gnu.org
` (3 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-08 23:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |eugene.chereshnev at intel dot com
--- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 102248 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug tree-optimization/96963] [10 Regression] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members
2020-09-07 20:46 [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members gcc_bugzilla at venus dot thegavinli.com
` (14 preceding siblings ...)
2021-09-08 23:37 ` pinskia at gcc dot gnu.org
@ 2022-03-17 19:45 ` msebor at gcc dot gnu.org
2022-06-28 10:41 ` jakub at gcc dot gnu.org
` (2 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: msebor at gcc dot gnu.org @ 2022-03-17 19:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |NEW
--- Comment #14 from Martin Sebor <msebor at gcc dot gnu.org> ---
I'm no longer planning to backport this.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug tree-optimization/96963] [10 Regression] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members
2020-09-07 20:46 [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members gcc_bugzilla at venus dot thegavinli.com
` (15 preceding siblings ...)
2022-03-17 19:45 ` msebor at gcc dot gnu.org
@ 2022-06-28 10:41 ` jakub at gcc dot gnu.org
2023-02-04 4:42 ` pokechu022+gccbugzilla at gmail dot com
2023-07-07 9:04 ` rguenth at gcc dot gnu.org
18 siblings, 0 replies; 20+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|10.4 |10.5
--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug tree-optimization/96963] [10 Regression] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members
2020-09-07 20:46 [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members gcc_bugzilla at venus dot thegavinli.com
` (16 preceding siblings ...)
2022-06-28 10:41 ` jakub at gcc dot gnu.org
@ 2023-02-04 4:42 ` pokechu022+gccbugzilla at gmail dot com
2023-07-07 9:04 ` rguenth at gcc dot gnu.org
18 siblings, 0 replies; 20+ messages in thread
From: pokechu022+gccbugzilla at gmail dot com @ 2023-02-04 4:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
Pokechu22 <pokechu022+gccbugzilla at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pokechu022+gccbugzilla@gmai
| |l.com
--- Comment #16 from Pokechu22 <pokechu022+gccbugzilla at gmail dot com> ---
I ran into this with Dolphin Emulator (see
https://github.com/dolphin-emu/dolphin/pull/11534), but ran into trouble trying
to simplify it. Here's what I ended up with:
```
struct Foo {
char pad[40];
char a, b;
};
struct Bar {
void Baz();
// One of these needs to be uncommented for the issue to occur
// virtual void Qux();
// int x;
Foo foo;
};
void heh(char *);
void Bar::Baz() {
heh(&foo.a);
foo.a = 1;
foo.b = 1;
}
```
Based on Godbolt (https://godbolt.org/z/46aTrP3vj) I can confirm that this
doesn't happen in 11.0 or 9.3/9.5, and does happen on 10.1/10.2/10.3/10.4.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug tree-optimization/96963] [10 Regression] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members
2020-09-07 20:46 [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members gcc_bugzilla at venus dot thegavinli.com
` (17 preceding siblings ...)
2023-02-04 4:42 ` pokechu022+gccbugzilla at gmail dot com
@ 2023-07-07 9:04 ` rguenth at gcc dot gnu.org
18 siblings, 0 replies; 20+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 9:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |10.5.0
Target Milestone|10.5 |11.0
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #17 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed in GCC 11.
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2023-07-07 9:04 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-07 20:46 [Bug tree-optimization/96963] New: -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members gcc_bugzilla at venus dot thegavinli.com
2020-09-07 23:15 ` [Bug tree-optimization/96963] " msebor at gcc dot gnu.org
2020-09-08 6:45 ` rguenth at gcc dot gnu.org
2020-09-08 8:18 ` gcc_bugzilla at venus dot thegavinli.com
2020-12-06 21:55 ` msebor at gcc dot gnu.org
2020-12-07 10:40 ` redi at gcc dot gnu.org
2020-12-07 10:43 ` [Bug tree-optimization/96963] [10/11 Regression] " redi at gcc dot gnu.org
2020-12-07 12:03 ` jakub at gcc dot gnu.org
2020-12-07 21:41 ` egallager at gcc dot gnu.org
2021-01-14 9:19 ` rguenth at gcc dot gnu.org
2021-01-21 21:21 ` msebor at gcc dot gnu.org
2021-01-21 23:49 ` msebor at gcc dot gnu.org
2021-03-04 0:05 ` cvs-commit at gcc dot gnu.org
2021-04-08 12:02 ` [Bug tree-optimization/96963] [10 " rguenth at gcc dot gnu.org
2021-07-21 16:24 ` pinskia at gcc dot gnu.org
2021-09-08 23:37 ` pinskia at gcc dot gnu.org
2022-03-17 19:45 ` msebor at gcc dot gnu.org
2022-06-28 10:41 ` jakub at gcc dot gnu.org
2023-02-04 4:42 ` pokechu022+gccbugzilla at gmail dot com
2023-07-07 9:04 ` rguenth at gcc dot gnu.org
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).