[PATCH] [complex] Teach Clang to preserve different-type operands to arithmeticoperators where one type is a C complex type, and to emit both the efficientand correct implementation for complex arithmetic according to C11 AnnexG using this extra...

Richard Smith richard at metafoo.co.uk
Fri Oct 10 16:39:43 PDT 2014


================
Comment at: lib/AST/ExprConstant.cpp:8047-8048
@@ +8046,4 @@
+        APFloat Denom = C * C + D * D;
+        ResR = scalbn((A * C + B * D) / Denom, -DenomLogB);
+        ResI = scalbn((B * C - A * D) / Denom, -DenomLogB);
+        if (ResR.isNaN() && ResI.isNaN()) {
----------------
It looks like `B` is not initialized if `LHSReal` is `true` here.

http://reviews.llvm.org/D5698






More information about the cfe-commits mailing list