public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95768] New: -march=sandybridge -O2 -Wall crashes as 'during GIMPLE pass: uninit ... Segmentation fault'
@ 2020-06-19 15:10 slyfox at inbox dot ru
  2020-06-19 15:11 ` [Bug c++/95768] " slyfox at inbox dot ru
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: slyfox at inbox dot ru @ 2020-06-19 15:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95768
           Summary: -march=sandybridge -O2 -Wall crashes as 'during GIMPLE
                    pass: uninit ... Segmentation fault'
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at inbox dot ru
  Target Milestone: ---

SIGSEGV initially observed on qtcore-5.14.2 package.

Here is the minimal(ish) reproducer:

// $ cat bug.cc
extern "C" void *malloc(unsigned long);
class a {
public:
  enum c { Array };
};
class d {
public:
  static int e(int);
};
class f {
public:
  int g;
  void operator=(int) { d::e(g); }
};
template < typename, int, int > using h = f;
template < int i, int j > using k = h< int, i, j >;
template < int i, int j > using l = h< int, i, j >;
class m {
public:
  k< 0, 1 > is_object;
  k< 1, 1 > length;
};
class n {
public:
  m *o() { return (m *)this; }
};
class p {
public:
  enum {} alloc;
  n *header;
  p(a::c) {
    header = (n *)malloc(alloc);
    m b = *header->o();
    b.length = 0;
  }
};
void detach2() { p(a::Array); }

LANG=C /usr/bin/x86_64-pc-linux-gnu-g++ -march=sandybridge -O2 -Wall -c bug.cc
-o bug.o
bug.cc: In constructor 'p::p(a::c)':
bug.cc:32:26: warning: '*<unknown>.p::alloc' is used uninitialized
[-Wuninitialized]
   32 |     header = (n *)malloc(alloc);
      |                          ^~~~~
'
during GIMPLE pass: uninit
In function 'void detach2()':
Segmentation fault
   37 | void detach2() { p(a::Array); }
      |      ^~~~~~~
0xa9c91f crash_signal
        ../../gcc-11.0.0_pre9999/gcc/toplev.c:328
0x7f2dc77d2c3f ???
       
/usr/src/debug/sys-libs/glibc-2.31-r5/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0xce7494 location_wrapper_p(tree_node const*)
        ../../gcc-11.0.0_pre9999/gcc/tree.h:3999
0xce7494 tree_strip_any_location_wrapper(tree_node*)
        ../../gcc-11.0.0_pre9999/gcc/tree.h:4011
0xce7494 integer_onep(tree_node const*)
        ../../gcc-11.0.0_pre9999/gcc/tree.c:2573
0x4e0ee3 dump_expr
        ../../gcc-11.0.0_pre9999/gcc/cp/error.c:2386
0x4e3640 expr_to_string(tree_node*)
        ../../gcc-11.0.0_pre9999/gcc/cp/error.c:3109
0x4e3cfc cp_printer
        ../../gcc-11.0.0_pre9999/gcc/cp/error.c:4264
0x13e0646 pp_format(pretty_printer*, text_info*)
        ../../gcc-11.0.0_pre9999/gcc/pretty-print.c:1475
0x13d48e2 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
        ../../gcc-11.0.0_pre9999/gcc/diagnostic.c:1159
0x13d683a diagnostic_impl
        ../../gcc-11.0.0_pre9999/gcc/diagnostic.c:1309
0x13d683a warning_at(unsigned int, int, char const*, ...)
        ../../gcc-11.0.0_pre9999/gcc/diagnostic.c:1446
0xc5e7ed maybe_warn_operand
        ../../gcc-11.0.0_pre9999/gcc/tree-ssa-uninit.c:418
0xc619e9 warn_uninitialized_vars
        ../../gcc-11.0.0_pre9999/gcc/tree-ssa-uninit.c:640
0xc66016 execute
        ../../gcc-11.0.0_pre9999/gcc/tree-ssa-uninit.c:2936
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.

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

end of thread, other threads:[~2021-01-06 20:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-19 15:10 [Bug c++/95768] New: -march=sandybridge -O2 -Wall crashes as 'during GIMPLE pass: uninit ... Segmentation fault' slyfox at inbox dot ru
2020-06-19 15:11 ` [Bug c++/95768] " slyfox at inbox dot ru
2020-06-19 19:49 ` hjl.tools at gmail dot com
2020-06-22  7:30 ` [Bug tree-optimization/95768] [11 Regression] " rguenth at gcc dot gnu.org
2020-06-22 15:02 ` [Bug c++/95768] " msebor at gcc dot gnu.org
2020-06-22 15:13 ` msebor at gcc dot gnu.org
2020-06-23 14:47 ` msebor at gcc dot gnu.org
2020-12-11 10:24 ` marxin at gcc dot gnu.org
2020-12-11 16:04 ` msebor at gcc dot gnu.org
2021-01-02 22:23 ` msebor at gcc dot gnu.org
2021-01-06 20:46 ` cvs-commit at gcc dot gnu.org
2021-01-06 20:48 ` msebor 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).