This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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: ldrb vs ldrh in gcc-3.4.4 (ARM)


On Fri, 19 Aug 2005, Richard Earnshaw wrote:

Besides the efficiency argument this can get you into _serious_
trouble if you need to access hardware, for example a flash chip, with
a certain data width. I always hated that GCC couldn't be bothered to
tell when it breaks up a "volatile unsigned long *" into smaller
units. Regardless of C's weak types, I believe breaking a "volatile"
is a serious offense on GCC's part. Or did I miss some fancy warning
option?

Now I think you are spreading FUD.

Don't want to, for sure. I apologize for the "volatile unsigned long". I actually encountered this with a "volatile unsigned short", which you correctly indicated. And, yes, it is an architectural thing and that is why I mentioned it here. All I'm saying is you have to select the proper arch for certain low-level operations, which is a common task for members of this list. If you forget to do so, GCC might silently break the short into two byte accesses. However, while this is the only option GCC has on that arch, it could still emit a warning. If you have ever had such a bug, you just don't forget :-)


Regards,
Marius

--
Marius Groeger <mgroeger@sysgo.com>
SYSGO AG                      Embedded and Real-Time Software
Voice: +49 6136 9948 0                  FAX: +49 6136 9948 10
www.sysgo.com | www.elinos.com | www.osek.de | www.pikeos.com


------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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