Index: llvm/trunk/lib/Target/AMDGPU/R600ISelLowering.cpp =================================================================== --- llvm/trunk/lib/Target/AMDGPU/R600ISelLowering.cpp +++ llvm/trunk/lib/Target/AMDGPU/R600ISelLowering.cpp @@ -1714,6 +1714,12 @@ if (NewBldVec[i].isUndef()) continue; + // Fix spurious warning with gcc 7.3 -O3 + // warning: array subscript is above array bounds [-Warray-bounds] + // if (NewBldVec[i] == NewBldVec[j]) { + // ~~~~~~~~~~~^ + if (i >= 4) + continue; for (unsigned j = 0; j < i; j++) { if (NewBldVec[i] == NewBldVec[j]) { NewBldVec[i] = DAG.getUNDEF(NewBldVec[i].getValueType()); Index: llvm/trunk/unittests/IR/ConstantRangeTest.cpp =================================================================== --- llvm/trunk/unittests/IR/ConstantRangeTest.cpp +++ llvm/trunk/unittests/IR/ConstantRangeTest.cpp @@ -459,6 +459,7 @@ } } + (void)HaveInterrupt3; assert(!HaveInterrupt3 && "Should have at most three ranges"); ConstantRange SmallestCR = OpFn(CR1, CR2, ConstantRange::Smallest); Index: llvm/trunk/unittests/Support/TypeTraitsTest.cpp =================================================================== --- llvm/trunk/unittests/Support/TypeTraitsTest.cpp +++ llvm/trunk/unittests/Support/TypeTraitsTest.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/type_traits.h" +#include "gtest/gtest.h" namespace { @@ -71,6 +72,26 @@ template void TrivialityTester(); template void TrivialityTester(); +TEST(Triviality, Tester) { + TrivialityTester(); + TrivialityTester(); + TrivialityTester(); + TrivialityTester(); + + TrivialityTester(); + TrivialityTester(); + TrivialityTester(); + TrivialityTester(); + TrivialityTester(); + + TrivialityTester(); + TrivialityTester(); + TrivialityTester(); + TrivialityTester(); + TrivialityTester(); + TrivialityTester(); +} + } // namespace triviality } // end anonymous namespace Index: llvm/trunk/unittests/Transforms/Scalar/CMakeLists.txt =================================================================== --- llvm/trunk/unittests/Transforms/Scalar/CMakeLists.txt +++ llvm/trunk/unittests/Transforms/Scalar/CMakeLists.txt @@ -10,3 +10,8 @@ add_llvm_unittest(ScalarTests LoopPassManagerTest.cpp ) + +# 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 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) + set_source_files_properties(LoopPassManagerTest.cpp PROPERTIES COMPILE_FLAGS -Wno-unused-function) +endif() Index: llvm/trunk/unittests/Transforms/Scalar/LoopPassManagerTest.cpp =================================================================== --- llvm/trunk/unittests/Transforms/Scalar/LoopPassManagerTest.cpp +++ llvm/trunk/unittests/Transforms/Scalar/LoopPassManagerTest.cpp @@ -20,19 +20,9 @@ #include "llvm/IR/PassManager.h" #include "llvm/Support/SourceMgr.h" -// Workaround for the gcc 6.1 bug PR80916. -#if defined(__GNUC__) && __GNUC__ > 5 -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wunused-function" -#endif - #include "gmock/gmock.h" #include "gtest/gtest.h" -#if defined(__GNUC__) && __GNUC__ > 5 -# pragma GCC diagnostic pop -#endif - using namespace llvm; namespace {