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

            Bug ID: 127531
           Summary: ICE in composite_type_cond: transaction_safe on an
                    old-style definition of a previously declared function
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: captainnemo9292 at gmail dot com
  Target Milestone: ---
            Target: x86_64-linux-gnu

char *a();
  __attribute__((transaction_safe)) char *a(b) int b; { return 0; }

  $ gcc -c t.c
  t.c:2:1: internal compiler error: in composite_type_cond, at
c/c-typeck.cc:1112
  fancy_abort
  start_function(c_declspecs*, c_declarator*, tree_node*)
  c_parse_file()
  https://godbolt.org/z/nsYEvjzY1

start_function merges the old-style definition with the earlier prototype-less
declaration. transaction_safe gives the new declaration a function type
variant, and comptypes_check_for_composite rejects the pair, so the
gcc_checking_assert in composite_type_cond fires instead of a diagnostic.
PR123713 reports the identical assertion with __attribute__((ms_abi)) in
place of transaction_safe. gcc trunk 17.0.0 20260920.
  • [Bug c/127531] New: ICE in c... captainnemo9292 at gmail dot com via Gcc-bugs

Reply via email to