public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sliwa at ifpan dot edu.pl" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/105769] New: program segmentation fault with -ftree-vectorize and nested lambdas
Date: Sun, 29 May 2022 21:24:46 +0000	[thread overview]
Message-ID: <bug-105769-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 105769
           Summary: program segmentation fault with -ftree-vectorize and
                    nested lambdas
           Product: gcc
           Version: 11.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sliwa at ifpan dot edu.pl
  Target Milestone: ---

Created attachment 53050
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53050&action=edit
sample program demonstrating undefined behavior

The attached program triggers undefined behavior with g++ (the resulting binary
segfaults in the manager code of a functor wrapper) when compiled as follows
(minimal flags to trigger):

g++ -flto -O1 -ftree-vectorize tst.cc

This may be related to memory alignment of data (I see a crash with long
double, but not with double). Other things to check is the capture of functor
est in program line 57 (adding an ampersand eliminates the issue). Even
changing the data in lines 81-82 (for example to 0) affects the outcome.

Platform: amd64, RHEL or Gentoo Linux.

             reply	other threads:[~2022-05-29 21:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-29 21:24 sliwa at ifpan dot edu.pl [this message]
2022-05-30 10:14 ` [Bug tree-optimization/105769] " marxin at gcc dot gnu.org
2022-06-02  8:10 ` [Bug tree-optimization/105769] [11/12/13 Regression] " rguenth at gcc dot gnu.org
2022-10-19 10:15 ` 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@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).