[Bug c/86287] AddressSanitizer: heap-use-after-free on bootstrap with -O3

2018-06-23 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86287

--- Comment #2 from David Binderman  ---
Reduced C code is this:

typedef struct {
  long a;
  long b;
  long c
} d;
typedef struct {
  int dtype;
  d dim[]
} e;
e f;
g;
h() {
  for (; g; ++g)
f.dim[g].b = f.dim[g].c = f.dim[g].a = 1;
}

Command line is

$ /home/dcb/gcc/results/bin/gcc  -c -O3 -w -B/home/dcb/gcc/working/./gcc/ 
-std=gnu11 bug448.c
==27410==ERROR: AddressSanitizer: heap-use-after-free on address 0x61122094 
at pc 0x02920418 bp 0x7fff6e82be60 sp 0x7fff6e82be58
READ of size 4 at 0x61122094 thread T0
#0 0x2920417 in vect_transform_loop_stmt
../../trunk/gcc/tree-vect-loop.c:83
32
#1 0x2963d8c in vect_transform_loop(_loop_vec_info*)
../../trunk/gcc/tree-ve
ct-loop.c:8567

[Bug c/86287] AddressSanitizer: heap-use-after-free on bootstrap with -O3

2018-06-23 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86287

--- Comment #1 from David Binderman  ---
Created attachment 44314
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44314=edit
C source code

The attached C code, when compiled with flag -O3, on a recent asan
version of trunk seems to cause the problem.