public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/95757] New: [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517
@ 2020-06-19  2:05 seurer at linux dot vnet.ibm.com
  2020-06-19  7:23 ` [Bug middle-end/95757] " rguenth at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: seurer at linux dot vnet.ibm.com @ 2020-06-19  2:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95757
           Summary: [11 regression] missing warning in
                    gcc.dg/Wstringop-overflow-25.c since r11-1517
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: seurer at linux dot vnet.ibm.com
  Target Milestone: ---

g:5acc654e380797bbf402bc3a0a67f9a6ac4c2a83, r11-1517

spawn -ignore SIGHUP /home/seurer/gcc/git/build/gcc-test/gcc/xgcc
-B/home/seurer/gcc/git/build/gcc-test/gcc/
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c
-fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
-fdiagnostics-color=never -fdiagnostics-urls=never -O2 -Wall -Wno-array-bounds
-ftrack-macro-expansion=0 -S -o Wstringop-overflow-25.s
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c: In
function 'test_strcpy_alloca':
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:46:3:
warning: '__builtin_memcpy' writing 2 bytes into a region of size between 0 and
1 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:46:3:
note: at offset 0 to an object with size at most 1 allocated by 'alloca' here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:50:3:
warning: '__builtin_memcpy' writing 3 bytes into a region of size between 1 and
2 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:50:3:
note: at offset 0 to an object with size between 1 and 2 allocated by 'alloca'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:54:3:
warning: '__builtin_memcpy' writing 4 bytes into a region of size between 2 and
3 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:54:3:
note: at offset 0 to an object with size between 2 and 3 allocated by 'alloca'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:55:3:
warning: '__builtin_memcpy' writing 10 bytes into a region of size between 2
and 3 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:55:3:
note: at offset 0 to an object with size between 2 and 3 allocated by 'alloca'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c: In
function 'test_strcpy_calloc':
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:96:3:
warning: '__builtin_memcpy' writing 3 bytes into a region of size between 1 and
2 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:96:3:
note: at offset 0 to an object with size between 1 and 2 allocated by 'calloc'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:99:3:
warning: '__builtin_memcpy' writing 4 bytes into a region of size between 2 and
3 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:99:3:
note: at offset 0 to an object with size between 2 and 3 allocated by 'calloc'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:103:3:
warning: '__builtin_memcpy' writing 3 bytes into a region of size between 1 and
2 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:103:3:
note: at offset 0 to an object with size between 1 and 2 allocated by 'calloc'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:106:3:
warning: '__builtin_memcpy' writing 4 bytes into a region of size between 2 and
3 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:106:3:
note: at offset 0 to an object with size between 2 and 3 allocated by 'calloc'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:112:3:
warning: '__builtin_memcpy' writing 5 bytes into a region of size between 2 and
4 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:112:3:
note: at offset 0 to an object with size between 2 and 4 allocated by 'calloc'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:118:3:
warning: '__builtin_memcpy' writing 7 bytes into a region of size between 4 and
6 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:118:3:
note: at offset 0 to an object with size between 4 and 6 allocated by 'calloc'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:124:3:
warning: '__builtin_memcpy' writing 5 bytes into a region of size between 2 and
4 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:124:3:
note: at offset 0 to an object with size between 2 and 4 allocated by 'calloc'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:130:3:
warning: '__builtin_memcpy' writing 7 bytes into a region of size between 4 and
6 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:130:3:
note: at offset 0 to an object with size between 4 and 6 allocated by 'calloc'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:138:3:
warning: '__builtin_memcpy' writing 7 bytes into a region of size between 2 and
6 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:138:3:
note: at offset 0 to an object with size between 2 and 6 allocated by 'calloc'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:139:3:
warning: '__builtin_memcpy' writing 10 bytes into a region of size between 2
and 6 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:139:3:
note: at offset 0 to an object with size between 2 and 6 allocated by 'calloc'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:142:3:
warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:142:3:
note: at offset 0 to an object with size 0 allocated by 'calloc' here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c: In
function 'test_strcpy_malloc':
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:165:3:
warning: '__builtin_memcpy' writing 2 bytes into a region of size between 0 and
1 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:165:3:
note: at offset 0 to an object with size at most 1 allocated by 'malloc' here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:169:3:
warning: '__builtin_memcpy' writing 3 bytes into a region of size between 1 and
2 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:169:3:
note: at offset 0 to an object with size between 1 and 2 allocated by 'malloc'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:173:3:
warning: '__builtin_memcpy' writing 4 bytes into a region of size between 2 and
3 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:173:3:
note: at offset 0 to an object with size between 2 and 3 allocated by 'malloc'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:174:3:
warning: '__builtin_memcpy' writing 10 bytes into a region of size between 2
and 3 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:174:3:
note: at offset 0 to an object with size between 2 and 3 allocated by 'malloc'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c: In
function 'test_strcpy_alloc1':
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:187:3:
warning: '__builtin_memcpy' writing 2 bytes into a region of size between 0 and
1 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:187:3:
note: at offset 0 to an object with size at most 1 allocated by 'alloc1' here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:191:3:
warning: '__builtin_memcpy' writing 3 bytes into a region of size between 1 and
2 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:191:3:
note: at offset 0 to an object with size between 1 and 2 allocated by 'alloc1'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:195:3:
warning: '__builtin_memcpy' writing 4 bytes into a region of size between 2 and
3 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:195:3:
note: at offset 0 to an object with size between 2 and 3 allocated by 'alloc1'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:196:3:
warning: '__builtin_memcpy' writing 10 bytes into a region of size between 2
and 3 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:196:3:
note: at offset 0 to an object with size between 2 and 3 allocated by 'alloc1'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c: In
function 'test_strcpy_alloc2':
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:208:3:
warning: '__builtin_memcpy' writing 2 bytes into a region of size between 0 and
1 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:208:3:
note: at offset 0 to an object with size at most 1 allocated by 'alloc1' here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:212:3:
warning: '__builtin_memcpy' writing 3 bytes into a region of size between 1 and
2 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:212:3:
note: at offset 0 to an object with size between 1 and 2 allocated by 'alloc1'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:216:3:
warning: '__builtin_memcpy' writing 4 bytes into a region of size between 2 and
3 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:216:3:
note: at offset 0 to an object with size between 2 and 3 allocated by 'alloc1'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:217:3:
warning: '__builtin_memcpy' writing 10 bytes into a region of size between 2
and 3 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:217:3:
note: at offset 0 to an object with size between 2 and 3 allocated by 'alloc1'
here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c: In
function 'test_strcpy_alloc2_4':
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:230:3:
warning: '__builtin_memcpy' writing 3 bytes into a region of size between 1 and
2 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:230:3:
note: at offset 0 to an object with size between 1 and 2 allocated by
'alloc2_4' here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:233:3:
warning: '__builtin_memcpy' writing 4 bytes into a region of size between 2 and
3 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:233:3:
note: at offset 0 to an object with size between 2 and 3 allocated by
'alloc2_4' here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:237:3:
warning: '__builtin_memcpy' writing 3 bytes into a region of size between 1 and
2 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:237:3:
note: at offset 0 to an object with size between 1 and 2 allocated by
'alloc2_4' here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:240:3:
warning: '__builtin_memcpy' writing 4 bytes into a region of size between 2 and
3 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:240:3:
note: at offset 0 to an object with size between 2 and 3 allocated by
'alloc2_4' here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:246:3:
warning: '__builtin_memcpy' writing 5 bytes into a region of size between 2 and
4 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:246:3:
note: at offset 0 to an object with size between 2 and 4 allocated by
'alloc2_4' here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:252:3:
warning: '__builtin_memcpy' writing 7 bytes into a region of size between 4 and
6 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:252:3:
note: at offset 0 to an object with size between 4 and 6 allocated by
'alloc2_4' here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:258:3:
warning: '__builtin_memcpy' writing 5 bytes into a region of size between 2 and
4 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:258:3:
note: at offset 0 to an object with size between 2 and 4 allocated by
'alloc2_4' here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:264:3:
warning: '__builtin_memcpy' writing 7 bytes into a region of size between 4 and
6 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:264:3:
note: at offset 0 to an object with size between 4 and 6 allocated by
'alloc2_4' here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:272:3:
warning: '__builtin_memcpy' writing 7 bytes into a region of size between 2 and
6 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:272:3:
note: at offset 0 to an object with size between 2 and 6 allocated by
'alloc2_4' here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:273:3:
warning: '__builtin_memcpy' writing 10 bytes into a region of size between 2
and 6 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:273:3:
note: at offset 0 to an object with size between 2 and 6 allocated by
'alloc2_4' here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c: In
function 'test_strcpy_vla':
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:306:3:
warning: '__builtin_memcpy' writing 2 bytes into a region of size between 0 and
1 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:306:3:
note: at offset 0 to an object with size at most 1 declared here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:310:3:
warning: '__builtin_memcpy' writing 3 bytes into a region of size between 1 and
2 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:310:3:
note: at offset 0 to an object with size between 1 and 2 declared here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:314:3:
warning: '__builtin_memcpy' writing 4 bytes into a region of size between 2 and
3 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:314:3:
note: at offset 0 to an object with size between 2 and 3 declared here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:315:3:
warning: '__builtin_memcpy' writing 10 bytes into a region of size between 2
and 3 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:315:3:
note: at offset 0 to an object with size between 2 and 3 declared here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:323:3:
warning: '__builtin_memcpy' writing 5 bytes into a region of size between 2 and
4 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:323:3:
note: at offset 0 to an object with size between 2 and 4 declared here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:324:3:
warning: '__builtin_memcpy' writing 6 bytes into a region of size between 2 and
4 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:324:3:
note: at offset 0 to an object with size between 2 and 4 declared here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:325:3:
warning: '__builtin_memcpy' writing 10 bytes into a region of size between 2
and 4 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:325:3:
note: at offset 0 to an object with size between 2 and 4 declared here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:332:3:
warning: '__builtin_memcpy' writing 7 bytes into a region of size between 4 and
6 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:332:3:
note: at offset 0 to an object with size between 4 and 6 declared here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:345:3:
warning: '__builtin_memcpy' writing 13 bytes into a region of size between 8
and 12 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:345:3:
note: at offset 0 to an object with size between 8 and 12 declared here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:346:3:
warning: '__builtin_memcpy' writing 37 bytes into a region of size between 8
and 12 [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:346:3:
note: at offset 0 to an object with size between 8 and 12 declared here
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c: In
function 'test_strcpy_malloc_flexarray':
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:373:3:
warning: '__builtin_memcpy' writing 2 bytes into a region of size 1 overflows
the destination [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:373:3:
note: at offset 1 into destination object of size [1, 2] allocated by 'malloc'
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:381:3:
warning: '__builtin_memcpy' writing 4 bytes into a region of size 3 overflows
the destination [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:381:3:
note: at offset 1 into destination object of size [3, 4] allocated by 'malloc'
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:382:3:
warning: '__builtin_memcpy' writing 10 bytes into a region of size 3 overflows
the destination [-Wstringop-overflow=]
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c:382:3:
note: at offset 1 into destination object of size [3, 4] allocated by 'malloc'
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 46)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 50)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 54)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 55)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 96)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 99)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 103)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 106)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 112)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 118)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 124)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 130)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 138)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 139)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 142)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 165)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 169)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 173)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 174)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 187)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 191)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 195)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 196)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 208)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 212)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 216)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 217)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 230)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 233)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 237)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 240)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 246)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 252)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 258)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 264)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 272)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 273)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 306)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 310)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 314)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 315)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 323)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 324)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 325)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 332)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 345)
PASS: gcc.dg/Wstringop-overflow-25.c  (test for warnings, line 346)
PASS: gcc.dg/Wstringop-overflow-25.c pr92814 (test for warnings, line 373)
FAIL: gcc.dg/Wstringop-overflow-25.c pr92814 (test for warnings, line 377)
PASS: gcc.dg/Wstringop-overflow-25.c pr92814 (test for warnings, line 381)
PASS: gcc.dg/Wstringop-overflow-25.c pr92814 (test for warnings, line 382)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/95757] [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517
  2020-06-19  2:05 [Bug middle-end/95757] New: [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517 seurer at linux dot vnet.ibm.com
@ 2020-06-19  7:23 ` rguenth at gcc dot gnu.org
  2020-06-19  7:35 ` clyon at gcc dot gnu.org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-06-19  7:23 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/95757] [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517
  2020-06-19  2:05 [Bug middle-end/95757] New: [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517 seurer at linux dot vnet.ibm.com
  2020-06-19  7:23 ` [Bug middle-end/95757] " rguenth at gcc dot gnu.org
@ 2020-06-19  7:35 ` clyon at gcc dot gnu.org
  2020-08-13 15:33 ` seurer at gcc dot gnu.org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: clyon at gcc dot gnu.org @ 2020-06-19  7:35 UTC (permalink / raw)
  To: gcc-bugs

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

Christophe Lyon <clyon at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|powerpc64*-linux-gnu        |powerpc64*-linux-gnu arm
                 CC|                            |clyon at gcc dot gnu.org

--- Comment #1 from Christophe Lyon <clyon at gcc dot gnu.org> ---
I see the same thing on some arm targets:
arm-none-linux-gnueabihf --with-cpu=cortex-a5
arm-none-eabi -mcpu=cortex-m[034]

but for instance arm-none-linux-gnueabihf --with-cpu=cortex-a9 works.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/95757] [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517
  2020-06-19  2:05 [Bug middle-end/95757] New: [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517 seurer at linux dot vnet.ibm.com
  2020-06-19  7:23 ` [Bug middle-end/95757] " rguenth at gcc dot gnu.org
  2020-06-19  7:35 ` clyon at gcc dot gnu.org
@ 2020-08-13 15:33 ` seurer at gcc dot gnu.org
  2020-10-16 11:53 ` rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: seurer at gcc dot gnu.org @ 2020-08-13 15:33 UTC (permalink / raw)
  To: gcc-bugs

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

seurer at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |seurer at gcc dot gnu.org,
                   |                            |vries at gcc dot gnu.org

--- Comment #2 from seurer at gcc dot gnu.org ---
After g:ebd203778cc56df61cc3434fa01e77b4bae26362, r11-2655 the line number of
the error changed but it still remains:

now:
FAIL: gcc.dg/Wstringop-overflow-25.c pr92814 (test for warnings, line 378)

before:
FAIL: gcc.dg/Wstringop-overflow-25.c pr92814 (test for warnings, line 377)

This occurs on all powerpc64 targets.


commit ebd203778cc56df61cc3434fa01e77b4bae26362
Author: Tom de Vries <tdevries@suse.de>
Date:   Fri Aug 7 08:59:04 2020 +0200

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/95757] [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517
  2020-06-19  2:05 [Bug middle-end/95757] New: [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517 seurer at linux dot vnet.ibm.com
                   ` (2 preceding siblings ...)
  2020-08-13 15:33 ` seurer at gcc dot gnu.org
@ 2020-10-16 11:53 ` rguenth at gcc dot gnu.org
  2020-10-16 12:03 ` clyon at gcc dot gnu.org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-10-16 11:53 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2020-10-16

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
x86_64 is meanwhile clean - does this problem still persist?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/95757] [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517
  2020-06-19  2:05 [Bug middle-end/95757] New: [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517 seurer at linux dot vnet.ibm.com
                   ` (3 preceding siblings ...)
  2020-10-16 11:53 ` rguenth at gcc dot gnu.org
@ 2020-10-16 12:03 ` clyon at gcc dot gnu.org
  2020-12-16 18:14 ` seurer at gcc dot gnu.org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: clyon at gcc dot gnu.org @ 2020-10-16 12:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Christophe Lyon <clyon at gcc dot gnu.org> ---
Yes I still see
FAIL: gcc.dg/Wstringop-overflow-25.c pr92814 (test for warnings, line 378)
for
arm-none-linux-gnueabihf --with-cpu=cortex-a5
arm-none-eabi -mcpu=cortex-m[034]

but for instance arm-none-linux-gnueabihf --with-cpu=cortex-a9 works.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/95757] [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517
  2020-06-19  2:05 [Bug middle-end/95757] New: [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517 seurer at linux dot vnet.ibm.com
                   ` (4 preceding siblings ...)
  2020-10-16 12:03 ` clyon at gcc dot gnu.org
@ 2020-12-16 18:14 ` seurer at gcc dot gnu.org
  2021-02-23  2:59 ` hp at gcc dot gnu.org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: seurer at gcc dot gnu.org @ 2020-12-16 18:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from seurer at gcc dot gnu.org ---
Still seeing this on powerpc64, too.

g:8379916b167de9bebc32401526b6f53d06dca349, r11-6152
make  -k check-gcc RUNTESTFLAGS="dg.exp=gcc.dg/Wstringop-overflow-25.c"
FAIL: gcc.dg/Wstringop-overflow-25.c pr92814 (test for warnings, line 378)
# of expected passes            51
# of unexpected failures        1

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/95757] [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517
  2020-06-19  2:05 [Bug middle-end/95757] New: [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517 seurer at linux dot vnet.ibm.com
                   ` (5 preceding siblings ...)
  2020-12-16 18:14 ` seurer at gcc dot gnu.org
@ 2021-02-23  2:59 ` hp at gcc dot gnu.org
  2021-02-26 12:12 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: hp at gcc dot gnu.org @ 2021-02-23  2:59 UTC (permalink / raw)
  To: gcc-bugs

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

Hans-Peter Nilsson <hp at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hp at gcc dot gnu.org
             Status|WAITING                     |NEW
   Last reconfirmed|2020-10-16 00:00:00         |2021-2-23
             Target|powerpc64*-linux-gnu arm    |powerpc64*-linux-gnu, arm,
                   |                            |cris, mmix, pru, moxie,
                   |                            |m68k

--- Comment #6 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
I was just about to open a new bug-report with the following observations, some
of which are not redundant:

Since commit 5acc654e3807 / r11-1517 the test gcc.dg/Wstringop-overflow-25.c
has
failed for cris-elf as follows, still at 8e99b5ba4c19 / r11-7328:
Running /x/gcc/gcc/testsuite/gcc.dg/dg.exp ...
... (elided lines)
FAIL: gcc.dg/Wstringop-overflow-25.c pr92814 (test for warnings, line 378)

The emitted warnings for the other lines of this tests are
the same for cris-elf as for x86_64-pc-linux-gnu (where the
test passes).

There's no apparent reason for this difference.  For
example, it doesn't seem to have to do with alignment or
structure layout.  The same missing error on the same line
can be seen for targets with widely different characteristics, like
for mmix-knuth-mmixware:
https://gcc.gnu.org/pipermail/gcc-testresults/2020-August/583266.html
and powerpc64le-unknown-linux-gnu:
https://gcc.gnu.org/pipermail/gcc-testresults/2021-February/652702.html
and pru-unknown-elf:
https://gcc.gnu.org/pipermail/gcc-testresults/2021-February/652712.html
and moxie-unknown-elf:
https://gcc.gnu.org/pipermail/gcc-testresults/2021-February/652743.html
and m68k-unknown-linux-gnu:
https://gcc.gnu.org/pipermail/gcc-testresults/2021-February/652763.html

but not for i686-linux-gnu:
https://gcc.gnu.org/pipermail/gcc-testresults/2021-February/652708.html
nor aarch64-none-elf -mabi=ilp32:
https://gcc.gnu.org/pipermail/gcc-testresults/2021-February/652767.html
nor arm-none-eabi DEFCPU=cortex-a9:
https://gcc.gnu.org/pipermail/gcc-testresults/2021-February/652814.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/95757] [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517
  2020-06-19  2:05 [Bug middle-end/95757] New: [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517 seurer at linux dot vnet.ibm.com
                   ` (6 preceding siblings ...)
  2021-02-23  2:59 ` hp at gcc dot gnu.org
@ 2021-02-26 12:12 ` rguenth at gcc dot gnu.org
  2021-03-01 14:48 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-02-26 12:12 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |85316
                 CC|                            |amacleod at redhat dot com
           Priority|P3                          |P1

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
So the warning machinery (or likely the range machinery) is confused about

  size_t r_1_2 = UR (1, 2);
  size_t r_2_3 = UR (2, 3);

  T (char, S (2), r_1_2);       // { dg-warning "\\\[-Wstringop-overflow"
"pr92814" }

  T (char, S (0), r_2_3);

but it treats the case well when the second T is elided or when the size
computation is moved before the Ts like with

diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c
b/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c
index bc609587575..116fbf600a6 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c
@@ -367,16 +367,16 @@ struct Flex
 NOIPA void test_strcpy_malloc_flexarray (void)
 {
   size_t r_0_1 = UR (0, 1);
-  size_t r_1_2 = UR (1, 2);
-  size_t r_2_3 = UR (2, 3);

   T (char, S (0), r_0_1);
   T (char, S (1), r_0_1);       // { dg-warning "\\\[-Wstringop-overflow"
"pr92814" }

+  size_t r_1_2 = UR (1, 2);
   T (char, S (0), r_1_2);
   T (char, S (1), r_1_2);
   T (char, S (2), r_1_2);       // { dg-warning "\\\[-Wstringop-overflow"
"pr92814" }

+  size_t r_2_3 = UR (2, 3);
   T (char, S (0), r_2_3);
   T (char, S (2), r_2_3);
   T (char, S (3), r_2_3);       // { dg-warning "\\\[-Wstringop-overflow"
"pr92814" }


Martin, is there any harm in changing the testcase this way?  The issue
reproduces with a cross and the two-line snippet at the top (just prune
the rest from the testcase).  In case you want to have a closer look
why the warning is not issued on ppc64le (where I tested) vs. x86_64.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85316
[Bug 85316] [meta-bug] VRP range propagation missed cases

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/95757] [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517
  2020-06-19  2:05 [Bug middle-end/95757] New: [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517 seurer at linux dot vnet.ibm.com
                   ` (7 preceding siblings ...)
  2021-02-26 12:12 ` rguenth at gcc dot gnu.org
@ 2021-03-01 14:48 ` jakub at gcc dot gnu.org
  2021-03-01 17:59 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-03-01 14:48 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aldyh at gcc dot gnu.org,
                   |                            |jakub at gcc dot gnu.org

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
We get only 3 warnings on the last function with
-O2 -Wall -Wno-array-bounds --param=logical-op-non-short-circuit=0
-ftrack-macro-expansion=0
while we get 4 with
-O2 -Wall -Wno-array-bounds --param=logical-op-non-short-circuit=1
-ftrack-macro-expansion=0
I think the important differences are that while we have in *.optimized pretty
much the same IL - I only see differences between SSA_NAME versions, in the
--param=logical-op-non-short-circuit=1 case we have more accurate
SSA_NAME_RANGE_INFO on 3 SSA_NAMEs
   <bb 2> [local count: 1073741824]:
-  _51 ={v} unsigned_value_source;
-  if (_51 > 1)
+  _57 ={v} unsigned_value_source;
+  if (_57 > 1)
     goto <bb 4>; [50.00%]
   else
     goto <bb 3>; [50.00%]

   <bb 3> [local count: 536870912]:
   # RANGE [1, 2] NONZERO 3
-  _55 = _51 + 1;
+  _55 = _57 + 1;

   <bb 4> [local count: 1073741824]:
   # RANGE [1, 2] NONZERO 3
-  # prephitmp_54 = PHI <_55(3), 1(2)>
-  _49 ={v} unsigned_value_source;
-  _48 = _49 + 18446744073709551615;
-  if (_48 > 1)
+  # prephitmp_50 = PHI <1(2), _55(3)>
+  _52 ={v} unsigned_value_source;
+  _59 = _52 + 18446744073709551615;
+  if (_59 > 1)
     goto <bb 6>; [50.00%]
   else
     goto <bb 5>; [50.00%]

-  <bb 5> [local count: 268435457]:
-  _53 = _49 + 1;
+  <bb 5> [local count: 536870913]:
+  # RANGE [2, 3] NONZERO 3
+  _53 = _52 + 1;

   <bb 6> [local count: 1073741824]:
-  # prephitmp_57 = PHI <2(4), _53(5)>
+  # RANGE [2, 3] NONZERO 3
+  # prephitmp_54 = PHI <2(4), _53(5)>
   _47 ={v} unsigned_value_source;
-  _52 = _47 + 18446744073709551614;
-  if (_52 > 1)
+  _61 = _47 + 18446744073709551614;
+  if (_61 > 1)
     goto <bb 8>; [50.00%]
   else
     goto <bb 7>; [50.00%]

-  <bb 7> [local count: 268435457]:
-  _59 = _47 + 1;
+  <bb 7> [local count: 536870913]:
+  # RANGE [3, 4] NONZERO 7
+  _48 = _47 + 1;

   <bb 8> [local count: 1073741824]:
...
I mean the _53, prephitmp_54 and _48 ranges above in the + lines (i.e. =1).
Early during optimizations we have the usual short-circuit vs.
non-short-circuit differences like:
-  # iftmp.0_52 = PHI <_51(3), 0(2)>
-  _49 ={v} unsigned_value_source;
-  if (_49 == 0)
-    goto <bb 7>; [50.00%]
+  # iftmp.0_58 = PHI <0(2), _57(3)>
+  _52 ={v} unsigned_value_source;
+  _53 = _52 == 0;
+  _54 = _52 > 2;
+  _55 = _53 | _54;
+  if (_55 != 0)
+    goto <bb 6>; [50.00%]
   else
     goto <bb 5>; [50.00%]

   <bb 5> [local count: 536870913]:
-  if (_49 > 2)
-    goto <bb 7>; [50.00%]
-  else
-    goto <bb 6>; [50.00%]
-
-  <bb 6> [local count: 268435456]:

-  <bb 7> [local count: 1073741824]:
-  # iftmp.0_50 = PHI <1(4), 1(5), _49(6)>
+  <bb 6> [local count: 1073741824]:
+  # iftmp.0_56 = PHI <1(4), _52(5)>
but they gradually disappear.
Right before *.dom3 the IL is already pretty much the same when ignoring
SSA_NAME version differences,
except:
-  # prephitmp_54 = PHI <_55(3), 1(2)>
-  _49 ={v} unsigned_value_source;
-  _48 = _49 + 18446744073709551615;
-  _1 = _48 > 1;
-  if (_1 != 0)
+  # prephitmp_50 = PHI <1(2), _55(3)>
+  _52 ={v} unsigned_value_source;
+  _59 = _52 + 18446744073709551615;
+  if (_59 > 1)
and
   _47 ={v} unsigned_value_source;
-  _52 = _47 + 18446744073709551614;
-  _50 = _52 > 1;
-  if (_50 != 0)
+  _61 = _47 + 18446744073709551614;
+  if (_61 > 1)
i.e. the - version (=0) doesn't have the comparisons folded into GIMPLE_CONDs
while the + version (=1) does.
And I believe that is the trigger on why during dom3 adds the more precise
ranges in the --param=logical-op-non-short-circuit=1 case and not in the
--param=logical-op-non-short-circuit=0 case.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/95757] [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517
  2020-06-19  2:05 [Bug middle-end/95757] New: [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517 seurer at linux dot vnet.ibm.com
                   ` (8 preceding siblings ...)
  2021-03-01 14:48 ` jakub at gcc dot gnu.org
@ 2021-03-01 17:59 ` jakub at gcc dot gnu.org
  2021-03-02 10:49 ` cvs-commit at gcc dot gnu.org
  2021-03-02 10:55 ` jakub at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-03-01 17:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 50279
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50279&action=edit
gcc11-pr95757.patch

Untested fix.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/95757] [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517
  2020-06-19  2:05 [Bug middle-end/95757] New: [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517 seurer at linux dot vnet.ibm.com
                   ` (9 preceding siblings ...)
  2021-03-01 17:59 ` jakub at gcc dot gnu.org
@ 2021-03-02 10:49 ` cvs-commit at gcc dot gnu.org
  2021-03-02 10:55 ` jakub at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-02 10:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:ff92ede8d269375f800e1b347a48f4698874b4a3

commit r11-7448-gff92ede8d269375f800e1b347a48f4698874b4a3
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Mar 2 11:49:12 2021 +0100

    vrp: Improve register_edge_assert_for [PR95757]

    The Wstringop-overflow-25.c testcase doesn't emit one of the expected
    warnings on targets that don't do short curcuiting due to target costs
    (or e.g. with --param=logical-op-non-short-circuit=0 on all targets).

    The problem is that only reassoc2 optimizes:
      _49 ={v} unsigned_value_source;
      if (_49 == 0)
        goto <bb 7>; [50.00%]
      else
        goto <bb 5>; [50.00%]

      <bb 5> [local count: 536870913]:
      if (_49 > 2)
        goto <bb 7>; [50.00%]
      else
        goto <bb 6>; [50.00%]

      <bb 6> [local count: 268435457]:
      _53 = _49 + 1;
    into:
      _49 ={v} unsigned_value_source;
      _48 = _49 + 18446744073709551615;
      _1 = _48 > 1;
      if (_1 != 0)
        goto <bb 6>; [50.00%]
      else
        goto <bb 5>; [50.00%]

      <bb 5> [local count: 268435457]:
      _53 = _49 + 1;
    (but, note the _1 = _48 > 1; if (_1 != 0)),
    then dom3 is run and because of that if (_1 != 0) vs. if (_48 > 1) doesn't
    register edge asserts for _48 and _49) and so we don't get
    SSA_NAME_RANGE_INFO for _53 (and ditto for vrp2) and only afterwards comes
    forwprop4 that canonicalizes it to if (_48 > 1).  While with
    --param=logical-op-non-short-circuit=1 it is already reassoc1 that
optimizes
    it and forwprop3 that propagates it, so we have on the SSA_NAME
    corresponding to _53 above SSA_NAME_RANGE_INFO and during expansion we
warn.

    The following patch fixes it by handling those not yet propagated
    comparisons into GIMPLE_COND in register_edge_assert_for.  We already
    have all the infrastructure there to handle the
--param=logical-op-non-short-circuit=1
    | and &s.

    2021-03-02  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/95757
            * tree-vrp.c (register_edge_assert_for): Remove superfluous ()s
around
            condition.  Call register_edge_assert_for_1 for == 0, != 0, == 1
and
            != 1 comparisons if name is lhs of a comparison.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/95757] [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517
  2020-06-19  2:05 [Bug middle-end/95757] New: [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517 seurer at linux dot vnet.ibm.com
                   ` (10 preceding siblings ...)
  2021-03-02 10:49 ` cvs-commit at gcc dot gnu.org
@ 2021-03-02 10:55 ` jakub at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-03-02 10:55 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Should be fixed now.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-03-02 10:55 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-19  2:05 [Bug middle-end/95757] New: [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517 seurer at linux dot vnet.ibm.com
2020-06-19  7:23 ` [Bug middle-end/95757] " rguenth at gcc dot gnu.org
2020-06-19  7:35 ` clyon at gcc dot gnu.org
2020-08-13 15:33 ` seurer at gcc dot gnu.org
2020-10-16 11:53 ` rguenth at gcc dot gnu.org
2020-10-16 12:03 ` clyon at gcc dot gnu.org
2020-12-16 18:14 ` seurer at gcc dot gnu.org
2021-02-23  2:59 ` hp at gcc dot gnu.org
2021-02-26 12:12 ` rguenth at gcc dot gnu.org
2021-03-01 14:48 ` jakub at gcc dot gnu.org
2021-03-01 17:59 ` jakub at gcc dot gnu.org
2021-03-02 10:49 ` cvs-commit at gcc dot gnu.org
2021-03-02 10:55 ` jakub 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).