Description of problem: GCC crashes and reports internal compiler error when building SU2 v6.2.0. Version-Release number of selected component (if applicable): devtoolset-9-gcc-c++-9.3.1-2.el7.x86_64 How reproducible: Always Steps to Reproduce: 1. Install the required software # yum install git python-devel devtoolset-9-9.1-0.el7.x86_64 2. Clone the SU2 source code and check out the suitable commit $ git clone git://github.com/su2code/SU2.git $ cd SU2 $ git checkout -b local-6.2.0 v6.2.0 $ git log -n 1 commit 284b2a5b8f74fcf2f6ff16d97f24e5b36c4bbb4d Merge: 34f7248 e2452a1 Author: Thomas D. Economon <thomas.economon.com> Date: Mon Feb 18 15:27:32 2019 -0800 Merge pull request #641 from su2code/release_v6.2.0 Release v6.2.0 $ git clean -ffdx 3. Enable the DTS 9 compiler and configure the build $ source scl_source enable devtoolset-9 $ ./bootstrap $ ./configure $ make >& make.log $ make >& make.log || echo FAIL FAIL Actual results: Making all in externals make[1]: Entering directory '/work/02750804/SU2/externals' Making all in tecio make[2]: Entering directory '/work/02750804/SU2/externals/tecio' CXX teciosrc/libtecio_a-TecioSZL.o during GIMPLE pass: printf-return-value teciosrc/TecioSZL.cpp: In function ‘bool tecplot::tecioszl::{anonymous}::checkAuxNameAndValue(tecplot::tecioszl::{anonymous}::OutputInfo*, const char*, const char*, const char*)’: teciosrc/TecioSZL.cpp:218: internal compiler error: in subspan, at input.h:68 218 | if (!getOutputInfoAndZoneOrPartitionPtr(&outputInfo, &zonePtr, fileHandle, zone, ___2977, routineName)) return -1; if (count + zonePtr->___2497->storedValueCount() > zonePtr->___2497->___2500 * zonePtr->___2497->___2392) { ___3187("Error in %s: Too many node map values for this zone. %" PRIu64 " supplied, need only %" PRIu64 ".\n", routineName, count, zonePtr->___2497->___2500 * zonePtr->___2497->___2392 - zonePtr->___2497->storedValueCount()); ++outputInfo->m_numErrs; return -1; } if (outputInfo->m_debugLevel && (count > 1)) ___3186("Writing %" PRId64 " nodes to zone %d.\n", count, zone); for (int64_t i = 0; i < count; ++i) { T ___2709 = nodes[i]; if (nodesAreOneBased) --___2709; if (___2709 < 0 || zonePtr->___2682.i() <= (___81)___2709) { T maxValue = static_cast<T>(zonePtr->___2682.i()); if (!nodesAreOneBased) --maxValue; std::ostringstream ___2892; ___2892 << routineName << ": Invalid node map value at position " << i << std::endl << " node map value = " << nodes[i] << ", max value = " << maxValue << "." << std::endl; ___3185("Error in %s", ___2892.str().c_str()); ++outputInfo->m_numErrs; return -1; } zonePtr->___2497->appendValue(___2709); } return 0; } } int32_t tecZoneNodeMapWrite32_SZL( void* fileHandle, int32_t zone, int32_t ___2977, int32_t nodesAreOneBased, int64_t count, int32_t const* nodes) { return zoneNodeMapWrite(fileHandle, zone, ___2977, nodesAreOneBased, count, nodes, "tecZoneNodeMapWrite32"); } int32_t tecZoneNodeMapWrite64_SZL( void* fileHandle, int32_t zone, int32_t ___2977, int32_t nodesAreOneBased, int64_t count, int64_t const* nodes) { return zoneNodeMapWrite(fileHandle, zone, ___2977, nodesAreOneBased, count, nodes, "tecZoneNodeMapWrite64"); } namespace { template <typename T> int32_t zoneFaceNbrWriteConnections( void* fileHandle, int32_t zone, T const* faceNeighbors, char const* routineName) { OutputInfo* outputInfo = (OutputInfo*)fileHandle; Zone_s* zonePtr = outputInfo->m_tecioData.zonePtr(zone); if (!getOutputInfoAndZonePtr(&outputInfo, &zonePtr, fileHandle, zone, routineName)) return -1; if (outputInfo->m_debugLevel) ___3185("\nInserting face neighbor data for zone %d\n", zone); try { if (outputInfo->m_debugLevel) ___3185("\nInserting face neighbor data for zone %d\n", zone); outputInfo->m_tecioData.___431(zonePtr, faceNeighbors); } catch (std::exception const& e) { ___3186("Error in %s: %s\n", routineName, e.what()); ++outputInfo->m_numErrs; return -1; } return 0; } } int32_t tecZoneFaceNbrWriteConnections32_SZL( void* fileHandle, int32_t zone, int32_t const* faceNeighbors) { return zoneFaceNbrWriteConnections(fileHandle, zone, faceNeighbors, "tecZoneFaceNbrWriteConnections32"); } int32_t tecZoneFaceNbrWriteConnections64_SZL( void* fileHandle, int32_t zone, int64_t const* faceNeighbors) { return zoneFaceNbrWriteConnections(fileHandle, zone, faceNeighbors, "tecZoneFaceNbrWriteConnections64"); } int32_t tecZoneWritePolyFaces32_SZL( void* , int32_t , int32_t , int32_t , int32_t const* , int32_t const* , int32_t const* , int32_t const* , int32_t ) { return 0; } int32_t tecZoneWritePolyFaces64_SZL( void* , int32_t , int32_t , int64_t , int32_t const* , int64_t const* , int64_t const* , int64_t const* , int32_t ) { return 0; } int32_t tecZoneWritePolyBoundaryConnections32_SZL( void* , int32_t , int32_t , int32_t , int32_t const* , int32_t const* , int32_t const* , int32_t ) { return 0; } int32_t tecZoneWritePolyBoundaryConnections64_SZL( void* , int32_t , int32_t , int64_t , int32_t const* , int64_t const* , int32_t const* , int32_t ) { return 0; } namespace { bool auxDataIsValidNameChar(char c, bool isLeadChar) { REQUIRE(0 <= c && "c <= 127"); bool isValidNameChar = (c == '_' || tecplot::___1998(c)); if (!isLeadChar) isValidNameChar = (isValidNameChar || c == '.' || tecplot::___2012(c)); return isValidNameChar; } bool auxDataIsValidName(char const* ___2685) { REQUIRE(VALID_REF(___2685)); bool isValidName = auxDataIsValidNameChar(*___2685, true); for (char const* nPtr = ___2685; isValidName && *nPtr != '\0'; ++nPtr) isValidName = auxDataIsValidNameChar(*nPtr, false); return isValidName; } bool checkAuxNameAndValue(OutputInfo* outputInfo, char const* ___2685, char const* ___4314, char const* routineName) { if ((___2685 == NULL) || !auxDataIsValidName(___2685)) { ___3185("Error in %s: Invalid Name string\n", routineName); ++outputInfo->m_numErrs; return false; } if ((___4314 == NULL) || (*___4314 == '\0')) { ___3185("Error in %s: Invalid Value string\n", routineName); ++outputInfo->m_numErrs; return false; } return true; } } int32_t tecDataSetAddAuxData_SZL( void* fileHandle, char const* ___2685, char const* ___4314) { OutputInfo* outputInfo; if (!getOutputInfo(&outputInfo, fileHandle, "tecDataSetAddAuxData")) | Please submit a full bug report, with preprocessed source if appropriate. See <http://bugzilla.redhat.com/bugzilla> for instructions. Preprocessed source stored into /tmp/ccyyn0AE.out file, please attach this to your bugreport. make[2]: *** [Makefile:1757: teciosrc/libtecio_a-TecioSZL.o] Error 1 make[2]: Leaving directory '/work/02750804/SU2/externals/tecio' make[1]: *** [Makefile:408: all-recursive] Error 1 make[1]: Leaving directory '/work/02750804/SU2/externals' make: *** [Makefile:441: all-recursive] Error 1 Expected results: Successful compilation Additional info: Adding "-save-temps" to the compiler flags prevents the ICE. - Edit the file "externals/tecio/Makefile" - In line line 273, set CPPFLAGS = -save-temps
I could reproduce this with devtoolset-9-gcc-9.3.1-2.1.el7.x86_64: CXX teciosrc/libtecio_a-strutil.o CXX teciosrc/libtecio_a-szcombine.o CXX teciosrc/libtecio_a-SZLFEPartitionedZoneHeaderWriter.o CXX teciosrc/libtecio_a-SZLFEPartitionedZoneWriter.o CXX teciosrc/libtecio_a-SZLFEPartitionWriter.o CXX teciosrc/libtecio_a-SZLFEZoneHeaderWriter.o CXX teciosrc/libtecio_a-SZLFEZoneWriter.o CXX teciosrc/libtecio_a-SZLOrderedPartitionedZoneHeaderWriter.o CXX teciosrc/libtecio_a-SZLOrderedPartitionedZoneWriter.o CXX teciosrc/libtecio_a-SZLOrderedPartitionWriter.o CXX teciosrc/libtecio_a-SZLOrderedZoneHeaderWriter.o CXX teciosrc/libtecio_a-SZLOrderedZoneWriter.o CXX teciosrc/libtecio_a-tecio.o CXX teciosrc/libtecio_a-TecioData.o CXX teciosrc/libtecio_a-TecioPLT.o CXX teciosrc/libtecio_a-TecioSZL.o during GIMPLE pass: printf-return-value teciosrc/TecioSZL.cpp: In function ‘bool tecplot::tecioszl::{anonymous}::checkAuxNameAndValue(tecplot::tecioszl::{anonymous}::OutputInfo*, const char*, const char*, const char*)’: teciosrc/TecioSZL.cpp:218: internal compiler error: in subspan, at input.h:68 218 | if (!getOutputInfoAndZoneOrPartitionPtr(&outputInfo, &zonePtr, fileHandle, zone, ___2977, routineName)) return -1; if (count + zonePtr->___2497->storedValueCount() > zonePtr->___2497->___2500 * zonePtr->___2497->___2392) { ___3187("Error in %s: Too many node map values for this zone. %" PRIu64 " supplied, need only %" PRIu64 ".\n", routineName, count, zonePtr->___2497->___2500 * zonePtr->___2497->___2392 - zonePtr->___2497->storedValueCount()); ++outputInfo->m_numErrs; return -1; } if (outputInfo->m_debugLevel && (count > 1)) ___3186("Writing %" PRId64 " nodes to zone %d.\n", count, zone); for (int64_t i = 0; i < count; ++i) { T ___2709 = nodes[i]; if (nodesAreOneBased) --___2709; if (___2709 < 0 || zonePtr->___2682.i() <= (___81)___2709) { T maxValue = static_cast<T>(zonePtr->___2682.i()); if (!nodesAreOneBased) --maxValue; std::ostringstream ___2892; ___2892 << routineName << ": Invalid node map value at position " << i << std::endl << " node map value = " << nodes[i] << ", max value = " << maxValue << "." << std::endl; ___3185("Error in %s", ___2892.str().c_str()); ++outputInfo->m_numErrs; return -1; } zonePtr->___2497->appendValue(___2709); } return 0; } } int32_t tecZoneNodeMapWrite32_SZL( void* fileHandle, int32_t zone, int32_t ___2977, int32_t nodesAreOneBased, int64_t count, int32_t const* nodes) { return zoneNodeMapWrite(fileHandle, zone, ___2977, nodesAreOneBased, count, nodes, "tecZoneNodeMapWrite32"); } int32_t tecZoneNodeMapWrite64_SZL( void* fileHandle, int32_t zone, int32_t ___2977, int32_t nodesAreOneBased, int64_t count, int64_t const* nodes) { return zoneNodeMapWrite(fileHandle, zone, ___2977, nodesAreOneBased, count, nodes, "tecZoneNodeMapWrite64"); } namespace { template <typename T> int32_t zoneFaceNbrWriteConnections( void* fileHandle, int32_t zone, T const* faceNeighbors, char const* routineName) { OutputInfo* outputInfo = (OutputInfo*)fileHandle; Zone_s* zonePtr = outputInfo->m_tecioData.zonePtr(zone); if (!getOutputInfoAndZonePtr(&outputInfo, &zonePtr, fileHandle, zone, routineName)) return -1; if (outputInfo->m_debugLevel) ___3185("\nInserting face neighbor data for zone %d\n", zone); try { if (outputInfo->m_debugLevel) ___3185("\nInserting face neighbor data for zone %d\n", zone); outputInfo->m_tecioData.___431(zonePtr, faceNeighbors); } catch (std::exception const& e) { ___3186("Error in %s: %s\n", routineName, e.what()); ++outputInfo->m_numErrs; return -1; } return 0; } } int32_t tecZoneFaceNbrWriteConnections32_SZL( void* fileHandle, int32_t zone, int32_t const* faceNeighbors) { return zoneFaceNbrWriteConnections(fileHandle, zone, faceNeighbors, "tecZoneFaceNbrWriteConnections32"); } int32_t tecZoneFaceNbrWriteConnections64_SZL( void* fileHandle, int32_t zone, int64_t const* faceNeighbors) { return zoneFaceNbrWriteConnections(fileHandle, zone, faceNeighbors, "tecZoneFaceNbrWriteConnections64"); } int32_t tecZoneWritePolyFaces32_SZL( void* , int32_t , int32_t , int32_t , int32_t const* , int32_t const* , int32_t const* , int32_t const* , int32_t ) { return 0; } int32_t tecZoneWritePolyFaces64_SZL( void* , int32_t , int32_t , int64_t , int32_t const* , int64_t const* , int64_t const* , int64_t const* , int32_t ) { return 0; } int32_t tecZoneWritePolyBoundaryConnections32_SZL( void* , int32_t , int32_t , int32_t , int32_t const* , int32_t const* , int32_t const* , int32_t ) { return 0; } int32_t tecZoneWritePolyBoundaryConnections64_SZL( void* , int32_t , int32_t , int64_t , int32_t const* , int64_t const* , int32_t const* , int32_t ) { return 0; } namespace { bool auxDataIsValidNameChar(char c, bool isLeadChar) { REQUIRE(0 <= c && "c <= 127"); bool isValidNameChar = (c == '_' || tecplot::___1998(c)); if (!isLeadChar) isValidNameChar = (isValidNameChar || c == '.' || tecplot::___2012(c)); return isValidNameChar; } bool auxDataIsValidName(char const* ___2685) { REQUIRE(VALID_REF(___2685)); bool isValidName = auxDataIsValidNameChar(*___2685, true); for (char const* nPtr = ___2685; isValidName && *nPtr != '\0'; ++nPtr) isValidName = auxDataIsValidNameChar(*nPtr, false); return isValidName; } bool checkAuxNameAndValue(OutputInfo* outputInfo, char const* ___2685, char const* ___4314, char const* routineName) { if ((___2685 == NULL) || !auxDataIsValidName(___2685)) { ___3185("Error in %s: Invalid Name string\n", routineName); ++outputInfo->m_numErrs; return false; } if ((___4314 == NULL) || (*___4314 == '\0')) { ___3185("Error in %s: Invalid Value string\n", routineName); ++outputInfo->m_numErrs; return false; } return true; } } int32_t tecDataSetAddAuxData_SZL( void* fileHandle, char const* ___2685, char const* ___4314) { OutputInfo* outputInfo; if (!getOutputInfo(&outputInfo, fileHandle, "tecDataSetAddAuxData")) | Please submit a full bug report, with preprocessed source if appropriate. See <http://bugzilla.redhat.com/bugzilla> for instructions. With devtoolset-10-gcc-10.2.1-2.1.el7 too: CXX teciosrc/libtecio_a-TecioSZL.o CXX teciosrc/libtecio_a-TecioTecUtil.o during GIMPLE pass: strlen teciosrc/TecioSZL.cpp: In function ‘bool tecplot::tecioszl::{anonymous}::checkAuxNameAndValue(tecplot::tecioszl::{anonymous}::OutputInfo*, const char*, const char*, const char*)’: teciosrc/TecioSZL.cpp:218: internal compiler error: in subspan, at input.h:69 218 | if (!getOutputInfoAndZoneOrPartitionPtr(&outputInfo, &zonePtr, fileHandle, zone, ___2977, routineName)) return -1; if (count + zonePtr->___2497->storedValueCount() > zonePtr->___2497->___2500 * zonePtr->___2497->___2392) { ___3187("Error in %s: Too many node map values for this zone. %" PRIu64 " supplied, need only %" PRIu64 ".\n", routineName, count, zonePtr->___2497->___2500 * zonePtr->___2497->___2392 - zonePtr->___2497->storedValueCount()); ++outputInfo->m_numErrs; return -1; } if (outputInfo->m_debugLevel && (count > 1)) ___3186("Writing %" PRId64 " nodes to zone %d.\n", count, zone); for (int64_t i = 0; i < count; ++i) { T ___2709 = nodes[i]; if (nodesAreOneBased) --___2709; if (___2709 < 0 || zonePtr->___2682.i() <= (___81)___2709) { T maxValue = static_cast<T>(zonePtr->___2682.i()); if (!nodesAreOneBased) --maxValue; std::ostringstream ___2892; ___2892 << routineName << ": Invalid node map value at position " << i << std::endl << " node map value = " << nodes[i] << ", max value = " << maxValue << "." << std::endl; ___3185("Error in %s", ___2892.str().c_str()); ++outputInfo->m_numErrs; return -1; } zonePtr->___2497->appendValue(___2709); } return 0; } } int32_t tecZoneNodeMapWrite32_SZL( void* fileHandle, int32_t zone, int32_t ___2977, int32_t nodesAreOneBased, int64_t count, int32_t const* nodes) { return zoneNodeMapWrite(fileHandle, zone, ___2977, nodesAreOneBased, count, nodes, "tecZoneNodeMapWrite32"); } int32_t tecZoneNodeMapWrite64_SZL( void* fileHandle, int32_t zone, int32_t ___2977, int32_t nodesAreOneBased, int64_t count, int64_t const* nodes) { return zoneNodeMapWrite(fileHandle, zone, ___2977, nodesAreOneBased, count, nodes, "tecZoneNodeMapWrite64"); } namespace { template <typename T> int32_t zoneFaceNbrWriteConnections( void* fileHandle, int32_t zone, T const* faceNeighbors, char const* routineName) { OutputInfo* outputInfo = (OutputInfo*)fileHandle; Zone_s* zonePtr = outputInfo->m_tecioData.zonePtr(zone); if (!getOutputInfoAndZonePtr(&outputInfo, &zonePtr, fileHandle, zone, routineName)) return -1; if (outputInfo->m_debugLevel) ___3185("\nInserting face neighbor data for zone %d\n", zone); try { if (outputInfo->m_debugLevel) ___3185("\nInserting face neighbor data for zone %d\n", zone); outputInfo->m_tecioData.___431(zonePtr, faceNeighbors); } catch (std::exception const& e) { ___3186("Error in %s: %s\n", routineName, e.what()); ++outputInfo->m_numErrs; return -1; } return 0; } } int32_t tecZoneFaceNbrWriteConnections32_SZL( void* fileHandle, int32_t zone, int32_t const* faceNeighbors) { return zoneFaceNbrWriteConnections(fileHandle, zone, faceNeighbors, "tecZoneFaceNbrWriteConnections32"); } int32_t tecZoneFaceNbrWriteConnections64_SZL( void* fileHandle, int32_t zone, int64_t const* faceNeighbors) { return zoneFaceNbrWriteConnections(fileHandle, zone, faceNeighbors, "tecZoneFaceNbrWriteConnections64"); } int32_t tecZoneWritePolyFaces32_SZL( void* , int32_t , int32_t , int32_t , int32_t const* , int32_t const* , int32_t const* , int32_t const* , int32_t ) { return 0; } int32_t tecZoneWritePolyFaces64_SZL( void* , int32_t , int32_t , int64_t , int32_t const* , int64_t const* , int64_t const* , int64_t const* , int32_t ) { return 0; } int32_t tecZoneWritePolyBoundaryConnections32_SZL( void* , int32_t , int32_t , int32_t , int32_t const* , int32_t const* , int32_t const* , int32_t ) { return 0; } int32_t tecZoneWritePolyBoundaryConnections64_SZL( void* , int32_t , int32_t , int64_t , int32_t const* , int64_t const* , int32_t const* , int32_t ) { return 0; } namespace { bool auxDataIsValidNameChar(char c, bool isLeadChar) { REQUIRE(0 <= c && "c <= 127"); bool isValidNameChar = (c == '_' || tecplot::___1998(c)); if (!isLeadChar) isValidNameChar = (isValidNameChar || c == '.' || tecplot::___2012(c)); return isValidNameChar; } bool auxDataIsValidName(char const* ___2685) { REQUIRE(VALID_REF(___2685)); bool isValidName = auxDataIsValidNameChar(*___2685, true); for (char const* nPtr = ___2685; isValidName && *nPtr != '\0'; ++nPtr) isValidName = auxDataIsValidNameChar(*nPtr, false); return isValidName; } bool checkAuxNameAndValue(OutputInfo* outputInfo, char const* ___2685, char const* ___4314, char const* routineName) { if ((___2685 == NULL) || !auxDataIsValidName(___2685)) { ___3185("Error in %s: Invalid Name string\n", routineName); ++outputInfo->m_numErrs; return false; } if ((___4314 == NULL) || (*___4314 == '\0')) { ___3185("Error in %s: Invalid Value string\n", routineName); ++outputInfo->m_numErrs; return false; } return true; } } int32_t tecDataSetAddAuxData_SZL( void* fileHandle, char const* ___2685, char const* ___4314) { OutputInfo* outputInfo; if (!getOutputInfo(&outputInfo, fileHandle, "tecDataSetAddAuxData")) | Please submit a full bug report, with preprocessed source if appropriate. See <http://bugzilla.redhat.com/bugzilla> for instructions.
Same problem as in https://bugzilla.redhat.com/show_bug.cgi?id=1718513
An upstream PR: https://gcc.gnu.org/PR96935
I've reduced & bisected this, see the upstream PR.
Fixed upstream, I've also backported the fix to 10. The fix could be included in DTS 10.1 gcc.
Upstream PR was backported to GCC 10, so this will be fixed when we next update the sources.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (devtoolset-10-gcc bug fix update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:2219