public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109868] New: [13/14 regression] ICE: segmentation fault when building small C++ program
@ 2023-05-15 22:37 sjames at gcc dot gnu.org
  2023-05-15 22:40 ` [Bug c++/109868] " sjames at gcc dot gnu.org
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-05-15 22:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109868
           Summary: [13/14 regression] ICE: segmentation fault when
                    building small C++ program
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
                CC: amonakov at gcc dot gnu.org
  Target Milestone: ---

I originally reported this at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109806#c12.

For me, this crashes on x86_64-gentoo-linux-musl:
```
struct SimpleRefCounted {
  virtual void addRef();
};
struct timespec {
  long tv_nsec;
  int : 0;
};
struct ClockImpl : SimpleRefCounted {
  timespec _startTime;
};
struct Clock {
  Clock();
};
Clock::Clock() { ClockImpl(); }
```

with:
```
# g++ /tmp/foo.cxx -O2 -wrapper valgrind
==1239523== Memcheck, a memory error detector
==1239523== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==1239523== Using Valgrind-3.21.0 and LibVEX; rerun with -h for copyright info
==1239523== Command: /usr/libexec/gcc/x86_64-gentoo-linux-musl/13/cc1plus
-quiet -D_GNU_SOURCE /tmp/foo.cxx -quiet -dumpdir a- -dumpbase foo.cxx
-dumpbase-ext .cxx -mtune=generic -march=x86-64 -O2 -fcf-protection -o
/tmp/ccigHfiN.s
==1239523==
==1239523== Invalid read of size 1
==1239523==    at 0x97844C: to_wide (tree.h:6257)
==1239523==    by 0x97844C: irange::set_varying(tree_node*) (value-range.h:959)
==1239523==    by 0x10C1A45: range_query::get_tree_range(vrange&, tree_node*,
gimple*) (value-query.cc:252)
==1239523==    by 0x1B52256: gimple_ranger::range_of_stmt(vrange&, gimple*,
tree_node*) (gimple-range.cc:298)
==1239523==    by 0x1B52778: gimple_ranger::register_inferred_ranges(gimple*)
(gimple-range.cc:474)
==1239523==    by 0x109FB19: rvrp_folder::fold_stmt(gimple_stmt_iterator*)
(tree-vrp.cc:1079)
==1239523==    by 0xFA9ED3:
substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
(tree-ssa-propagate.cc:848)
==1239523==    by 0x1B24C2E: dom_walker::walk(basic_block_def*)
(domwalk.cc:311)
==1239523==    by 0xFA9312:
substitute_and_fold_engine::substitute_and_fold(basic_block_def*)
(tree-ssa-propagate.cc:971)
==1239523==    by 0x109DB80: execute_ranger_vrp(function*, bool, bool)
(tree-vrp.cc:1107)
==1239523==    by 0xD3A0EA: execute_one_pass(opt_pass*) (passes.cc:2651)
==1239523==    by 0xD3A9AF: execute_pass_list_1(opt_pass*) (passes.cc:2760)
==1239523==    by 0xD3A9C1: execute_pass_list_1(opt_pass*) (passes.cc:2761)
==1239523==  Address 0x4 is not stack'd, malloc'd or (recently) free'd
==1239523==
during GIMPLE pass: evrp
/tmp/foo.cxx: In constructor 'Clock::Clock()':
/tmp/foo.cxx:14:31: internal compiler error: Segmentation fault
   14 | Clock::Clock() { ClockImpl(); }
      |                               ^

0xe10df3 crash_signal
       
/usr/src/debug/sys-devel/gcc-13.1.1_p20230513/gcc-13-20230513/gcc/toplev.cc:314
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.
```

It crashes without valgrind too, just less informative.

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

end of thread, other threads:[~2023-05-17 19:32 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-15 22:37 [Bug c++/109868] New: [13/14 regression] ICE: segmentation fault when building small C++ program sjames at gcc dot gnu.org
2023-05-15 22:40 ` [Bug c++/109868] " sjames at gcc dot gnu.org
2023-05-15 22:40 ` sjames at gcc dot gnu.org
2023-05-15 22:43 ` [Bug tree-optimization/109868] [13/14 regression] ICE: segmentation fault or ICE in min_value with zero sized bitfield pinskia at gcc dot gnu.org
2023-05-15 22:45 ` pinskia at gcc dot gnu.org
2023-05-15 22:52 ` pinskia at gcc dot gnu.org
2023-05-15 22:53 ` pinskia at gcc dot gnu.org
2023-05-15 22:55 ` jakub at gcc dot gnu.org
2023-05-15 23:02 ` pinskia at gcc dot gnu.org
2023-05-15 23:02 ` jakub at gcc dot gnu.org
2023-05-15 23:06 ` sjames at gcc dot gnu.org
2023-05-16  0:13 ` pinskia at gcc dot gnu.org
2023-05-16  0:15 ` pinskia at gcc dot gnu.org
2023-05-16  4:25 ` sjames at gcc dot gnu.org
2023-05-16  8:13 ` jakub at gcc dot gnu.org
2023-05-16 15:47 ` pinskia at gcc dot gnu.org
2023-05-17  6:57 ` rguenth at gcc dot gnu.org
2023-05-17  8:16 ` cvs-commit at gcc dot gnu.org
2023-05-17 19:27 ` cvs-commit at gcc dot gnu.org
2023-05-17 19:28 ` jakub at gcc dot gnu.org
2023-05-17 19:32 ` cvs-commit 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).