This is the mail archive of the gcc-help@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: Can I force a word read-modify-write instread of a byte write?


Andrew Haley <aph-gcc@littlepinkcloud.COM> writes:

>  > There is nothing in gcc which will force it to use 32-bit memory
>  > accesses if you don't explicitly write 32-bit memory accesses.
> 
> You could hack the md file to add a new predicate to 8-bit memory
> accesses.  Wouldn't that cause gcc to generate the necessary 32-bit
> shifts and masks?

It would be easy to disable all 8-bit memory accesses.  Hacking the MD
file to test for a specific attribute on pointers wouldn't work
reliably.  An 8-bit variable would get promoted into a register,
reload would eventually try to spill that register back to its memory
location, and at that point it would crash.

Ian


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