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]

GCC not awre of MMU


Hello,
 I am using: GCC
Configured with: ../gcc-3.0.4/configure --target=powerpc-ibm-eabi
--with-newlib
i686-ibm-cygwin
Thread model: single
gcc version 3.0.4

I am porting a firmware to PPC 403cr
an I am using Memory Management Unit MMU to access litle endian Hardware.

The MMU is configured to have both Big-endian and Little endian Spaces.

Now to my Problem:

I have a code line like :

short a = (short)((PointerToMyStruct->ALongValue)+5);

this generates for Power PC
a Assamblercode like :(Pseudo Code)
Load lower halfword from ALongValue to Register 9 
add 5 to register 9
save lower halfword in a;

But this Code would work only Correct If  there would not be a MMU wich
swaps Litle Endian to Big-endian Values in some part of Memory !!!
Is there a Posibility to tell GCC there is a MMU so he can not predict the
endiness  and generate Code like:
(Pseudo Code)

Load WORD (not halfword!) from ALongValue
Add 5
store lower half word in a.



Thank You Very much !








SIEMENS
			Postal Address
			Siemens AG, A&D PT 2 D
			D-76187 Karlsruhe

			Office Address:
			Oestliche Rheinbrueckenstrasse 50
			D-76187 Karlsruhe
Dipl.-Ing.                      
Philipp Schäfer		Tel.  +49 (0)721 595-7030
R & D Engineer		Fax  +49 (0)721 595-2326
			mailto:philipp.schaefer@siemens.com



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