public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/98160] [11 Regression] ICE in default_tree_printer at gcc/tree-diagnostic.c:270 since r11-5732-gdce6c58db87ebf7f
Date: Wed, 16 Dec 2020 15:01:03 +0000	[thread overview]
Message-ID: <bug-98160-4-85RqfsmXrh@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98160-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #7 from Martin Liška <marxin at gcc dot gnu.org> ---
New reduced test-case:

$ cat 1.ii
namespace xercesc_2_5 {
class MemoryManager;
class XMemory {
  void *operator new(unsigned long, MemoryManager *);
};
class MemoryManager {
public:
  virtual void *allocate();
};
void *XMemory::operator new(unsigned long, MemoryManager *manager) {
  long headerSize(sizeof(MemoryManager));
  void *block = manager->allocate();
  return block + headerSize;
}
} // namespace xercesc_2_5

$ cat 2.ii
namespace xercesc_2_5 {
class MemoryManager;
class XMemory {
public:
  void *operator new(unsigned long, MemoryManager *);
  void operator delete(void *, MemoryManager *);
};
class XMLPlatformUtils {
public:
  static MemoryManager *fgMemoryManager;
};
class ValueStackOf : public XMemory {
public:
  ValueStackOf(int, bool);
};
class XPathMatcherStack {
  XPathMatcherStack();
  ValueStackOf *fContextStack;
};
XPathMatcherStack::XPathMatcherStack()
    : fContextStack(new (XMLPlatformUtils::fgMemoryManager)
                        ValueStackOf(8, XMLPlatformUtils::fgMemoryManager)) {}
} // namespace xercesc_2_5

$ g++ 1.ii 2.ii -O2 -flto=16 -shared
1.ii: In static member function 'static void* xercesc_2_5::XMemory::operator
new(long unsigned int, xercesc_2_5::MemoryManager*)':
1.ii:13:16: warning: pointer of type 'void *' used in arithmetic
[-Wpointer-arith]
   13 |   return block + headerSize;
      |          ~~~~~~^~~~~~~~~~~~
during RTL pass: expand
2.ii: In member function '__ct_base ':
2.ii:22:74: internal compiler error: Segmentation fault
   22 |                         ValueStackOf(8,
XMLPlatformUtils::fgMemoryManager)) {}
      |                                                                        
 ^
0xcce44f crash_signal
        /home/marxin/Programming/gcc/gcc/toplev.c:327
0x81da08 tree_check(tree_node*, char const*, int, char const*, tree_code)
        /home/marxin/Programming/gcc/gcc/tree.h:3337
0x81da08 warn_dealloc_offset
        /home/marxin/Programming/gcc/gcc/builtins.c:13413
0x836127 maybe_emit_free_warning(tree_node*)
        /home/marxin/Programming/gcc/gcc/builtins.c:13586
0x84545e initialize_argument_information
        /home/marxin/Programming/gcc/gcc/calls.c:2629
0x84545e expand_call(tree_node*, rtx_def*, int)
        /home/marxin/Programming/gcc/gcc/calls.c:4009
0x978104 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /home/marxin/Programming/gcc/gcc/expr.c:11276
0x8590cd expand_expr
        /home/marxin/Programming/gcc/gcc/expr.h:282
0x8590cd expand_call_stmt
        /home/marxin/Programming/gcc/gcc/cfgexpand.c:2831
0x8590cd expand_gimple_stmt_1
        /home/marxin/Programming/gcc/gcc/cfgexpand.c:3835
0x8590cd expand_gimple_stmt
        /home/marxin/Programming/gcc/gcc/cfgexpand.c:3999
0x85e5fa expand_gimple_basic_block
        /home/marxin/Programming/gcc/gcc/cfgexpand.c:6036
0x8600b6 execute
        /home/marxin/Programming/gcc/gcc/cfgexpand.c:6720
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
make: *** [/tmp/cc3Mo9q4.mk:2: /tmp/ccFzg763.ltrans0.ltrans.o] Error 1
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

  parent reply	other threads:[~2020-12-16 15:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-06  9:10 [Bug tree-optimization/98160] New: " marxin at gcc dot gnu.org
2020-12-06  9:10 ` [Bug tree-optimization/98160] " marxin at gcc dot gnu.org
2020-12-07  0:32 ` msebor at gcc dot gnu.org
2020-12-08 20:47 ` msebor at gcc dot gnu.org
2020-12-14 20:31 ` cvs-commit at gcc dot gnu.org
2020-12-14 20:35 ` msebor at gcc dot gnu.org
2020-12-16 13:42 ` tnfchris at gcc dot gnu.org
2020-12-16 14:49 ` marxin at gcc dot gnu.org
2020-12-16 15:01 ` marxin at gcc dot gnu.org [this message]
2020-12-16 15:02 ` marxin at gcc dot gnu.org
2020-12-23 17:10 ` marxin at gcc dot gnu.org
2020-12-23 23:38 ` cvs-commit at gcc dot gnu.org
2020-12-23 23:50 ` msebor at gcc dot gnu.org
2023-06-14  9:43 ` cvs-commit at gcc dot gnu.org
2023-06-15  7:21 ` cvs-commit 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-98160-4-85RqfsmXrh@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).