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]

Re: target/7815: ARM Bug


> 
> Hi,
> 
> Thanks for the explanation. But shouldn't gcc know that=20
> 
> ldr r0, [r3, #2]
> 
> will try to read a 32-bit word at a non 32-bit boundary thus causing an =
> alignment fault?

You only get code that is safe from alignment traps if you compile with 
-malignment-traps.

> 
> Shouldn't it use the ldrh (load halfword) instruction?

For that you need -march=armv4

R.

Note that armv4 code will never generate alignment traps since it has no 
need to generate unaligned memory instructions.





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