------- Comment #22 from hjl dot tools at gmail dot com 2009-10-29 19:30 ------- IPA-SRA miscompiled get_got in elf64-ia64.c:
got = ia64_info->root.sgot; if (!got) { flagword flags; dynobj = ia64_info->root.dynobj; if (!dynobj) ia64_info->root.dynobj = dynobj = abfd; if (!_bfd_elf_create_got_section (dynobj, info)) return 0; got = ia64_info->root.sgot; ia64_info->root.sgot is NULL and _bfd_elf_create_got_section is called to create one. However, IPA-SRA turns get_got (struct bfd * abfd, struct bfd_link_info * info, struct elf64_ia64_link_hash_table * ia64_info) into get_got (struct bfd * abfd, struct bfd_link_info * info, struct bfd * * ISRA.111, struct asection * ISRA.112) Where does "struct asection * ISRA.112" come from? It doesn't look right. It then generates: <bb 5>: # dynobj_3 = PHI <dynobj_6(3), abfd_7(D)(4)> # DEBUG dynobj => dynobj_3 D.16894_10 = _bfd_elf_create_got_section (dynobj_3, info_9(D)); if (D.16894_10 == 0) goto <bb 10>; else goto <bb 6>; <bb 6>: got_12 = ISRA.112_15(D); and later we get # dynobj_362 = PHI <dynobj_361(104), abfd_39(D)(105)> # DEBUG dynobj => dynobj_362 D.18569_363 = _bfd_elf_create_got_section (dynobj_362, info_35(D)); if (D.18569_363 == 0) goto <bb 111>; else goto <bb 107>; <bb 107>: got_364 = D.18212_262; Withot IPA-SRA, we get D.16894_10 = _bfd_elf_create_got_section (dynobj_3, info_9(D)); if (D.16894_10 == 0) goto <bb 10>; else goto <bb 6>; <bb 6>: got_12 = ia64_info_4(D)->root.sgot; -- hjl dot tools at gmail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- GCC build triplet|x86_64-unknown-linux-gnu | GCC host triplet|x86_64-unknown-linux-gnu | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41750