This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/61599] [x86_64] With -mcmodel=medium, extern global arrays without size are not treated conservatively.
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 12 May 2016 21:24:40 +0000
- Subject: [Bug target/61599] [x86_64] With -mcmodel=medium, extern global arrays without size are not treated conservatively.
- Auto-submitted: auto-generated
- References: <bug-61599-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61599
--- Comment #4 from UroÅ Bizjak <ubizjak at gmail dot com> ---
(In reply to UroÅ Bizjak from comment #3)
> Reopened, it looks that some sections are not handled correctly.
Following patch fixes the failure:
Index: i386.c
===================================================================
--- i386.c (revision 236182)
+++ i386.c (working copy)
@@ -15475,7 +15475,7 @@ legitimize_pic_address (rtx orig, rtx reg)
new_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_PCREL);
new_rtx = gen_rtx_CONST (Pmode, new_rtx);
}
- else if (TARGET_64BIT && ix86_cmodel != CM_LARGE_PIC)
+ else if (TARGET_64BIT && ix86_cmodel == CM_SMALL_PIC)
{
new_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr),
UNSPEC_GOTPCREL);