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 middle-end/54821] Microblaze: Position independent code for byte access is incorrect.


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54821

--- Comment #1 from qball at sarine dot nl 2012-10-05 13:17:17 UTC ---
For 4.6.2 (xilinx) this seems to fix the code generation:
mb_gnu/src/gcc/gcc/config/microblaze/microblaze.c
temp/mb_gnu/src/gcc/gcc/config/microblaze/microblaze.c
@@ -558,7 +558,7 @@
       {
         return !(flag_pic && pic_address_needs_scratch (x));
       }
-    else if (flag_pic == 2)
+    else if (flag_pic)
       {
         return false;
       }

Generates:
    addik    r1,r1,-16
    swi    r19,r1,8
    swi    r20,r1,12
    addk    r19,r1,r0
    lwi    r3,r20,temp@GOT
    lbui    r3,r3,0
    sext8    r3,r3
    addk    r4,r3,r0
    lwi    r3,r20,temp2@GOT
    lwi    r3,r3,0
    addk    r4,r4,r3
    lwi    r3,r20,temp4@GOT
    lhui    r3,r3,0
    sext16    r3,r3
    addk    r3,r4,r3
    swi    r3,r19,4
    addk    r1,r19,r0
    lwi    r19,r1,8
    lwi    r20,r1,12
    addik    r1,r1,16
    rtsd    r15,8
    nop        # Unfilled delay slot


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