[PATCH] D103452: [clang] Fix reading long doubles with va_arg on x86_64 mingw

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 7 10:26:24 PDT 2021


mstorsjo added inline comments.


================
Comment at: clang/test/CodeGen/mingw-long-double.c:56-58
+  // GNU32: bitcast i8* %argp.cur to x86_fp80*
+  // GNU64: bitcast i8* %argp.cur to x86_fp80**
+  // MSC64: bitcast i8* %argp.cur to double*
----------------
mstorsjo wrote:
> rnk wrote:
> > These tests will stop working after opaque pointers happens, which I hope comes in the next year. If you look for a load of the pointer type, that should be resilient to opaque pointers.
> Hmm, good point, but the test feels more brittle to me in that form:
> 
> ```
>   // GNU32: load x86_fp80, x86_fp80*
>   // GNU64: load x86_fp80*, x86_fp80**
>   // GNU64: load x86_fp80, x86_fp80*
>   // MSC64: load double, double*
> ```
> 
> That wouldn't notice if GNU32 also used an indirect pointer for this case (as it would still match the second load - but it would notice if GNU64 stopped using an indirect pointer as the first load wouldn't be matched). I guess it'd be safer if I'd use more named regex patterns in the test to follow the chain from the argp, but then we end up with a pattern covering the bits that change due to opaque pointers too.
@rnk - WDYT about how to write the test patterns - see above?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103452/new/

https://reviews.llvm.org/D103452



More information about the cfe-commits mailing list