Bug 7831 - [mips] GCC 3.2 MIPS64 endian issues
Summary: [mips] GCC 3.2 MIPS64 endian issues
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.2
: P3 normal
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2002-09-04 18:56 UTC by cvansch
Modified: 2005-07-23 22:49 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: mips64el-elf
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cvansch 2002-09-04 18:56:00 UTC
gcc compiled to default to little endian, but is producing some big-endian load/stores.

Specific problem was fixed by specifiing "-EL" compiler flag.
Assembler code showed:
    1fc8:       ffa20030        sd      v0,48(sp)
...
    1fe4:       dfa20008        ld      v0,8(sp)
    1fe8:       0002103e        dsrl32  v0,v0,0x0
...
    1ffc:       dfa30008        ld      v1,8(sp)
    2000:       8fa20030        lw      v0,52(sp) <- error here, should be 48(sp)
    2004:       00431016        dsrlv   v0,v1,v0

Release:
gcc version 3.2

Environment:
x86 host, mips64el-l4-elf-gcc crosscompiler
Configured with: ./configure --target=mips64el-l4-elf --enable-64-bit-bfd --enable-languages=c --with-gnu-as --with-gnu-ld : (reconfigured) ./configure --target=mips64el-l4-elf --enable-64-bit-bfd --enable-languages=c --with-gnu-as --with-gnu-ld --prefix=/usr/local/mips : (reconfigured) ./configure --target=mips64el-l4-elf --enable-64-bit-bfd --enable-languages=c --with-gnu-as --with-gnu-ld --prefix=/usr/local/mips : (reconfigured) ./configure --target=mips64el-l4-elf --enable-64-bit-bfd --enable-languages=c,c++ --with-gnu-as --with-gnu-ld --prefix=/usr/local/mips

How-To-Repeat:
with no optimizations, the extracted code would be equivalent to:
word_t = unsigned long int

word_t i = 32;
printf("x = %x\n", (word_t) vaddr >> 32);
printf("x = %x  %x\n", (word_t) vaddr >> i, i);
Comment 1 Dara Hazeghi 2003-05-26 04:16:36 UTC
Hello,

would it be possible for you to check whether this problem is still present in gcc 3.3? Also, a 
testcase of pre-processed source would be very much appreciated (makes it possible to reproduce 
bugs on cross compilers without target headers). Thanks,

Dara
Comment 2 Andrew Pinski 2003-05-26 04:17:55 UTC
See Dara's question.
Comment 3 Dara Hazeghi 2003-06-02 04:12:52 UTC
Eric,

sorry to bother you with yet another MIPS bug report. This one looks pretty straightforward 
though. Any insights? Thanks,

Dara
Comment 4 Eric Christopher 2003-06-02 22:38:30 UTC
Subject: Re:  [mips] GCC 3.2 MIPS64 endian issues


> 
> sorry to bother you with yet another MIPS bug report. This one looks pretty straightforward 
> though. Any insights? Thanks,

I think we should suspend this one pending more info. There's nothing
that -EL should do that configuring for mipsel shouldn't. I think we
need the more information that was asked (a complete testcase would be
nice).

-eric

Comment 5 Dara Hazeghi 2003-06-03 10:25:03 UTC
Still waiting for confirmation. Could the original submitter please try to 
reproduce this with gcc 3.3, and if that fails, send a testcase?

Dara

(I think waiting is more appropriate than suspended, since that's what this 
bug's doing right now...)
Comment 6 Richard Sandiford 2003-08-22 09:27:26 UTC
No feedback in three months.  Test case seems to be compiled correctly
by CVS head.