Subject: Re: Strange C compiler code generation
To: Richard Earnshaw <rearnsha@buzzard.freeserve.co.uk>
From: Peter Teichmann <teich-p@rcs.urz.tu-dresden.de>
List: port-arm32
Date: 02/24/2001 23:39:12
> > Many 32-Bit-Loads were not done using a LDR instruction, but using 4 =
single
> > LDRB instructions and 3 ORR instructions. Is that intended and if yes=
, why?
> > Probably many NetBSD applications will be quite slow because of this!
> >=20
> > I could imagine one reason: 32 bit quantities are not necessarily 32 =
bit aligned
> > in structures, but if that is really true, well, I better do not cont=
inue this
> > thought!
>=20
> Are your structures marked as packed?  If not, what compilation flags a=
re=20
> being used?

Hm. They are. But: Still all variables are 32 bit aligned! And: Using gcc=
 2.95.2
under Linux or RiscOS I do not get this strange behaviour. Why does NetBS=
D
still use egcs?

One example structure looks like this:

#pragma pack(1)

struct test {
  int a,b;
};

#pragma pack()

If I now do access the content of this structure, the ints are accessed b=
y 4
LDRBs and 3 ORRs, which is absolutely not necessary.

Is there a chance that NetBSD/arm32 will soon use gcc 2.95.2?

Peter Teichmann
--=20
Email: teich-p@rcs.urz.tu-dresden.de   WWW: rcswww.urz.tu-dresden.de/~tei=
ch-p