From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 16B213858D39; Thu, 23 Sep 2021 07:38:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 16B213858D39 From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102462] vectorization breaks diagnostic for array out of bound detect. Date: Thu, 23 Sep 2021 07:38:18 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2021 07:38:18 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102462 --- Comment #6 from Hongtao.liu --- Move pass_strlen before loop passes @@ -261,6 +261,7 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_tsan); NEXT_PASS (pass_dse); NEXT_PASS (pass_dce); + NEXT_PASS (pass_strlen); /* Pass group that runs when 1) enabled, 2) there are loops in the function. Make sure to run pass_fix_loops before to discover/remove loops before running the gate function @@ -334,7 +335,6 @@ along with GCC; see the file COPYING3. If not see form if possible. */ NEXT_PASS (pass_thread_jumps); NEXT_PASS (pass_dominator, false /* may_peel_loop_headers_p */); - NEXT_PASS (pass_strlen); NEXT_PASS (pass_thread_jumps); NEXT_PASS (pass_vrp, false /* warn_array_bounds_p */); /* Threading can leave many const/copy propagations in the IL. causes 54 new fails c-c++-common/Wstringop-overflow.c -Wc++-compat (test for warnings, line = 93) c-c++-common/Wstringop-overflow.c -Wc++-compat (test for warnings, line = 94) c-c++-common/Wstringop-overflow.c -std=3Dgnu++14 (test for warnings, line= 93) c-c++-common/Wstringop-overflow.c -std=3Dgnu++14 (test for warnings, line= 94) c-c++-common/Wstringop-overflow.c -std=3Dgnu++17 (test for warnings, line= 93) c-c++-common/Wstringop-overflow.c -std=3Dgnu++17 (test for warnings, line= 94) c-c++-common/Wstringop-overflow.c -std=3Dgnu++2a (test for warnings, line= 93) c-c++-common/Wstringop-overflow.c -std=3Dgnu++2a (test for warnings, line= 94) c-c++-common/Wstringop-overflow.c -std=3Dgnu++98 (test for warnings, line= 93) c-c++-common/Wstringop-overflow.c -std=3Dgnu++98 (test for warnings, line= 94) g++.dg/tree-ssa/calloc.C -std=3Dgnu++14 scan-tree-dump-not optimized "mal= loc" g++.dg/tree-ssa/calloc.C -std=3Dgnu++14 scan-tree-dump-not optimized "mem= set" g++.dg/tree-ssa/calloc.C -std=3Dgnu++14 scan-tree-dump-times optimized "c= alloc" 1 g++.dg/tree-ssa/calloc.C -std=3Dgnu++17 scan-tree-dump-not optimized "mal= loc" g++.dg/tree-ssa/calloc.C -std=3Dgnu++17 scan-tree-dump-not optimized "mem= set" g++.dg/tree-ssa/calloc.C -std=3Dgnu++17 scan-tree-dump-times optimized "c= alloc" 1 g++.dg/tree-ssa/calloc.C -std=3Dgnu++2a scan-tree-dump-not optimized "mal= loc" g++.dg/tree-ssa/calloc.C -std=3Dgnu++2a scan-tree-dump-not optimized "mem= set" g++.dg/tree-ssa/calloc.C -std=3Dgnu++2a scan-tree-dump-times optimized "c= alloc" 1 g++.dg/tree-ssa/calloc.C -std=3Dgnu++98 scan-tree-dump-not optimized "mal= loc" g++.dg/tree-ssa/calloc.C -std=3Dgnu++98 scan-tree-dump-not optimized "mem= set" g++.dg/tree-ssa/calloc.C -std=3Dgnu++98 scan-tree-dump-times optimized "c= alloc" 1 gcc.dg/Wstringop-overflow-17.c (test for warnings, line 16) gcc.dg/Wstringop-overflow-17.c (test for warnings, line 9) gcc.dg/Wstringop-overflow-70.c (test for warnings, line 22) gcc.dg/tree-ssa/pr95731.c scan-tree-dump-times optimized " >=3D 0| < 0" 6 gcc.dg/tree-ssa/pr96480.c scan-tree-dump optimized " =3D _[0-9]* <=3D 3;" unix/-m32: c-c++-common/Wstringop-overflow.c -Wc++-compat (test for warnings, line 93) unix/-m32: c-c++-common/Wstringop-overflow.c -Wc++-compat (test for warnings, line 94) unix/-m32: c-c++-common/Wstringop-overflow.c -std=3Dgnu++14 (test for war= nings, line 93) unix/-m32: c-c++-common/Wstringop-overflow.c -std=3Dgnu++14 (test for war= nings, line 94) unix/-m32: c-c++-common/Wstringop-overflow.c -std=3Dgnu++17 (test for war= nings, line 93) unix/-m32: c-c++-common/Wstringop-overflow.c -std=3Dgnu++17 (test for war= nings, line 94) unix/-m32: c-c++-common/Wstringop-overflow.c -std=3Dgnu++2a (test for war= nings, line 93) unix/-m32: c-c++-common/Wstringop-overflow.c -std=3Dgnu++2a (test for war= nings, line 94) unix/-m32: c-c++-common/Wstringop-overflow.c -std=3Dgnu++98 (test for war= nings, line 93) unix/-m32: c-c++-common/Wstringop-overflow.c -std=3Dgnu++98 (test for war= nings, line 94) unix/-m32: g++.dg/tree-ssa/calloc.C -std=3Dgnu++14 scan-tree-dump-not opt= imized "malloc" unix/-m32: g++.dg/tree-ssa/calloc.C -std=3Dgnu++14 scan-tree-dump-not opt= imized "memset" unix/-m32: g++.dg/tree-ssa/calloc.C -std=3Dgnu++14 scan-tree-dump-times optimized "calloc" 1 unix/-m32: g++.dg/tree-ssa/calloc.C -std=3Dgnu++17 scan-tree-dump-not opt= imized "malloc" unix/-m32: g++.dg/tree-ssa/calloc.C -std=3Dgnu++17 scan-tree-dump-not opt= imized "memset" unix/-m32: g++.dg/tree-ssa/calloc.C -std=3Dgnu++17 scan-tree-dump-times optimized "calloc" 1 unix/-m32: g++.dg/tree-ssa/calloc.C -std=3Dgnu++2a scan-tree-dump-not opt= imized "malloc" unix/-m32: g++.dg/tree-ssa/calloc.C -std=3Dgnu++2a scan-tree-dump-not opt= imized "memset" unix/-m32: g++.dg/tree-ssa/calloc.C -std=3Dgnu++2a scan-tree-dump-times optimized "calloc" 1 unix/-m32: g++.dg/tree-ssa/calloc.C -std=3Dgnu++98 scan-tree-dump-not opt= imized "malloc" unix/-m32: g++.dg/tree-ssa/calloc.C -std=3Dgnu++98 scan-tree-dump-not opt= imized "memset" unix/-m32: g++.dg/tree-ssa/calloc.C -std=3Dgnu++98 scan-tree-dump-times optimized "calloc" 1 unix/-m32: gcc.dg/Wstringop-overflow-17.c (test for warnings, line 16) unix/-m32: gcc.dg/Wstringop-overflow-17.c (test for warnings, line 9) unix/-m32: gcc.dg/Wstringop-overflow-70.c (test for warnings, line 22) unix/-m32: gcc.dg/tree-ssa/pr95731.c scan-tree-dump-times optimized " >=3D = 0| < 0" 6 unix/-m32: gcc.dg/tree-ssa/pr96480.c scan-tree-dump optimized " =3D _[0-9]*= <=3D 3;"=