[PATCH] Fix crash when using NEON array types in inline ASM

Oliver Stannard Oliver.Stannard at arm.com
Thu Nov 14 04:58:40 PST 2013


Hi Tim,

Thanks for the suggestion, I have attached a patch which falls back to the generic code. However, I have not been able to reproduce your assertion when building with clang. Both clang and llc give the error message "couldn't allocate output register for constraint 'w'", then exit with no further errors or assertions. What command-line are you using to run clang?

Oliver

-----Original Message-----
From: Tim Northover [mailto:t.p.northover at gmail.com]
Sent: 14 November 2013 01:07
To: Oliver Stannard
Cc: llvm-commits
Subject: Re: [PATCH] Fix crash when using NEON array types in inline ASM

Hi Oliver,

> The following code causes a crash in the LLVM backend, as uint8x8x4_t is a
> struct containing an array, which is not handled by the ARM backend. This
> patch prevents the crash.

This seems to be slightly in conflict with some generic code to handle
this situation. If, instead of calling report_fatal_error you defer to
generic code, it eventually reaches
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:6435 which reports
the error in a different (probably less panicked and more friendly)
way.

If it stopped there, that would be perfect. Unfortunately for some
reason Clang (but not llc) decides to carry on regardless and reaches
another assertion.

So basically, I think there are two issues here:
1. ARM should defer to the generic handling for invalid constraints by
"break;"ing in the bad case.
2. We should work out why the generic code is crashing Clang. That way
al targets can benefit (for example I can produce similar failures on
X86 and AArch64 suffers from exactly the same issue).

Cheers.

Tim.


-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.

ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No:  2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No:  2548782
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inline-asm-neon-arrays-2.patch
Type: application/octet-stream
Size: 1731 bytes
Desc: inline-asm-neon-arrays-2.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131114/e02c0e00/attachment.obj>


More information about the llvm-commits mailing list