[Bug tree-optimization/92341] New: missing -Warray-bounds indexing past the end of a compound literal
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Nov 3 23:08:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92341
Bug ID: 92341
Summary: missing -Warray-bounds indexing past the end of a
compound literal
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: msebor at gcc dot gnu.org
Target Milestone: ---
Out-of-bounds accesses to compound literals are not diagnosed:
$ cat u.c && gcc -O2 -S -Wall -fdump-tree-ethread=/dev/stdout
-fdump-tree-esra=/dev/stdout u.c
int f (void)
{
int *p = (int[]){ 1, 2, 3 };
return p[7];
}
;; Function f (f, funcdef_no=0, decl_uid=1930, 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 }
f ()
{
int D.1933[3];
int * p;
int _6;
<bb 2> :
D.1933[0] = 1;
D.1933[1] = 2;
D.1933[2] = 3;
_6 = MEM[(int *)&D.1933 + 28B];
D.1933 ={v} {CLOBBER};
return _6;
}
;; Function f (f, funcdef_no=0, decl_uid=1930, cgraph_uid=1, symbol_order=0)
Created a replacement for D.1933 offset: 224, size: 32: SR.0
f ()
{
int SR.0;
int D.1933[3];
int * p;
int _6;
<bb 2> :
D.1933[0] = 1;
D.1933[1] = 2;
D.1933[2] = 3;
_6 = SR.0_5(D);
D.1933 ={v} {CLOBBER};
return _6;
}
More information about the Gcc-bugs
mailing list