public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-105769-4-xvDy8eBGSS@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105769-4@http.gcc.gnu.org/bugzilla/>

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

Richard Biener <rguenth at gcc dot gnu.org> 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 <rguenth at gcc dot gnu.org> ---
It segfaults doing an indirect call

#0  0x0000000000000001 in ?? ()
#1  0x0000000000400c9d in std::_Function_base::~_Function_base (
    this=<optimized out>, this=<optimized out>)
    at
/home/space/rguenther/install/gcc-11.3/include/c++/11.3.0/bits/std_function.h:244
#2  0x00000000004011f1 in std::function<unsigned long (unsigned
long)>::~function() (this=<optimized out>, this=<optimized out>)
    at
/home/space/rguenther/install/gcc-11.3/include/c++/11.3.0/bits/std_function.h:334
#3  print_cov_ratio<ab> () 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=undefined 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
=> 0x000000000040102c <+102>:   add    $0x8,%rsp
(gdb) p $rbp
$1 = (void *) 0x1

More investigation is needed.

  parent reply	other threads:[~2022-06-02  8:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-29 21:24 [Bug c++/105769] New: " sliwa at ifpan dot edu.pl
2022-05-30 10:14 ` [Bug tree-optimization/105769] " marxin at gcc dot gnu.org
2022-06-02  8:10 ` rguenth at gcc dot gnu.org [this message]
2022-10-19 10:15 ` [Bug tree-optimization/105769] [11/12/13 Regression] " rguenth at gcc dot gnu.org
2022-10-19 11:01 ` marxin at gcc dot gnu.org
2023-01-16 20:30 ` jakub at gcc dot gnu.org
2023-01-16 21:10 ` jakub at gcc dot gnu.org
2023-01-16 21:20 ` jakub at gcc dot gnu.org
2023-01-17 11:52 ` jakub at gcc dot gnu.org
2023-01-17 12:11 ` jakub at gcc dot gnu.org
2023-01-17 12:27 ` rguenth at gcc dot gnu.org
2023-01-17 12:31 ` jakub at gcc dot gnu.org
2023-01-17 12:41 ` jakub at gcc dot gnu.org
2023-01-17 14:08 ` rguenther at suse dot de
2023-01-17 14:45 ` jakub at gcc dot gnu.org
2023-01-17 15:14 ` rguenther at suse dot de
2023-05-29 10:07 ` [Bug tree-optimization/105769] [11/12/13/14 " jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-105769-4-xvDy8eBGSS@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).