This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/61599] [x86_64] With -mcmodel=medium, extern global arrays without size are not treated conservatively.


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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]