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

            Bug ID: 110276
           Summary: [13 Regression] ICE building efibootguard on
                    x86_64-linux-gnu
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: doko at gcc dot gnu.org
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

seen with the gcc-13 branch 20230611 on x86_64-linux-gnu:

works with -O1, fails with -O2

$ cat itco.i
typedef long (*EFI_PCI_IO_PROTOCOL_CONFIG)();
typedef struct {
  EFI_PCI_IO_PROTOCOL_CONFIG Read;
} EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS;
typedef struct {
  EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS Pci;
} EFI_PCI_IO_PROTOCOL;
int init_regs_0;
static void __attribute__((constructor)) init(EFI_PCI_IO_PROTOCOL *pci_io) {
  if (init_regs_0)
    pci_io->Pci.Read();
}
$ gcc -c -O2 -std=gnu99 -fpic -fshort-wchar -ffreestanding -fno-strict-aliasing
-fno-stack-protector itco.i 
during IPA pass: sra
itco.i:12:1: internal compiler error: in adjust_parameter_descriptions, at
ipa-sra.cc:4263
   12 | }
      | ^
0x74317d adjust_parameter_descriptions
        ../../src/gcc/ipa-sra.cc:4263
0x74317d ipa_sra_analysis
        ../../src/gcc/ipa-sra.cc:4427
0x74317d execute
        ../../src/gcc/ipa-sra.cc:4554
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.

Reply via email to