-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
Labels
code-qualityflangFlang issues not falling into any other categoryFlang issues not falling into any other categorygood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute
Description
When building Flang with the most current gcc (top of the tree), I'm seeing:
FAILED: tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/ConvertCall.cpp.o
/usr/local/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D_LIBCPP_ENABLE_HARDENED_MODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/tools/flang/lib/Lower -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/flang/lib/Lower -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/flang/include -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/tools/flang/include -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/include -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/llvm/include -isystem /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/llvm/../mlir/include -isystem /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/tools/mlir/include -isystem /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/tools/clang/include -isystem /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG -fno-semantic-interposition -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/ConvertCall.cpp.o -MF tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/ConvertCall.cpp.o.d -o tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/ConvertCall.cpp.o -c /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/flang/lib/Lower/ConvertCall.cpp
../llvm-project/flang/lib/Lower/ConvertCall.cpp: In member function ‘bool {anonymous}::ElementalUserCallBuilder::canLoadActualArgumentBeforeLoop(unsigned int) const’:
../llvm-project/flang/lib/Lower/ConvertCall.cpp:1700:17: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
1700 | const auto &arg = caller.getPassedArguments()[argIdx];
| ^~~
../llvm-project/flang/lib/Lower/ConvertCall.cpp:1700:57: note: the temporary was destroyed at the end of the full expression ‘(&((const {anonymous}::ElementalUserCallBuilder*)this)->{anonymous}::ElementalUserCallBuilder::caller)->Fortran::lower::CallerInterface::<anonymous>.Fortran::lower::CallInterface<Fortran::lower::CallerInterface>::getPassedArguments().llvm::ArrayRef<Fortran::lower::CallInterface<Fortran::lower::CallerInterface>::PassedEntity>::operator[](((size_t)argIdx))’
1700 | const auto &arg = caller.getPassedArguments()[argIdx];
| ^
cc1plus: all warnings being treated as errors
972.047 [110/3/6232] Building CXX object tools/flang/lib/Semantics/CMakeFiles/obj.FortranSemantics.dir/runtime-type-info.cpp.o
FAILED: tools/flang/lib/Semantics/CMakeFiles/obj.FortranSemantics.dir/runtime-type-info.cpp.o
/usr/local/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D_LIBCPP_ENABLE_HARDENED_MODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/tools/flang/lib/Semantics -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/flang/lib/Semantics -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/flang/include -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/tools/flang/include -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/include -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/llvm/include -isystem /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/llvm/../mlir/include -isystem /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/tools/mlir/include -isystem /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/tools/clang/include -isystem /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG -fno-semantic-interposition -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/flang/lib/Semantics/CMakeFiles/obj.FortranSemantics.dir/runtime-type-info.cpp.o -MF tools/flang/lib/Semantics/CMakeFiles/obj.FortranSemantics.dir/runtime-type-info.cpp.o.d -o tools/flang/lib/Semantics/CMakeFiles/obj.FortranSemantics.dir/runtime-type-info.cpp.o -c /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/flang/lib/Semantics/runtime-type-info.cpp
../llvm-project/flang/lib/Semantics/runtime-type-info.cpp: In function ‘Fortran::semantics::SomeExpr Fortran::semantics::SaveDerivedPointerTarget(Scope&, SourceName, std::vector<Fortran::evaluate::StructureConstructor>&&, Fortran::evaluate::ConstantSubscripts&&)’:
../llvm-project/flang/lib/Semantics/runtime-type-info.cpp:205:17: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
205 | const auto &derivedType{x.front().GetType().GetDerivedTypeSpec()};
| ^~~~~~~~~~~
../llvm-project/flang/lib/Semantics/runtime-type-info.cpp:205:67: note: the temporary was destroyed at the end of the full expression ‘(&(& x)->std::vector<Fortran::evaluate::StructureConstructor>::front())->Fortran::evaluate::StructureConstructor::GetType().Fortran::evaluate::DynamicType::GetDerivedTypeSpec()’
205 | const auto &derivedType{x.front().GetType().GetDerivedTypeSpec()};
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
cc1plus: all warnings being treated as errors
1056.665 [110/2/6233] Building CXX object tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/OpenMP.cpp.o
FAILED: tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/OpenMP.cpp.o
/usr/local/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D_LIBCPP_ENABLE_HARDENED_MODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/tools/flang/lib/Lower -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/flang/lib/Lower -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/flang/include -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/tools/flang/include -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/include -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/llvm/include -isystem /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/llvm/../mlir/include -isystem /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/tools/mlir/include -isystem /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/tools/clang/include -isystem /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG -fno-semantic-interposition -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/OpenMP.cpp.o -MF tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/OpenMP.cpp.o.d -o tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/OpenMP.cpp.o -c /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/flang/lib/Lower/OpenMP.cpp
../llvm-project/flang/lib/Lower/OpenMP.cpp: In function ‘bool checkForSymbolMatch(const Fortran::parser::AssignmentStmt&)’:
../llvm-project/flang/lib/Lower/OpenMP.cpp:2193:37: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
2193 | const Fortran::semantics::Symbol &varSymbol =
| ^~~~~~~~~
../llvm-project/flang/lib/Lower/OpenMP.cpp:2194:52: note: the temporary was destroyed at the end of the full expression ‘(& Fortran::evaluate::GetSymbolVector(const A&) [with A = Expr<SomeType>; SymbolVector = std::vector<Fortran::common::Reference<const Fortran::semantics::Symbol> >]().std::vector<Fortran::common::Reference<const Fortran::semantics::Symbol> >::front())->Fortran::common::Reference<const Fortran::semantics::Symbol>::operator std::conditional_t<true, const Fortran::semantics::Symbol&, void>()’
2194 | Fortran::evaluate::GetSymbolVector(*v).front();
| ^
cc1plus: all warnings being treated as errors
I cannot reproduce this when building with clang.
I wonder if this is a real problem or a gcc issue.
Metadata
Metadata
Assignees
Labels
code-qualityflangFlang issues not falling into any other categoryFlang issues not falling into any other categorygood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute