This is the mail archive of the gcc-patches@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]

Re: Renaming -mshort-load-bytes


> Nick Clifton wrote:
> > 
> >   I have decided that it is time I got around to fixing the
> >   -mshort-load-bytes and -mshort-load-words switches for the ARM
> 
> I agree, these switches are confusing to say the least.
> 
> >   Replace both switches with just one switch:
> > 
> >     -mno-unaligned-word-loads
> > 
> >   Obviously the old switches would still be recognised, but they would
> >   no longer be documented.
> 
> After looking in the manual, most options beginning with -mno- have an
> equivalent positive form.  If you don't want to specify a positive form
> for this why not have -munaligned-word-loads turn on the ability to do
> the unaligned load hack, and leave it off by default.
> I'd also like to see this have no effect in armv4; there we should use
> the halfword instructions.

As I suggested previously, my preference would be for -maligment-traps 
(with the default for this being off, which is compatible with the 
existing compiler).  The option has no (has never had any) effect on 
architecture 4 or higher, since the compiler does not need to emit 
unaligned word accesses on machines with half-word instructions.  On 
machines prior to that, you get significantly better half-word code if you 
don't unnecessarily enable this option.

> I really don't care if the old switches are recognized.  I'd also like
> to see the documentation explicitly mention the behaviour to be expected
> of code compiled with this option in the presence/absence of a fault
> handler.  The NetWinder typically runs a Linux kernel with an alignment
> fault handler.

There is nothing to stop a particular target adding this option to its 
TARGET_DEFAULT; and indeed it should if the kernel is configured to fault 
such accesses.  As I said above, this won't change the code if compiled 
for architecture 4, but will prevent unalligned accesses if compiling for 
an earlier architecture.

I would prefer the old switches to go, but it is usual to delay this by at 
least one major release.

R.


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