Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LTO - RecoTracker] Solve -Wstrict-overflow compiler warnings #38683

Conversation

aandvalenzuela
Copy link
Contributor

Hello,

We have seen some compiler warnings of the type -Wstrict-overflow in LTO_X IBs (CMSSW_12_5_LTO_X_2022-07-07-1100 and CMSSW_12_5_LTO_X_2022-07-06-1100, for example) in RecoLocalTracker/SiStripZeroSuppression, RecoTracker/FinalTrackSelectors and RecoTracker/MkFitCMS packages. See sample stack traces, respectively:

  • RecoLocalTracker/SiStripZeroSuppression:
>> Building shared library tmp/el8_amd64_gcc10/src/RecoLocalTracker/SiStripZeroSuppression/src/RecoLocalTrackerSiStripZeroSuppression/libRecoLocalTrackerSiStripZeroSuppression.so
/data/cmsbld/jenkins/workspace/build-any-ib/w/el8_amd64_gcc10/external/gcc/10.3.0-84898dea653199466402e67d73657f10/bin/c++ -O2 -pthread -pipe -Werror=main -Werror=pointer-arith -Werror=overlength-strings -Wno-vla -Werror=overflow -std=c++1z -ftree-vectorize -Wstrict-overflow -Werror=array-bounds -Werror=format-contains-nul -Werror=type-limits -fvisibility-inlines-hidden -fno-math-errno --param vect-max-version-for-alias-checks=50 -Xassembler --compress-debug-sections -msse3 -felide-constructors -fmessage-length=0 -Wall -Wno-non-template-friend -Wno-long-long -Wreturn-type -Wextra -Wpessimizing-move -Wclass-memaccess -Wno-cast-function-type -Wno-unused-but-set-parameter -Wno-ignored-qualifiers -Wno-deprecated-copy -Wno-unused-parameter -Wunused -Wparentheses -Wno-deprecated -Werror=return-type -Werror=missing-braces -Werror=unused-value -Werror=unused-label -Werror=address -Werror=format -Werror=sign-compare -Werror=write-strings -Werror=delete-non-virtual-dtor -Werror=strict-aliasing -Werror=narrowing -Werror=unused-but-set-variable -Werror=reorder -Werror=unused-variable -Werror=conversion-null -Werror=return-local-addr -Wnon-virtual-dtor -Werror=switch -fdiagnostics-show-option -Wno-unused-local-typedefs -Wno-attributes -Wno-psabi -Wno-error=unused-variable -DBOOST_DISABLE_ASSERTS -flto -fipa-icf -flto-odr-type-merging -fno-fat-lto-objects -Wodr -shared -Wl,-E -Wl,-z,defs tmp/el8_amd64_gcc10/src/RecoLocalTracker/SiStripZeroSuppression/src/RecoLocalTrackerSiStripZeroSuppression/FastLinearCMNSubtractor.cc.o tmp/el8_amd64_gcc10/src/RecoLocalTracker/SiStripZeroSuppression/src/RecoLocalTrackerSiStripZeroSuppression/IteratedMedianCMNSubtractor.cc.o tmp/el8_amd64_gcc10/src/RecoLocalTracker/SiStripZeroSuppression/src/RecoLocalTrackerSiStripZeroSuppression/MedianCMNSubtractor.cc.o tmp/el8_amd64_gcc10/src/RecoLocalTracker/SiStripZeroSuppression/src/RecoLocalTrackerSiStripZeroSuppression/PercentileCMNSubtractor.cc.o tmp/el8_amd64_gcc10/src/RecoLocalTracker/SiStripZeroSuppression/src/RecoLocalTrackerSiStripZeroSuppression/SiStripAPVRestorer.cc.o tmp/el8_amd64_gcc10/src/RecoLocalTracker/SiStripZeroSuppression/src/RecoLocalTrackerSiStripZeroSuppression/SiStripFedZeroSuppression.cc.o tmp/el8_amd64_gcc10/src/RecoLocalTracker/SiStripZeroSuppression/src/RecoLocalTrackerSiStripZeroSuppression/SiStripPedestalsSubtractor.cc.o tmp/el8_amd64_gcc10/src/RecoLocalTracker/SiStripZeroSuppression/src/RecoLocalTrackerSiStripZeroSuppression/SiStripRawProcessingAlgorithms.cc.o tmp/el8_amd64_gcc10/src/RecoLocalTracker/SiStripZeroSuppression/src/RecoLocalTrackerSiStripZeroSuppression/SiStripRawProcessingFactory.cc.o tmp/el8_amd64_gcc10/src/RecoLocalTracker/SiStripZeroSuppression/src/RecoLocalTrackerSiStripZeroSuppression/TT6CMNSubtractor.cc.o -o tmp/el8_amd64_gcc10/src/RecoLocalTracker/SiStripZeroSuppression/src/RecoLocalTrackerSiStripZeroSuppression/libRecoLocalTrackerSiStripZeroSuppression.so -Wl,-E -Wl,--hash-style=gnu -L/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/biglib/el8_amd64_gcc10 -L/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/lib/el8_amd64_gcc10 -L/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/external/el8_amd64_gcc10/lib -L/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/static/el8_amd64_gcc10 -lCalibFormatsSiStripObjects -lCalibTrackerRecords -lGeometryTrackerGeometryBuilder -lCondFormatsSiStripObjects -lMagneticFieldRecords -lCondFormatsDataRecord -lDataFormatsTrackerCommon -lGeometryCommonTopologies -lCondFormatsAlignment -lDataFormatsGeometryCommonDetAlgo -lDataFormatsSiStripCluster -lGeometryRecords -lGeometryTrackerNumberingBuilder -lCondFormatsAlignmentRecord -lDataFormatsGeometrySurface -lDataFormatsSiStripCommon -lDataFormatsTrajectoryState -lDetectorDescriptionCore -lDetectorDescriptionDDCMS -lCondFormatsGeometryObjects -lDataFormatsCLHEP -lDataFormatsEcalDetId -lDataFormatsGeometryVector -lDataFormatsL1GlobalTrigger -lDataFormatsSiPixelDetId -lDataFormatsSiStripDetId -lFWCoreFramework -lDataFormatsDetId -lDataFormatsFEDRawData -lDataFormatsL1GlobalMuonTrigger -lDataFormatsMath -lDataFormatsSiPixelCluster -lDataFormatsSiStripDigi -lFWCoreCommon -lFWCoreServiceRegistry -lCondFormatsPhysicsToolsObjects -lDataFormatsCommon -lFWCoreParameterSet -lFWCoreMessageLogger -lDataFormatsProvenance -lFWCorePluginManager -lFWCoreReflection -lCondFormatsSerialization -lFWCoreConcurrency -lFWCoreUtilities -lFWCoreVersion -lDDAlign -lDDCond -lDDCore -lDDParsers -lPhysics -lHist -lMatrix -lGenVector -lMathMore -lTree -lNet -lGeom -lThread -lMathCore -lRIO -lboost_iostreams -lboost_serialization -lCore -lboost_thread -lboost_date_time -lCLHEP -lpcre -lbz2 -lgsl -luuid -ltbb -lxerces-c -llzma -lz -lfmt -lcms-md5 -lopenblas -lcrypt -ldl -lrt -lstdc++fs -ltinyxml2
/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoLocalTracker/SiStripZeroSuppression/src/MedianCMNSubtractor.cc: In member function 'subtract':
  /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoLocalTracker/SiStripZeroSuppression/src/MedianCMNSubtractor.cc:26:18: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
    26 |     while (strip < endAPV) {
      |                  ^
/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoLocalTracker/SiStripZeroSuppression/src/PercentileCMNSubtractor.cc: In member function 'subtract':
  /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoLocalTracker/SiStripZeroSuppression/src/PercentileCMNSubtractor.cc:26:18: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
    26 |     while (strip < endAPV) {
      |                  ^
/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoLocalTracker/SiStripZeroSuppression/src/FastLinearCMNSubtractor.cc: In member function 'subtract':
  /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoLocalTracker/SiStripZeroSuppression/src/FastLinearCMNSubtractor.cc:25:17: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
    25 |     while (high < endAPV)
      |                 ^
  /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoLocalTracker/SiStripZeroSuppression/src/FastLinearCMNSubtractor.cc:29:18: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
    29 |     while (strip < endAPV) {
      |                  ^
/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoLocalTracker/SiStripZeroSuppression/src/MedianCMNSubtractor.cc: In member function 'subtract':
  /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoLocalTracker/SiStripZeroSuppression/src/MedianCMNSubtractor.cc:26:18: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
    26 |     while (strip < endAPV) {
      |                  ^
/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoLocalTracker/SiStripZeroSuppression/src/PercentileCMNSubtractor.cc: In member function 'subtract':
  /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoLocalTracker/SiStripZeroSuppression/src/PercentileCMNSubtractor.cc:26:18: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
    26 |     while (strip < endAPV) {
      |                  ^
/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoLocalTracker/SiStripZeroSuppression/src/FastLinearCMNSubtractor.cc: In member function 'subtract':
  /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoLocalTracker/SiStripZeroSuppression/src/FastLinearCMNSubtractor.cc:25:17: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
    25 |     while (high < endAPV)
      |                 ^
  /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoLocalTracker/SiStripZeroSuppression/src/FastLinearCMNSubtractor.cc:29:18: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
    29 |     while (strip < endAPV) {
      |                  ^
/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoLocalTracker/SiStripZeroSuppression/src/TT6CMNSubtractor.cc: In member function 'subtract':
  /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoLocalTracker/SiStripZeroSuppression/src/TT6CMNSubtractor.cc:50:17: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
    50 |       while (fs < ls) {
      |                 ^
/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoLocalTracker/SiStripZeroSuppression/src/TT6CMNSubtractor.cc: In member function 'subtract':
  /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoLocalTracker/SiStripZeroSuppression/src/TT6CMNSubtractor.cc:50:17: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
    50 |       while (fs < ls) {
      |                 ^
Copying tmp/el8_amd64_gcc10/src/RecoLocalTracker/SiStripZeroSuppression/src/RecoLocalTrackerSiStripZeroSuppression/libRecoLocalTrackerSiStripZeroSuppression.so to productstore area:
Leaving library rule at RecoLocalTracker/SiStripZeroSuppression
  • RecoTracker/FinalTrackSelectors:
>> Building edm plugin tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/libRecoTrackerFinalTrackSelectorsPlugins.so
/data/cmsbld/jenkins/workspace/build-any-ib/w/el8_amd64_gcc10/external/gcc/10.3.0-84898dea653199466402e67d73657f10/bin/c++ -O2 -pthread -pipe -Werror=main -Werror=pointer-arith -Werror=overlength-strings -Wno-vla -Werror=overflow -std=c++1z -ftree-vectorize -Wstrict-overflow -Werror=array-bounds -Werror=format-contains-nul -Werror=type-limits -fvisibility-inlines-hidden -fno-math-errno --param vect-max-version-for-alias-checks=50 -Xassembler --compress-debug-sections -msse3 -felide-constructors -fmessage-length=0 -Wall -Wno-non-template-friend -Wno-long-long -Wreturn-type -Wextra -Wpessimizing-move -Wclass-memaccess -Wno-cast-function-type -Wno-unused-but-set-parameter -Wno-ignored-qualifiers -Wno-deprecated-copy -Wno-unused-parameter -Wunused -Wparentheses -Wno-deprecated -Werror=return-type -Werror=missing-braces -Werror=unused-value -Werror=unused-label -Werror=address -Werror=format -Werror=sign-compare -Werror=write-strings -Werror=delete-non-virtual-dtor -Werror=strict-aliasing -Werror=narrowing -Werror=unused-but-set-variable -Werror=reorder -Werror=unused-variable -Werror=conversion-null -Werror=return-local-addr -Wnon-virtual-dtor -Werror=switch -fdiagnostics-show-option -Wno-unused-local-typedefs -Wno-attributes -Wno-psabi -Ofast -Wno-error=unused-variable -DBOOST_DISABLE_ASSERTS -flto -fipa-icf -flto-odr-type-merging -fno-fat-lto-objects -Wodr -shared -Wl,-E -Wl,-z,defs tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/AnalyticalTrackSelector.cc.o tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/ClassifierMerger.cc.o tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/CosmicTrackSelector.cc.o tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/CosmicTrackSplitter.cc.o tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/DefaultTrackMVAClassifier.cc.o tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/DuplicateListMerger.cc.o tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/DuplicateTrackMerger.cc.o tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/LwtnnESProducer.cc.o tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/MultiTrackSelector.cc.o tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/TrackAlgoPriorityOrderESProducer.cc.o tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/TrackCandidateTopBottomHitFilter.cc.o tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/TrackCollectionFilterCloner.cc.o tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/TrackCollectionMerger.cc.o tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/TrackCutClassifier.cc.o tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/TrackListMerger.cc.o tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/TrackLwtnnClassifier.cc.o tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/TrackMerger.cc.o tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/TrackSelectorByRegion.cc.o tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/TrackTfClassifier.cc.o tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/TrackerTrackHitFilter.cc.o -o tmp/el8_amd64_gcc10/src/RecoTracker/FinalTrackSelectors/plugins/RecoTrackerFinalTrackSelectorsPlugins/libRecoTrackerFinalTrackSelectorsPlugins.so -Wl,-E -Wl,--hash-style=gnu -L/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/biglib/el8_amd64_gcc10 -L/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/lib/el8_amd64_gcc10 -L/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/external/el8_amd64_gcc10/lib -lTrackingToolsTransientTrack -lDataFormatsPatCandidates -lDataFormatsHLTReco -lDataFormatsBTauReco -lDataFormatsJetMatching -lDataFormatsL1TParticleFlow -lDataFormatsMETReco -lDataFormatsTauReco -lTrackingToolsKalmanUpdators -lDataFormatsJetReco -lRecoTrackerFinalTrackSelectors -lRecoTrackerTransientTrackingRecHit -lTrackingToolsGsfTools -lDataFormatsParticleFlowCandidate -lRecoLocalTrackerSiStripRecHitConverter -lTrackingToolsPatternTools -lDataFormatsParticleFlowReco -lTrackingToolsTransientTrackingRecHit -lDataFormatsEgammaCandidates -lDataFormatsHcalIsolatedTrack -lDataFormatsL1TCorrelator -lDataFormatsL1TMuonPhase2 -lDataFormatsMuonReco -lRecoLocalTrackerPhase2TrackerRecHits -lTrackingToolsDetLayers -lDataFormatsL1TMuon -lDataFormatsRecoCandidate -lRecoLocalTrackerClusterParameterEstimator -lTrackingToolsGeomPropagators -lDataFormatsCSCDigi -lDataFormatsEgammaReco -lDataFormatsGsfTrackReco -lDataFormatsVertexReco -lTrackingToolsTrajectoryState -lDataFormatsGEMDigi -lDataFormatsTrackReco -lRecoTrackerRecord -lDataFormatsGEMRecHit -lDataFormatsTrackCandidate -lDataFormatsTrackerRecHit2D -lRecoLocalTrackerSiStripClusterizer -lTrackingToolsRecords -lCondFormatsSiPhase2TrackerObjects -lDataFormatsCSCRecHit -lDataFormatsDTRecHit -lDataFormatsFTLRecHit -lDataFormatsTrajectorySeed -lRecoLocalTrackerRecords -lCalibFormatsSiStripObjects -lCalibTrackerRecords -lDataFormatsL1Trigger -lDataFormatsTrackingRecHit -lGeometryTrackerGeometryBuilder -lCondFormatsSiStripObjects -lDataFormatsL1TrackTrigger -lMagneticFieldRecords -lCondFormatsDataRecord -lDataFormatsTrackerCommon -lGeometryCaloGeometry -lGeometryCommonTopologies -lCondFormatsAlignment -lDataFormatsBeamSpot -lDataFormatsCaloTowers -lDataFormatsEcalRecHit -lDataFormatsGeometryCommonDetAlgo -lDataFormatsHcalRecHit -lDataFormatsHepMCCandidate -lDataFormatsSiStripCluster -lGeometryRecords -lGeometryTrackerNumberingBuilder -lTrackingToolsAnalyticalJacobians -lCommonToolsStatistics -lCondFormatsAlignmentRecord -lDataFormatsCandidate -lDataFormatsDTDigi -lDataFormatsEcalDigi -lDataFormatsGeometrySurface -lDataFormatsHcalDigi -lDataFormatsL1GlobalCaloTrigger -lDataFormatsSiStripCommon -lDataFormatsTrajectoryState -lDetectorDescriptionCore -lDetectorDescriptionDDCMS -lMagneticFieldEngine -lPhysicsToolsTensorFlow -lCommonToolsUtils -lCondFormatsGeometryObjects -lDataFormatsCLHEP -lDataFormatsCaloRecHit -lDataFormatsEcalDetId -lDataFormatsForwardDetId -lDataFormatsGeometryVector -lDataFormatsHcalDetId -lDataFormatsL1CaloTrigger -lDataFormatsL1GlobalTrigger -lDataFormatsMuonDetId -lDataFormatsPhase2TrackerCluster -lDataFormatsSiPixelDetId -lDataFormatsSiStripDetId -lFWCoreFramework -lDataFormatsDetId -lDataFormatsFEDRawData -lDataFormatsL1GlobalMuonTrigger -lDataFormatsMath -lDataFormatsPhase2TrackerDigi -lDataFormatsScouting -lDataFormatsSiPixelCluster -lDataFormatsSiStripDigi -lFWCoreCommon -lFWCoreServiceRegistry -lCondFormatsPhysicsToolsObjects -lDataFormatsCommon -lFWCoreParameterSet -lFWCoreMessageLogger -lDataFormatsProvenance -lCondFormatsGBRForest -lFWCorePluginManager -lFWCoreReflection -lTrackingToolsTrajectoryParametrization -lCondFormatsSerialization -lFWCoreConcurrency -lFWCoreUtilities -lFWCoreVersion -lDDAlign -lDDCond -lTMVA -lDDCore -lDDParsers -lMLP -lTreePlayer -lGraf3d -lPostscript -lMinuit -lGpad -lGraf -lPhysics -lHist -lMatrix -lGenVector -lMathMore -lTree -lNet -lGeom -lThread -llwtnn -lMathCore -lRIO -lSmatrix -lboost_iostreams -lboost_regex -lboost_serialization -lboost_system -lCore -ltensorflow_cc -lboost_thread -lboost_date_time -lCLHEP -lpng -lpcre -ltensorflow_framework -lbz2 -lgif -lgsl -ljpeg -lturbojpeg -luuid -lprotobuf -lsqlite3 -ltbb -lxerces-c -llzma -lz -lfmt -lcms-md5 -lopenblas -lcrypt -ldl -lrt -lstdc++fs -ltinyxml2
/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoTracker/FinalTrackSelectors/plugins/TrackerTrackHitFilter.cc: In member function 'produceFromTrajectory':
  /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoTracker/FinalTrackSelectors/plugins/TrackerTrackHitFilter.cc:682:49: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
   682 |                    itmCompare >= tmColl.begin() && itmCompare > itTrajMeas - 4;
      |                                                 ^
Leaving library rule at src/RecoTracker/FinalTrackSelectors/plugins
  • RecoTracker/MkFitCMS:
>> Building shared library tmp/el8_amd64_gcc10/src/RecoTracker/MkFitCMS/src/RecoTrackerMkFitCMS/libRecoTrackerMkFitCMS.so
/data/cmsbld/jenkins/workspace/build-any-ib/w/el8_amd64_gcc10/external/gcc/10.3.0-84898dea653199466402e67d73657f10/bin/c++ -O2 -pthread -pipe -Werror=main -Werror=pointer-arith -Werror=overlength-strings -Wno-vla -Werror=overflow -std=c++1z -ftree-vectorize -Wstrict-overflow -Werror=array-bounds -Werror=format-contains-nul -Werror=type-limits -fvisibility-inlines-hidden -fno-math-errno --param vect-max-version-for-alias-checks=50 -Xassembler --compress-debug-sections -msse3 -felide-constructors -fmessage-length=0 -Wall -Wno-non-template-friend -Wno-long-long -Wreturn-type -Wextra -Wpessimizing-move -Wclass-memaccess -Wno-cast-function-type -Wno-unused-but-set-parameter -Wno-ignored-qualifiers -Wno-deprecated-copy -Wno-unused-parameter -Wunused -Wparentheses -Wno-deprecated -Werror=return-type -Werror=missing-braces -Werror=unused-value -Werror=unused-label -Werror=address -Werror=format -Werror=sign-compare -Werror=write-strings -Werror=delete-non-virtual-dtor -Werror=strict-aliasing -Werror=narrowing -Werror=unused-but-set-variable -Werror=reorder -Werror=unused-variable -Werror=conversion-null -Werror=return-local-addr -Wnon-virtual-dtor -Werror=switch -fdiagnostics-show-option -Wno-unused-local-typedefs -Wno-attributes -Wno-psabi -DBOOST_DISABLE_ASSERTS -fopenmp-simd -flto -fipa-icf -flto-odr-type-merging -fno-fat-lto-objects -Wodr -shared -Wl,-E -Wl,-z,defs tmp/el8_amd64_gcc10/src/RecoTracker/MkFitCMS/src/RecoTrackerMkFitCMS/MkStdSeqs.cc.o tmp/el8_amd64_gcc10/src/RecoTracker/MkFitCMS/src/RecoTrackerMkFitCMS/runFunctions.cc.o -o tmp/el8_amd64_gcc10/src/RecoTracker/MkFitCMS/src/RecoTrackerMkFitCMS/libRecoTrackerMkFitCMS.so -Wl,-E -Wl,--hash-style=gnu -L/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/biglib/el8_amd64_gcc10 -L/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/lib/el8_amd64_gcc10 -L/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/external/el8_amd64_gcc10/lib -L/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/static/el8_amd64_gcc10 -lRecoTrackerMkFitCore -lSmatrix -lCore -lpcre -lbz2 -ltbb -llzma -lz -lcrypt -ldl -lrt
/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoTracker/MkFitCMS/src/MkStdSeqs.cc: In function 'find_duplicates_sharedhits':
  /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoTracker/MkFitCMS/src/MkStdSeqs.cc:459:13: warning: assuming signed overflow does not occur when simplifying comparison of absolute value and zero [-Wstrict-overflow]
   459 |             if (std::abs(it->second) >= (int)itrack)
      |             ^
  /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/9802c30fc48bdc09db9c7193cb951860/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-07-2300/src/RecoTracker/MkFitCMS/src/MkStdSeqs.cc:459:13: warning: assuming signed overflow does not occur when simplifying comparison of absolute value and zero [-Wstrict-overflow]
 Copying tmp/el8_amd64_gcc10/src/RecoTracker/MkFitCMS/src/RecoTrackerMkFitCMS/libRecoTrackerMkFitCMS.so to productstore area:
Leaving library rule at RecoTracker/MkFitCMS

Regarding the type of error and following some online discussions of this type of warning fmtlib/fmt/issues/2757, I have tried to workaround it as shown in this PR for RecoLocalTracker/SiStripZeroSuppression and RecoTracker/FinalTrackSelectors. For RecoTracker/MkFitCMS I just corrected the narrowing cast. Feel free to propose other solutions that could be better regarding the analysis itself.

Many thanks,
Andrea.

@aandvalenzuela
Copy link
Contributor Author

assign reconstruction

@aandvalenzuela
Copy link
Contributor Author

@cmsbuild , please test for CMSSW_12_5_LTO_X

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38683/30982

  • This PR adds an extra 32KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @aandvalenzuela (Andrea Valenzuela) for master.

It involves the following packages:

  • RecoLocalTracker/SiStripZeroSuppression (reconstruction)
  • RecoTracker/FinalTrackSelectors (reconstruction)
  • RecoTracker/MkFitCMS (reconstruction)

@jpata, @clacaputo can you please review it and eventually sign? Thanks.
@echabert, @pieterdavid, @swertz, @makortel, @GiacomoSguazzoni, @yduhm, @robervalwalsh, @JanFSchulte, @rovere, @VinInn, @alesaggio, @gpetruc, @ebrondol, @felicepantaleo, @mtosi, @gbenelli, @mmusich, @threus, @dgulhan this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy, @rappoccio you are the release manager for this.

cms-bot commands are listed here

@@ -13,7 +13,7 @@ inline void FastLinearCMNSubtractor::subtract_(uint32_t detId, uint16_t firstAPV
tmp.reserve(128);
typename std::vector<T>::iterator strip(digis.begin()), end(digis.end()), endAPV, high, low;

while (strip < end) {
while (strip - end < 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at https://en.cppreference.com/w/cpp/named_req/RandomAccessIterator
image

why would a semantically equivalent expression trigger a warning?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

I am also not 100% sure, but we are observing this warning because of the same reason multiple times in different modules (for example, #38649). Also, it is not a transient warning since it appears consistently in our IBs. I was following the discussion I mentioned before and their suggested fixes (fmtlib/fmt@8e2e4d4). Feel free to propose any other solution to get rid of this type of warnings.

I am reproducing the warnings using CMSSW_12_5_LTO_X IBs.

Many thanks,
Andrea.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

After some further investigation, I think in this case the compiler is warning about a possible pointer wraparound since, for example, when checking high < endAPV, it is in reality checking for:

endAPV = strip + 128;
high = strip + 64;

My fear about high - endAPV < 0 is that the warning goes away, but probably also the optimization and that is why the warning is not shown anymore.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is what I understood reading about similar reports from 2014

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think (based on coming to similar conclusion, based on e.g. https://www.spinics.net/lists/gcchelp/msg52198.html that shows an example where it is easy to see this kind of change prevents the optimization) we should probably think more what to do in these cases.

The warning basically says that GCC assumed no pointer or signed integer wraparound and optimized code based on that. If the code has no way under/overflow, in the leading order the logic would not need a fix (the documentation also mentions false positives). Some tuning of the code might still be useful to make GCC's optimization path more clear.

But I'm not sure what would the best approach for cases where the code is deemed correct. Is there anything better than locally disabling the warning (which will then clutter the code)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @makortel,

Many thanks for your answer. I was also thinking on the option of disabling the warnings only on the specific code locations where it appears. I have been doing some trials with #pragma GCC diagnostic ignored and #pragma push and pop, but those pragma declarations seem to be ignored with the LTO build. I have been searching and it seems this happens since the compiler is invoked back at link stage in these cases.

If we finally decide to disable the warning, is there any other approach to target these warnings locally?

Thank you!

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-73d387/26135/summary.html
COMMIT: e3d6dfc
CMSSW: CMSSW_12_5_LTO_X_2022-07-09-1100/el8_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/38683/26135/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 659 differences found in the comparisons
  • DQMHistoTests: Total files compared: 50
  • DQMHistoTests: Total histograms compared: 3655935
  • DQMHistoTests: Total failures: 10365
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3645548
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 49 files compared)
  • Checked 208 log files, 45 edm output root files, 50 DQM output files
  • TriggerResults: no differences found

@aandvalenzuela
Copy link
Contributor Author

From what we discussed in the Core Software meeting, I understood we can go ahead with this PR and then we will evaluate if these changes suppose a significant loose in performance or not.

@VinInn
Copy link
Contributor

VinInn commented Jul 14, 2022

I'm personally not in favor of changing code that is clearly well formed and correct to a more complex and less intuitive form.
It does not look to me that anybody as a clear guidance on how to write those statements.
I think we should try to find a way to silence a clearly false-positive warning.
Maybe we should start to write a post-processor of the log files that marks known false-positive.

@clacaputo
Copy link
Contributor

Hi @aandvalenzuela I can see some minimal reco differences, but I suppose they are related to having the comparison baseline IB CMSSW_12_5_X_2022-07-09-1100 VS the CMSSW_12_5_LTO_X_2022-07-09-1100. What are the differences between an LTO build and a regular one?

@aandvalenzuela
Copy link
Contributor Author

Hi @clacaputo,

The LTO IB has some compiler optimizations of this kind (Linked Time Optimization). It allows the compiler to optimize entire libraries as if they were single compilation units. I think it is based on the work done by Niccolò Forzano. I attach the link to two talks that he gave explaining how the optimization (both LTO and PGO) works and the improvements we can gain from it:

I hope it helps :)

Many thanks,
Andrea.

@clacaputo
Copy link
Contributor

+reconstruction

  • the PR solves compiler warnings in LTO builds
  • some loss in performance could be introduced and will be evaluated

side note: we should go in the direction of what was stated in #38683 (comment)

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy, @rappoccio (and backports should be raised in the release meeting by the corresponding L2)

@perrotta
Copy link
Contributor

I tend to agree with the @VinInn statement in #38683 (comment)
However, this PR has been already signed by reco. Let me add @cms-sw/core-l2 , as it seems to me a topic which is more related to core than to other sw areas. If also core agrees with merging this, we will,

@perrotta
Copy link
Contributor

assign core

@cmsbuild
Copy link
Contributor

New categories assigned: core

@Dr15Jones,@smuzaffar,@makortel you have been requested to review this Pull request/Issue and eventually sign? Thanks

@makortel
Copy link
Contributor

I feel uneasy (as well) with changes preventing optimizations just to silence informative-only compiler warnings. I understand (and agree) with the desire to get the LTO build free from compilation warnings, but we have other code for which it appears to be difficult to come up with this kind of transformation. I'd like (us) to spend a bit more time to understand the codes in question if a different solution could be found to silence the warnings.

@perrotta
Copy link
Contributor

hold
(see minutes in https://indico.cern.ch/event/1184002/)

@cmsbuild
Copy link
Contributor

Pull request has been put on hold by @perrotta
They need to issue an unhold command to remove the hold state or L1 can unhold it for all

@smuzaffar
Copy link
Contributor

-Wstrict-overflow flag is deprecated and we have dropped it (cms-sw/cmsdist#8026). So these changes are not needed

@smuzaffar smuzaffar closed this Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants