First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 22528
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Gavin J Stark <gcc@embisi.com>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 22528 depends on: Show dependency tree
Show dependency graph
Bug 22528 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: Opened: 2005-07-17 18:28
//Reading specs from
/usr/local/cross-arm/bin/../lib/gcc-lib/arm-linux/3.3.2/specs
//Configured with:
/home/localgjs/tnbt_cvstrees/software/tools/gcc/../../tools/gcc/configure
--target=arm-linux --disable-shared --disable-threads --with-gnu-as
--with-gnu-ld --enable-multilib --enable-languages=c
--prefix=/usr/local/cross_arm
--with-headers=/home/localgjs/tnbt_cvstrees/software/tools/gcc/../../os/linux/include/
//Thread model: single
//gcc version 3.3.2

// This fails if compiled with... /usr/local/cross-arm/bin/arm-linux-gcc -O1
-mbig-endian -march=armv3 -o test.o -c test.c
// It generates code which sets *us to be 0, not 0x800
// With not big-endian, or without optimization, or with a Thumb-capable arch,
it works
void test(unsigned short *us)
{
    *us = (unsigned short)0x800;
    return;
}

Output code from above:
Disassembly of section .text:

00000000 <test>:
   0:   e3a03000        mov     r3, #0  ; 0x0
   4:   e5c03000        strb    r3, [r0]
   8:   e5c03001        strb    r3, [r0, #1]
   c:   e1a0f00e        mov     pc, lr

If built without -big-endian the output is correct:
Disassembly of section .text:

00000000 <test>:
   0:   e3a03000        mov     r3, #0  ; 0x0
   4:   e5c03000        strb    r3, [r0]
   8:   e3a03008        mov     r3, #8  ; 0x8
   c:   e5c03001        strb    r3, [r0, #1]
  10:   e1a0f00e        mov     pc, lr

------- Comment #1 From Pawel Sikora 2005-07-17 18:50 -------
gcc-4.0.1 works fine. 
 
$ arm-linux-eabi-gcc gcc-pr22528.c -O2 -march=armv3 -S -mlittle-endian 
 
test: 
        mov     r3, #8 
        mov     r2, #0 
        strb    r3, [r0, #1] 
        strb    r2, [r0, #0] 
        mov     pc, lr 
 
$ arm-linux-eabi-gcc gcc-pr22528.c -O2 -march=armv3 -S -mbig-endian 
 
test: 
        mov     r3, #0 
        mov     r2, #8 
        strb    r3, [r0, #1] 
        strb    r2, [r0, #0] 
        mov     pc, lr 
 

------- Comment #2 From Richard Earnshaw 2005-08-12 11:13 -------
The 3.3 branch is no-longer being maintained, and this was fixed in gcc-3.4.

If you need to patch a 3.3 compiler you can apply the patch from here:

http://gcc.gnu.org/ml/gcc-patches/2003-11/msg00832.html

------- Comment #3 From Richard Earnshaw 2005-10-26 12:33 -------
*** Bug 24528 has been marked as a duplicate of this bug. ***

First Last Prev Next    No search results available      Search page      Enter new bug