------- Comment #4 from pinskia at gcc dot gnu dot org 2005-10-30 16:18 ------- I wonder if this is really a regression at all here is the testcase for -O2: struct pci_fixup { void (*hook)(void); }; static void __attribute__ ((__section__ (".init.text"))) pci_fixup_ide_bases(void) {} static const struct pci_fixup __pci_fixup_PCI_ANY_IDPCI_ANY_IDpci_fixup_ide_bases __attribute__((__used__)) __attribute__((__section__(".pci_fixup_header"))) = { pci_fixup_ide_bases }; static int __attribute__ ((__section__ (".init.text"))) toshiba_ohci1394_dmi_table[] = {}; static void __attribute__ ((__section__ (".init.text"))) pci_pre_fixup_toshiba_ohci1394(void) { dmi_check_system(toshiba_ohci1394_dmi_table); } static const struct pci_fixup __pci_fixup_PCI_VENDOR_ID_TI0x8032pci_pre_fixup_toshiba_ohci1394 __attribute__((__used__)) __attribute__((__section__(".pci_fixup_header"))) = {pci_pre_fixup_toshiba_ohci1394 };
---- This fails with 2.95.3 3.0.4 3.3.3 3.4.0, 4.0.0 and 4.1.0. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24585