[PATCH] D61046: Fix compilation warnings when compiling with GCC 7.3

Tom Stellard via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 23 18:19:52 PDT 2019


tstellar added inline comments.


================
Comment at: llvm/trunk/lib/Target/AMDGPU/R600ISelLowering.cpp:1717-1722
+    // Fix spurious warning with gcc 7.3 -O3 for NewBldVec[i] below
+    // warning: array subscript is above array bounds [-Warray-bounds]
+#if defined(__GNUC__) && __GNUC__ >= 7 && __GNUC_MINOR__ >= 3
+    if (i >= 4)
+      continue;
+#endif
----------------
We don't want to  have ifdefs for specific compilers, can this be fixed another way or dropped from the patch?


================
Comment at: llvm/trunk/unittests/IR/ConstantRangeTest.cpp:398-401
+#if defined(__GNUC__) && __GNUC__ >= 7
+        // Silence warning: variable 'HaveInterrupt3' set but not used
+        (void)&HaveInterrupt3;
+#endif
----------------
Same here, no compiler specific ifdefs.


================
Comment at: llvm/trunk/unittests/Transforms/Scalar/CMakeLists.txt:14-17
+# Workaround for the gcc 6.1 bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80916.
+if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
+  set_source_files_properties(LoopPassManagerTest.cpp PROPERTIES COMPILE_FLAGS -Wno-unused-function)
+endif()
----------------
Same thing here too.


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

https://reviews.llvm.org/D61046





More information about the cfe-commits mailing list