From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5251A38133F8; Thu, 2 Jun 2022 08:10:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5251A38133F8 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/105769] [11/12/13 Regression] program segmentation fault with -ftree-vectorize and nested lambdas Date: Thu, 02 Jun 2022 08:10:46 +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: 11.2.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: target_milestone cf_known_to_work cf_known_to_fail short_desc 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, 02 Jun 2022 08:10:47 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105769 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |11.4 Known to work| |10.3.0 Known to fail| |11.3.0, 12.1.0 Summary|program segmentation fault |[11/12/13 Regression] |with -ftree-vectorize and |program segmentation fault |nested lambdas |with -ftree-vectorize and | |nested lambdas --- Comment #2 from Richard Biener --- It segfaults doing an indirect call #0 0x0000000000000001 in ?? () #1 0x0000000000400c9d in std::_Function_base::~_Function_base ( this=3D, this=3D) at /home/space/rguenther/install/gcc-11.3/include/c++/11.3.0/bits/std_function= .h:244 #2 0x00000000004011f1 in std::function::~function() (this=3D, this=3D) at /home/space/rguenther/install/gcc-11.3/include/c++/11.3.0/bits/std_function= .h:334 #3 print_cov_ratio () at /tmp/t.C:86 #4 main () at /tmp/t.C:122 with -fno-lifetime-dse it works fine. I suspect that either GCC or the source gets things wrong WRT object lifetime in the maze of lambdas. It's interesting that with -fsanitize=3Dundefined added we still vectorize but exactly a single load/store: t.C:65:3: optimized: basic block part vectorized using 16 byte vectors and then it still crashes. 0x0000000000401027 <+97>: mov %rbx,%rdi 0x000000000040102a <+100>: call *%rbp =3D> 0x000000000040102c <+102>: add $0x8,%rsp (gdb) p $rbp $1 =3D (void *) 0x1 More investigation is needed.=