[PATCH] D108863: [AMDGPU] Fix gcc 9.3.0 warning from -Wtype-limits

Vince Bridgers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 28 03:54:48 PDT 2021


vabridgers created this revision.
vabridgers added a reviewer: foad.
Herald added subscribers: kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl, arsenm.
vabridgers requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Fixes this warning when using gcc 9.3.0

lib/Target/AMDGPU/R600GenSubtargetInfo.inc:282:62: warning: comparison
of unsigned expression < 0 is always false [-Wtype-limits]
 if (Bits[R600::FeatureLocalMemorySize0] && LocalMemorySize <0)

  LocalMemorySize = 0;


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108863

Files:
  llvm/lib/Target/AMDGPU/R600Subtarget.cpp


Index: llvm/lib/Target/AMDGPU/R600Subtarget.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/R600Subtarget.cpp
+++ llvm/lib/Target/AMDGPU/R600Subtarget.cpp
@@ -20,7 +20,10 @@
 
 #define GET_SUBTARGETINFO_TARGET_DESC
 #define GET_SUBTARGETINFO_CTOR
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wtype-limits"
 #include "R600GenSubtargetInfo.inc"
+#pragma GCC diagnostic pop
 
 R600Subtarget::R600Subtarget(const Triple &TT, StringRef GPU, StringRef FS,
                              const TargetMachine &TM)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108863.369246.patch
Type: text/x-patch
Size: 574 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210828/52eb6297/attachment.bin>


More information about the llvm-commits mailing list