public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/112601] New: ICE in cgraph_node::verify_node(): error: invalid calls_comdat_local flag
@ 2023-11-17 21:58 slyfox at gcc dot gnu.org
  2023-11-17 22:26 ` [Bug ipa/112601] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: slyfox at gcc dot gnu.org @ 2023-11-17 21:58 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112601
           Summary: ICE in cgraph_node::verify_node(): error: invalid
                    calls_comdat_local flag
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Encountered the bug when tried to build llvm-17.0.5 with -O1 optimization
flags. 
Looks like all the gcc versions I tried fail starting from gcc-10 including
current gcc-master r14-5563-gbc274b8d677212.

Extracted reproducer:

// $ cat a.cpp
bool neq(int, int);
int begin();
int end();
void deref(int);
struct Twine {
  Twine(const char *);
};
int &out(int, Twine);
void out6(int, Twine);
static void printChar(int &, char) {}
int emitStringLiteralDef_OS, emit_OS, emit_I;
char emit___trans_tmp_1;
struct SequenceToOffsetTable {
  void emitStringLiteralDef(Twine Decl) {
    emit(printChar);
    int __trans_tmp_6 = out(emitStringLiteralDef_OS, ""),
        __trans_tmp_5 = out(__trans_tmp_6, ""),
        __trans_tmp_4 = out(__trans_tmp_5, ""),
        __trans_tmp_3 = out(__trans_tmp_4, ""),
        __trans_tmp_2 = out(__trans_tmp_3, Decl);
    out6(__trans_tmp_2, "");
  }
  void emit(void Print(int &, char)) {
    for (int E = 0; neq(emit_I, E);)
      for (int SI = (deref(emit_I), begin)(), SE = (deref(emit_I), end)();
           neq(SI, SE);)
        Print(emit_OS, emit___trans_tmp_1);
  }
};
void run() {
  SequenceToOffsetTable RegStrings;
  RegStrings.emitStringLiteralDef(0);
}

Crashing:

$ gcc/xg++ -B./gcc -O1 -fchecking=2 -c a.cpp -o a.o

a.cpp: In member function 'void
SequenceToOffsetTable::emitStringLiteralDef(Twine)':
a.cpp:14:8: error: invalid calls_comdat_local flag
   14 |   void emitStringLiteralDef(Twine Decl) {
      |        ^~~~~~~~~~~~~~~~~~~~
_ZN21SequenceToOffsetTable20emitStringLiteralDefE5Twine/5 (void
SequenceToOffsetTable::emitStringLiteralDef(Twine))
  Type: function definition analyzed
  Visibility: externally_visible semantic_interposition public weak comdat
comdat_group:_ZN21SequenceToOffsetTable20emitStringLiteralDefE5Twine one_only
  Same comdat group as: _ZL9printCharRic/0
  References:
  Referring:
  Availability: available
  Function flags: count:1073741824 (estimated locally) body
  Called by: _Z3runv/7 (1073741824 (estimated locally),1.00 per call) (can
throw external)
  Calls: _Z3neqii/15 (9761289262 (estimated locally),9.09 per call) (can throw
external) _Z3neqii/15 (78977704412 (estimated locally),73.55 per call) (can
throw external) _ZL9printCharRic/0 (70290156974 (estimated locally),65.46 per
call) (can throw external) _Z3endv/14 (8687547438 (estimated locally),8.09 per
call) (can throw external) _Z5derefi/12 (8687547438 (estimated locally),8.09
per call) (can throw external) _Z5beginv/13 (8687547438 (estimated
locally),8.09 per call) (can throw external) _Z5derefi/12 (8687547438
(estimated locally),8.09 per call) (can throw external) _Z4out6i5Twine/11
(1073741824 (estimated locally),1.00 per call) (can throw external)
_ZN5TwineC1EPKc/8 (1073741824 (estimated locally),1.00 per call) (can throw
external) _Z3outi5Twine/10 (1073741824 (estimated locally),1.00 per call) (can
throw external) _Z3outi5Twine/10 (1073741824 (estimated locally),1.00 per call)
(can throw external) _ZN5TwineC1EPKc/8 (1073741824 (estimated locally),1.00 per
call) (can throw external) _Z3outi5Twine/10 (1073741824 (estimated
locally),1.00 per call) (can throw external) _ZN5TwineC1EPKc/8 (1073741824
(estimated locally),1.00 per call) (can throw external) _Z3outi5Twine/10
(1073741824 (estimated locally),1.00 per call) (can throw external)
_ZN5TwineC1EPKc/8 (1073741824 (estimated locally),1.00 per call) (can throw
external) _Z3outi5Twine/10 (1073741824 (estimated locally),1.00 per call) (can
throw external) _ZN5TwineC1EPKc/8 (1073741824 (estimated locally),1.00 per
call) (can throw external)
during IPA pass: inline
a.cpp:14:8: internal compiler error: verify_cgraph_node failed
0x258970b diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char
const*, __va_list_tag (*) [1], diagnostic_t)
        ???:0
0x258a52e internal_error(char const*, ...)
        ???:0
0xc767c2 cgraph_node::verify_node()
        ???:0
0xc64d11 symtab_node::verify()
        ???:0
0x1276003 optimize_inline_calls(tree_node*)
        ???:0
0xf10813 inline_transform(cgraph_node*)
        ???:0
0x10a320e execute_all_ipa_transforms(bool)
        ???:0
0xc7b6e8 cgraph_node::expand()
        ???:0
0xc7d219 symbol_table::compile()
        ???:0
0xc7fce4 symbol_table::finalize_compilation_unit()
        ???:0

$ gcc/xg++ -B./gcc -v
Reading specs from ./gcc/specs
COLLECT_GCC=./gcc/xg++
COLLECT_LTO_WRAPPER=./gcc/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/slyfox/dev/git/gcc/configure --disable-multilib
--disable-bootstrap --disable-lto --disable-libsanitizer
--disable-libstdcxx-pch --enable-languages=c,c++ --disable-libgomp
--disable-libquadmath --disable-libvtv CFLAGS='-O1 -g0' CXXFLAGS='-O1 -g0'
LDFLAGS='-O1 -g0'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231117 (experimental) (GCC)

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

* [Bug ipa/112601] [11/12/13/14 Regression] ICE in cgraph_node::verify_node(): error: invalid calls_comdat_local flag
  2023-11-17 21:58 [Bug ipa/112601] New: ICE in cgraph_node::verify_node(): error: invalid calls_comdat_local flag slyfox at gcc dot gnu.org
@ 2023-11-17 22:26 ` pinskia at gcc dot gnu.org
  2023-11-18  0:21 ` pinskia at gcc dot gnu.org
  2023-11-20  9:24 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-17 22:26 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.5
      Known to fail|                            |10.1.0
            Summary|ICE in                      |[11/12/13/14 Regression]
                   |cgraph_node::verify_node(): |ICE in
                   |error: invalid              |cgraph_node::verify_node():
                   |calls_comdat_local flag     |error: invalid
                   |                            |calls_comdat_local flag
      Known to work|                            |9.5.0
           Keywords|                            |ice-on-valid-code

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

* [Bug ipa/112601] [11/12/13/14 Regression] ICE in cgraph_node::verify_node(): error: invalid calls_comdat_local flag
  2023-11-17 21:58 [Bug ipa/112601] New: ICE in cgraph_node::verify_node(): error: invalid calls_comdat_local flag slyfox at gcc dot gnu.org
  2023-11-17 22:26 ` [Bug ipa/112601] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
@ 2023-11-18  0:21 ` pinskia at gcc dot gnu.org
  2023-11-20  9:24 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-18  0:21 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-11-18
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. Looks like an older regression.

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

* [Bug ipa/112601] [11/12/13/14 Regression] ICE in cgraph_node::verify_node(): error: invalid calls_comdat_local flag
  2023-11-17 21:58 [Bug ipa/112601] New: ICE in cgraph_node::verify_node(): error: invalid calls_comdat_local flag slyfox at gcc dot gnu.org
  2023-11-17 22:26 ` [Bug ipa/112601] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
  2023-11-18  0:21 ` pinskia at gcc dot gnu.org
@ 2023-11-20  9:24 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-11-20  9:24 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

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

end of thread, other threads:[~2023-11-20  9:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-17 21:58 [Bug ipa/112601] New: ICE in cgraph_node::verify_node(): error: invalid calls_comdat_local flag slyfox at gcc dot gnu.org
2023-11-17 22:26 ` [Bug ipa/112601] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
2023-11-18  0:21 ` pinskia at gcc dot gnu.org
2023-11-20  9:24 ` 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).