[PATCH] Improve error handling of x86 inline-asm constraint "=f"

Akira Hatanaka ahatanak at gmail.com
Thu Jul 17 23:05:38 PDT 2014

I am retracting this patch. After sending the patch, I realized this error
would be better handled by clang.

On Thu, Jul 17, 2014 at 4:42 PM, Akira Hatanaka <ahatanak at gmail.com> wrote:

> This patch makes the following changes to improve error handling of x86
> inline-asm constraint '=f'. According to the following link, it is a
> mistake to use the 'f' constraint for output operands.
> https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html
> 1. Override TargetLowering::ComputeConstraintToUse so that this error can
> be detected during instruction selection. Currently, it's detected in the
> x86 FP stackifier pass (X86FloatingPoint.cpp), which is a pass that is run
> much later.
> 2. Terminate immediately after this error is detected. Currently, clang
> continues compiling the program after seeing this error, because the
> inline-asm diagnostic handler that is installed doesn't terminate upon
> seeing this error. As an example of why this is bad, I attached a program
> that exposes an internal error when compiled with clang. clang didn't stop
> compiling until it hit a call to report_fatal_error.
> *main.c:17:7: **error: **illegal "f" output constraint*
>       ".intel_syntax\n"
> *      ^*
> *fatal error: *error in backend: Access past stack top!
> <rdar://problem/17476689>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140717/0b9b1d8c/attachment.html>

More information about the llvm-commits mailing list