[PATCH] D24669: {Sema] Gcc compatibility of vector shift.

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 26 07:11:19 PDT 2016


aaron.ballman added a comment.

In https://reviews.llvm.org/D24669#548984, @vbyakovlcl wrote:

> Clang 3.8 balances vector shift operand erroneous using CheckVectorOperands which converts one of operand to the type of another. In https://reviews.llvm.org/D21678 it was fixed by using checkVectorShift instead. As result clang does not emit error if shift operands have different element sizes (bat gcc does).


Ah, thank you for the explanation!


================
Comment at: llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td:522
@@ -521,2 +521,3 @@
 def GNUZeroVariadicMacroArguments : DiagGroup<"gnu-zero-variadic-macro-arguments">;
+def GNUVecElemSize : DiagGroup<"gnu-vec-elem-size">;
 def Fallback : DiagGroup<"fallback">;
----------------
Is this the same warning flag GCC uses?

================
Comment at: llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td:2306
@@ -2304,1 +2305,3 @@
+  "vector operands do not have the same elements sizes (%0 and %1)">,
+  InGroup<GNUVecElemSize>, DefaultIgnore;
 def err_ext_vector_component_exceeds_length : Error<
----------------
Why is this off by default?


Repository:
  rL LLVM

https://reviews.llvm.org/D24669





More information about the cfe-commits mailing list