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

            Bug ID: 128256
           Summary: ICE at O2: in operand_equal_p, at fold-const.cc:3498
           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 66015
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=66015&action=edit
testcase

Compiler Explorer: https://godbolt.org/z/Kn3bzfh4c
Console: 
<source>: In function 'bar':
<source>:6:3: internal compiler error: in operand_equal_p, at
fold-const.cc:3498
    6 |   char *t = (((foo ()).c) - ((foo ()).c)); /* { dg-error "13:invalid
use of non-lvalue array" } */
      |   ^~~~
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
0xa9f008 fancy_abort(char const*, int, char const*)
        ???:0
0xdf319e operand_compare::operand_equal_p(tree_node*, tree_node const*,
tree_node*, tree_node const*, unsigned int)
        ???:0
0xdf27cb operand_compare::verify_hash_value(tree_node const*, tree_node const*,
unsigned int, bool*)
        ???:0
0xdf291c operand_compare::operand_equal_p(tree_node*, tree_node const*,
tree_node*, tree_node const*, unsigned int)
        ???:0
0xe2ae3c ptr_difference_const(tree_node*, tree_node*, poly_int<1u, long>*)
        ???:0
0x1eab4d9 generic_simplify_POINTER_DIFF_EXPR(unsigned long, tree_code,
tree_node*, tree_node*, tree_node*)
        ???:0
0xe09d5a fold_binary_loc(unsigned long, tree_code, tree_node*, tree_node*,
tree_node*)
        ???:0
0xe2b904 fold(tree_node*)
        ???:0
0xb7704e c_fully_fold(tree_node*, bool, bool*, bool)
        ???:0
0xb0b177 store_init_value(unsigned long, tree_node*, tree_node*, tree_node*)
        ???:0
0xad6d34 finish_decl(tree_node*, unsigned long, tree_node*, tree_node*,
tree_node*)
        ???:0
0xb731b0 c_parse_file()
        ???:0
0xbf9479 c_common_parse_file()
        ???: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

Reply via email to