public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102970] New: stable_sort uninitialized value with -funroll-loops -fno-tree-vectorize
@ 2021-10-27 19:07 dan at stahlke dot org
  2021-10-27 20:40 ` [Bug middle-end/102970] [11/12 Regression] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: dan at stahlke dot org @ 2021-10-27 19:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102970
           Summary: stable_sort uninitialized value with -funroll-loops
                    -fno-tree-vectorize
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dan at stahlke dot org
  Target Milestone: ---

Created attachment 51682
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51682&action=edit
demonstration source code

The attached file, compiled with 11.2.0, using the command line in the comment,
causes std::stable_sort to access uninitialized memory.  In fact, it already
goes wrong by the time it passes the inputs to the first comparison operation. 
The problem goes away if the copy constructor of the box struct is defaulted
(see the "#if").

It only happens with "-funroll-loops -fno-tree-vectorize".

Here is a Godbolt: https://godbolt.org/z/6PsdPj6q3

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

end of thread, other threads:[~2021-11-22  8:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-27 19:07 [Bug c++/102970] New: stable_sort uninitialized value with -funroll-loops -fno-tree-vectorize dan at stahlke dot org
2021-10-27 20:40 ` [Bug middle-end/102970] [11/12 Regression] " pinskia at gcc dot gnu.org
2021-10-27 20:49 ` pinskia at gcc dot gnu.org
2021-10-27 20:57 ` pinskia at gcc dot gnu.org
2021-11-01 10:04 ` [Bug middle-end/102970] [11/12 Regression] stable_sort uninitialized value with -funroll-loops -fno-tree-vectorize since r11-2963-gd6a05b494b4b714e marxin at gcc dot gnu.org
2021-11-02  7:13 ` rguenth at gcc dot gnu.org
2021-11-03 11:11 ` rguenth at gcc dot gnu.org
2021-11-03 14:00 ` cvs-commit at gcc dot gnu.org
2021-11-03 14:05 ` [Bug middle-end/102970] [11 " rguenth at gcc dot gnu.org
2021-11-22  8:00 ` cvs-commit at gcc dot gnu.org
2021-11-22  8:01 ` rguenth 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).