[PATCH] Improve error handling of x86 inline-asm constraint "=f"
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.
> 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*
> * ^*
> *fatal error: *error in backend: Access past stack top!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-commits