https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128260
Bug ID: 128260
Summary: ICE at O2: verify_cgraph_node failed
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: bic60176 at gmail dot com
Target Milestone: ---
Created attachment 66020
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=66020&action=edit
testcase
Compiler Explorer: https://godbolt.org/z/vWY8GsE58
Console:
<source>:20:1: warning: 'alias_no_malloc' alias between functions of
incompatible types 'void(int)' and 'void *(int)' [-Wattribute-alias=]
20 | alias_no_malloc (int); /* { dg-warning ".alias_no_malloc.
specifies less restrictive attributes than its target .target_malloc.:
.alloc_size., .malloc." } */
| ^~~~~~~~~~~~~~~
<source>:16:1: note: aliased declaration here
16 | target_malloc (int n) /* { dg-message ".alias_no_malloc.
target declared here" } */
| ^~~~~~~~~~~~~
<source>:81:1: error: malloc attribute should be used for a function that
returns a pointer
81 | alias_cold; /* { dg-warning ".alias_cold. specifies
less restrictive attribute than its target .target_cold.: .cold." } */
| ^~~~~~~~~~
alias_no_malloc/4 (alias_no_malloc)
Type: function definition analyzed alias
Visibility: externally_visible semantic_interposition public
References: target_malloc/3 (alias)
Referring:
Availability: available
Function flags: decl_is_malloc
Called by:
Calls:
<source>:81:1: internal compiler error: verify_cgraph_node failed
0x2912368 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x2906fab internal_error(char const*, ...)
???:0
0xcd0b08 cgraph_node::verify_node()
???:0
0xcbd7d4 symtab_node::verify()
???:0
0xcbe9b7 symtab_node::verify_symtab_nodes()
???:0
0xcda356 symbol_table::finalize_compilation_unit()
???:0
/cefs/7f/7fa6d45b591391d387e52988_gcc-trunk-20261028/bin/../libexec/gcc/x86_64-linux-gnu/17.0.0/cc1
-quiet -imultiarch x86_64-linux-gnu -iprefix
/cefs/7f/7fa6d45b591391d387e52988_gcc-trunk-20261028/bin/../lib/gcc/x86_64-linux-gnu/17.0.0/
<source> -quiet -dumpdir /app/ -dumpbase output.c -dumpbase-ext .c -masm=intel
-mtune=generic -march=x86-64 -g -O2 -fdiagnostics-color=always -fno-verbose-asm
-o /app/output.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1