[PATCH] [ARM] Produce an error message if -arm-no-strict-align is specified with the v6M arch.

Charlie Turner charlie.turner at arm.com
Thu Oct 23 07:01:47 PDT 2014


Hi Renato,
 
> I'd expect Clang to get that first (you know how it has deep knowledge of architectures...), but I think having this error here also makes sense, for other front-ends.

I should have given more context for this patch. I recently committed a change to Clang that issues a diagnostic if you give a set of arguments such as

clang -c -target thumbv6m-none-linux-eabi -mcpu=cortex-m0 -munaligned-access empty.c

to the clang driver  but overlooked that llc also ignored the equivalent set of inconsistent options. So yes, the error would get caught by clang in this case by a user, but when using llc directly or as you say from another front-end, I think and error should be reported. 

> I've looked around that the use of fatal_error in ARM code is not so often, wasn't there a hook on the driver to report errors a bit more friendly?

I modelled the error reporting off what happens when you say,

$ llc -mtriple=arm-none-eabi -mcpu=cortex-m0 empty.ll 
LLVM ERROR: CPU: 'cortex-m0' does not support ARM mode execution!

That error is given from the ARMTargetMachine::ARMTargetMachine constructor in lib/Target/ARM/ARMTargetMachine.cpp. Having discussed this with some other people, I'm getting the impression that such error checking for inconsistent options when using llc is unnecessary. If you agree then I'm happy to retract this patch.

Thanks for your time,
Charlie.







More information about the llvm-commits mailing list