https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84433

--- Comment #9 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to acsawdey from comment #7)
> Created attachment 43462 [details]
> revised test case

$ gcc pr84433-v2.c -fsanitize=undefined && ./a.out 
pr84433-v2.c:36:11: runtime error: index 15 out of bounds for type 'structA
[15]'
B.int1 = 16 expected 16

Patching the file with:
diff -u pr84433-v2-original.c pr84433-v2.c
--- pr84433-v2-original.c       2018-02-19 15:22:40.250620365 +0100
+++ pr84433-v2.c        2018-02-19 15:22:45.054713707 +0100
@@ -9,7 +9,7 @@
 typedef struct structC
 {
   struct structB sB[16][10];
-  struct structA sA[15];
+  struct structA sA[16];
   struct structA sA2[16];
   uint32_t int1;
   uint32_t int2;

$ gcc pr84433-v2.c -O2 && ./a.out 
B.int1 = 16 expected 16

Reply via email to