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

[GCC12] Multiple maybe-uninitialized warnings in L1CaloLayer1 #41794

Open
iarspider opened this issue May 30, 2023 · 12 comments
Open

[GCC12] Multiple maybe-uninitialized warnings in L1CaloLayer1 #41794

iarspider opened this issue May 30, 2023 · 12 comments

Comments

@iarspider
Copy link
Contributor

iarspider commented May 30, 2023

GCC 12 is emitting compilation warnings about maybe-uninitialized variables in L1TCaloLayer1 code:

  1. Arrays contents is not initialized in L1TCaloLayer1::costruct:
>> Building edm plugin tmp/el8_amd64_gcc12/src/L1Trigger/L1TCaloLayer1/plugins/L1TriggerL1TCaloLayer1Auto/libL1TriggerL1TCaloLayer1Auto.so
.../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/bin/c++ -O2 -pthread -pipe -Werror=main -Werror=pointer-arith -Werror=overlength-strings -Wno-vla -Werror=overflow -std=c++17 -ftree-vectorize -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 -Wno-error=array-bounds -Warray-bounds -fuse-ld=bfd -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_gcc12/src/L1Trigger/L1TCaloLayer1/plugins/L1TriggerL1TCaloLayer1Auto/L1TCaloLayer1.cc.o tmp/el8_amd64_gcc12/src/L1Trigger/L1TCaloLayer1/plugins/L1TriggerL1TCaloLayer1Auto/L1TCaloLayer1Validator.cc.o tmp/el8_amd64_gcc12/src/L1Trigger/L1TCaloLayer1/plugins/L1TriggerL1TCaloLayer1Auto/L1TCaloSummary.cc.o -o tmp/el8_amd64_gcc12/src/L1Trigger/L1TCaloLayer1/plugins/L1TriggerL1TCaloLayer1Auto/libL1TriggerL1TCaloLayer1Auto.so -Wl,-E -Wl,--hash-style=gnu -L.../CMSSW_13_2_X_2023-05-29-1100/biglib/el8_amd64_gcc12 -L.../CMSSW_13_2_X_2023-05-29-1100/lib/el8_amd64_gcc12 -L.../CMSSW_13_2_X_2023-05-29-1100/external/el8_amd64_gcc12/lib -L.../CMSSW_13_2_X_2023-05-29-1100/static/el8_amd64_gcc12 -lL1TriggerL1TCaloLayer1 -lL1TriggerL1TCalorimeter -lDataFormatsL1TCalorimeter -lGeometryHcalTowerAlgo -lDataFormatsL1Trigger -lGeometryCaloTopology -lCalibFormatsCaloTPG -lDataFormatsL1TrackTrigger -lGeometryHcalCommonData -lCondFormatsDataRecord -lDataFormatsTrackerCommon -lDetectorDescriptionRegressionTest -lGeometryCaloGeometry -lGeometryHGCalTBCommonData -lCondFormatsL1TObjects -lDataFormatsCaloTowers -lDataFormatsGeometryCommonDetAlgo -lDataFormatsSiStripCluster -lDetectorDescriptionParser -lGeometryHGCalCommonData -lGeometryRecords -lCondFormatsAlignmentRecord -lDataFormatsCandidate -lDataFormatsEcalDigi -lDataFormatsGeometrySurface -lDataFormatsHcalDigi -lDataFormatsL1GlobalCaloTrigger -lDataFormatsTrajectoryState -lDetectorDescriptionCore -lDetectorDescriptionDDCMS -lCalibFormatsCaloObjects -lCondFormatsGeometryObjects -lDataFormatsCLHEP -lDataFormatsEcalDetId -lDataFormatsForwardDetId -lDataFormatsGeometryVector -lDataFormatsHcalDetId -lDataFormatsL1CaloTrigger -lDataFormatsL1GlobalTrigger -lDataFormatsSiPixelDetId -lDataFormatsSiStripDetId -lFWCoreFramework -lSimDataFormatsCaloHit -lDataFormatsDetId -lDataFormatsL1GlobalMuonTrigger -lDataFormatsMath -lDataFormatsPhase2TrackerDigi -lDataFormatsSiPixelCluster -lDataFormatsSiStripDigi -lFWCoreCommon -lFWCoreServiceRegistry -lDataFormatsCommon -lFWCoreParameterSet -lFWCoreMessageLogger -lDataFormatsProvenance -lFWCorePluginManager -lFWCoreReflection -lCondFormatsSerialization -lFWCoreConcurrency -lFWCoreUtilities -lFWCoreVersion -lSimDataFormatsEncodedEventId -lUtilitiesXerces -lDDAlign -lDDCond -lDDCore -lDDParsers -lPhysics -lHist -lMatrix -lGenVector -lMathMore -lTree -lNet -lGeom -lThread -lMathCore -lRIO -lboost_serialization -lCore -lboost_thread -lboost_date_time -lCLHEP -lpcre -lbz2 -lgsl -lemulator_interface -luuid -ltbb -ltmeventsetup -ltmtable -ltmxsd -ltmgrammar -ltmutil -lxerces-c -llzma -lz -lfmt -lcms-md5 -lopenblas -lcrypt -ldl -lrt -lstdc++fs -ltinyxml2
lto-wrapper: warning: using serial compilation of 2 LTRANS jobs
lto-wrapper: note: see the '-flto' option documentation for more information
In member function 'construct',
    inlined from 'construct' at .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/alloc_traits.h:516:17,
    inlined from 'push_back' at .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/stl_vector.h:1281:30,
    inlined from 'beginRun' at .../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloLayer1.cc:315:22:
  .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/new_allocator.h:175:11: warning: 'eCalLayer1EtaSideEtArray' may be used uninitialized [-Wmaybe-uninitialized]
   175 |         { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
      |           ^
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloLayer1.cc: In member function 'beginRun':
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloLayer1.cc:312:86: note: 'eCalLayer1EtaSideEtArray' declared here
  312 |     std::array<std::array<std::array<uint32_t, nEtBins>, nCalSideBins>, nCalEtaBins> eCalLayer1EtaSideEtArray;
      |                                                                                      ^
In member function 'push_back',
    inlined from 'beginRun' at .../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloLayer1.cc:315:22:
  .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/stl_vector.h:1287:28: warning: 'eCalLayer1EtaSideEtArray' may be used uninitialized [-Wmaybe-uninitialized]
  1287 |           _M_realloc_insert(end(), __x);
      |                            ^
.../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/vector.tcc: In member function 'beginRun':
.../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/vector.tcc:439:7: note: by argument 3 of type 'const struct array &' to '_M_realloc_insert' declared here
  439 |       vector<_Tp, _Alloc>::
      |       ^
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloLayer1.cc:312:86: note: 'eCalLayer1EtaSideEtArray' declared here
  312 |     std::array<std::array<std::array<uint32_t, nEtBins>, nCalSideBins>, nCalEtaBins> eCalLayer1EtaSideEtArray;
      |                                                                                      ^
In member function 'construct',
    inlined from 'construct' at .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/alloc_traits.h:516:17,
    inlined from 'push_back' at .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/stl_vector.h:1281:30,
    inlined from 'beginRun' at .../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloLayer1.cc:316:22:
  .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/new_allocator.h:175:11: warning: 'hCalLayer1EtaSideEtArray' may be used uninitialized [-Wmaybe-uninitialized]
   175 |         { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
      |           ^
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloLayer1.cc: In member function 'beginRun':
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloLayer1.cc:313:86: note: 'hCalLayer1EtaSideEtArray' declared here
  313 |     std::array<std::array<std::array<uint32_t, nEtBins>, nCalSideBins>, nCalEtaBins> hCalLayer1EtaSideEtArray;
      |                                                                                      ^
In member function 'push_back',
    inlined from 'beginRun' at .../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloLayer1.cc:316:22:
  .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/stl_vector.h:1287:28: warning: 'hCalLayer1EtaSideEtArray' may be used uninitialized [-Wmaybe-uninitialized]
  1287 |           _M_realloc_insert(end(), __x);
      |                            ^
.../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/vector.tcc: In member function 'beginRun':
.../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/vector.tcc:439:7: note: by argument 3 of type 'const struct array &' to '_M_realloc_insert' declared here
  439 |       vector<_Tp, _Alloc>::
      |       ^
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloLayer1.cc:313:86: note: 'hCalLayer1EtaSideEtArray' declared here
  313 |     std::array<std::array<std::array<uint32_t, nEtBins>, nCalSideBins>, nCalEtaBins> hCalLayer1EtaSideEtArray;
      |                                                                                      ^
In member function 'construct',
    inlined from 'construct' at .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/alloc_traits.h:516:17,
    inlined from 'push_back' at .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/stl_vector.h:1281:30,
    inlined from 'beginRun' at .../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloLayer1.cc:317:20:
  .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/new_allocator.h:175:11: warning: 'hfLayer1EtaEtArray' may be used uninitialized [-Wmaybe-uninitialized]
   175 |         { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
      |           ^
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloLayer1.cc: In member function 'beginRun':
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloLayer1.cc:314:59: note: 'hfLayer1EtaEtArray' declared here
  314 |     std::array<std::array<uint32_t, nEtBins>, nHfEtaBins> hfLayer1EtaEtArray;
      |                                                           ^
In member function 'construct',
    inlined from 'construct' at .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/alloc_traits.h:516:17,
    inlined from '_M_realloc_insert' at .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/vector.tcc:462:28,
    inlined from 'push_back' at .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/stl_vector.h:1287:21,
    inlined from 'beginRun' at .../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloLayer1.cc:317:20:
  .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/new_allocator.h:175:11: warning: 'hfLayer1EtaEtArray' may be used uninitialized [-Wmaybe-uninitialized]
   175 |         { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
      |           ^
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloLayer1.cc: In member function 'beginRun':
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloLayer1.cc:314:59: note: 'hfLayer1EtaEtArray' declared here
  314 |     std::array<std::array<uint32_t, nEtBins>, nHfEtaBins> hfLayer1EtaEtArray;
      |                                                           ^
  1. False-positive warnings about modelResult not being initialized in L1TCaloSummary::produce (as far as I understand, it is filled later, so maybe silence the warning for that block?)
In member function 'clearUnusedBits',
    inlined from '__ct ' at .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/etc/ap_private.h:1595:20,
    inlined from '__ct ' at .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/ap_common.h:248:18,
    inlined from '__ct ' at .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/ap_fixed_base.h:389:26,
    inlined from '__ct ' at .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/ap_fixed.h:33:28,
    inlined from 'produce' at .../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloSummary.cc:220:32:
  .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/etc/ap_private.h:2109:27: warning: 'MEM[(volatile struct ap_private *)&modelResult].VAL' may be used uninitialized [-Wmaybe-uninitialized]
  2109 |             ? ((((int64_t)VAL) << (excess_bits)) >> (excess_bits))
      |                           ^
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloSummary.cc: In member function 'produce':
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloSummary.cc:220:19: note: 'modelResult' declared here
  220 |   ap_fixed<11, 5> modelResult[1];
      |                   ^
In member function 'clearUnusedBits',
    inlined from '__ct ' at .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/etc/ap_private.h:1595:20,
    inlined from '__ct ' at .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/ap_common.h:248:18,
    inlined from '__ct ' at .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/ap_fixed_base.h:507:3,
    inlined from '__ct ' at .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/ap_fixed.h:295:3,
    inlined from 'produce' at .../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloSummary.cc:216:59:
  .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/etc/ap_private.h:2110:42: warning: 'MEM[(volatile struct ap_private *)&D.16016].VAL' may be used uninitialized [-Wmaybe-uninitialized]
  2110 |             : (excess_bits ? (((uint64_t)VAL) << (excess_bits)) >> (excess_bits)
      |                                          ^
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloSummary.cc: In member function 'produce':
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloSummary.cc:216:59: note: '<anonymous>' declared here
  216 |     modelInput[14 * i.gctPhi() + (i.gctEta() - 4)] = i.et();
      |                                                           ^
In member function 'clearUnusedBits',
    inlined from '__ct ' at .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/etc/ap_private.h:1595:20,
    inlined from '__ct ' at .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/ap_common.h:248:18,
    inlined from '__ct ' at .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/ap_fixed_base.h:389:26,
    inlined from '__ct ' at .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/ap_fixed_base.h:507:3,
    inlined from '__ct ' at .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/ap_fixed.h:295:3,
    inlined from 'produce' at .../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloSummary.cc:216:59:
  .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/etc/ap_private.h:2110:42: warning: 'MEM[(volatile struct ap_private *)&tmp].VAL' may be used uninitialized [-Wmaybe-uninitialized]
  2110 |             : (excess_bits ? (((uint64_t)VAL) << (excess_bits)) >> (excess_bits)
      |                                          ^
.../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/ap_fixed_base.h: In member function 'produce':
.../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/ap_fixed_base.h:507:3: note: 'tmp' declared here
  507 |   CTOR_FROM_INT(unsigned int, _AP_SIZE_int, false)
      |   ^
In member function 'clearUnusedBits',
    inlined from '__ct ' at .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/etc/ap_private.h:1595:20,
    inlined from '__ct ' at .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/ap_common.h:248:18,
    inlined from '__ct ' at .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/ap_int_base.h:169:24,
    inlined from 'to_float' at .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/ap_fixed_base.h:904:31,
    inlined from 'produce' at .../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/plugins/L1TCaloSummary.cc:225:42:
  .../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/etc/ap_private.h:2110:42: warning: 'MEM[(volatile struct ap_private *)&tmp].VAL' may be used uninitialized [-Wmaybe-uninitialized]
  2110 |             : (excess_bits ? (((uint64_t)VAL) << (excess_bits)) >> (excess_bits)
      |                                          ^
.../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/ap_fixed_base.h: In member function 'produce':
.../external/hls/2019.08-a842a7d71d45f27e643fb5cc4eec3d81/include/ap_fixed_base.h:904:31: note: 'tmp' declared here
  904 |     ap_int_base<_AP_W, false> tmp;
      |                               ^
  1. Arrays not initialized in L1TCaloLayer1FetchLUTs(...):
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/src/L1TCaloLayer1FetchLUTs.cc: In function 'L1TCaloLayer1FetchLUTs':
  .../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/src/L1TCaloLayer1FetchLUTs.cc:177:19: warning: 'phiLUT' may be used uninitialized [-Wmaybe-uninitialized]
   177 |     eLUT.push_back(phiLUT);
      |                   ^
.../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/stl_vector.h:1276:7: note: by argument 2 of type 'const struct value_type &' to 'push_back' declared here
 1276 |       push_back(const value_type& __x)
      |       ^
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/src/L1TCaloLayer1FetchLUTs.cc:176:86: note: 'phiLUT' declared here
  176 |     std::array<std::array<std::array<uint32_t, nEtBins>, nCalSideBins>, nCalEtaBins> phiLUT;
      |                                                                                      ^
  .../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/src/L1TCaloLayer1FetchLUTs.cc:228:19: warning: 'phiLUT' may be used uninitialized [-Wmaybe-uninitialized]
   228 |     hLUT.push_back(phiLUT);
      |                   ^
.../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/stl_vector.h:1276:7: note: by argument 2 of type 'const struct value_type &' to 'push_back' declared here
 1276 |       push_back(const value_type& __x)
      |       ^
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/src/L1TCaloLayer1FetchLUTs.cc:227:86: note: 'phiLUT' declared here
  227 |     std::array<std::array<std::array<uint32_t, nEtBins>, nCalSideBins>, nCalEtaBins> phiLUT;
      |                                                                                      ^
In member function 'construct',
    inlined from 'construct' at .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/alloc_traits.h:516:17,
    inlined from 'push_back' at .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/stl_vector.h:1281:30,
    inlined from 'L1TCaloLayer1FetchLUTs' at .../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/src/L1TCaloLayer1FetchLUTs.cc:292:20:
  .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/new_allocator.h:175:11: warning: 'phiLUT' may be used uninitialized [-Wmaybe-uninitialized]
   175 |         { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
      |           ^
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/src/L1TCaloLayer1FetchLUTs.cc: In function 'L1TCaloLayer1FetchLUTs':
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/src/L1TCaloLayer1FetchLUTs.cc:291:59: note: 'phiLUT' declared here
  291 |     std::array<std::array<uint32_t, nEtBins>, nHfEtaBins> phiLUT;
      |                                                           ^
In member function 'construct',
    inlined from 'construct' at .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/alloc_traits.h:516:17,
    inlined from '_M_realloc_insert' at .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/vector.tcc:462:28,
    inlined from 'push_back' at .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/stl_vector.h:1287:21,
    inlined from 'L1TCaloLayer1FetchLUTs' at .../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/src/L1TCaloLayer1FetchLUTs.cc:292:20:
  .../external/gcc/12.2.1-59043c7bdcfa6002a8c9155ca1109454/include/c++/12.2.1/bits/new_allocator.h:175:11: warning: 'phiLUT' may be used uninitialized [-Wmaybe-uninitialized]
   175 |         { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
      |           ^
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/src/L1TCaloLayer1FetchLUTs.cc: In function 'L1TCaloLayer1FetchLUTs':
.../CMSSW_13_2_X_2023-05-29-1100/src/L1Trigger/L1TCaloLayer1/src/L1TCaloLayer1FetchLUTs.cc:291:59: note: 'phiLUT' declared here
  291 |     std::array<std::array<uint32_t, nEtBins>, nHfEtaBins> phiLUT;
      |                                                           ^

(here I would suggest moving eLUT.push_back(phiLUT); after the code that fills phiLUT)

@iarspider
Copy link
Contributor Author

assign l1

@cmsbuild
Copy link
Contributor

New categories assigned: l1

@epalencia,@aloeliger,@cecilecaillol you have been requested to review this Pull request/Issue and eventually sign? Thanks

@cmsbuild
Copy link
Contributor

A new Issue was created by @iarspider .

@Dr15Jones, @perrotta, @dpiparo, @rappoccio, @makortel, @smuzaffar can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

@makortel
Copy link
Contributor

2. False-positive warnings about modelResult not being initialized in L1TCaloSummary::produce (as far as I understand, it is filled later, so maybe silence the warning for that block?)

Poking around the code of https://github.com/Xilinx/HLS_arbitrary_Precision_Types.git I think the warning is technically correct. All(?) the ap_* types use ap_private underneath. The ap_private version for storing less than 64 bits (as is the case here, AFAICT) has a member variable VAL that is one of the fundamental integer types (as defined here and here). The default constructor does not initialize the VAL but only calls the clearUnusedBits() member function. The clearUnusedBits() indeed reads from VAL before assigning into it, that strictly speaking leads to undefined behavior (irrespective of the variable being written into later).

@aloeliger
Copy link
Contributor

@vshang, @hftsoi, I don't suppose Wisconsin has either of you as the emulator maintainer for CaloL1? If this is one of you, could you take a look at these warnings (if not let me know, I'll do what I can). L1TCaloSummary is my issue, I'll take a look at that when I am back from US CMS.

@iarspider
Copy link
Contributor Author

@aloeliger gentle ping on this

@aloeliger
Copy link
Contributor

@iarspider Thanks for bringing this back to my attention. I can try to take a look at this tomorrow unless it is more urgent?

@aloeliger
Copy link
Contributor

@hftsoi I also want to make one more attempt to ping you to see if there is a Wisconsin maintainer of L1TCaloLayer1. If not I will take a look into fixing it myself..

@iarspider
Copy link
Contributor Author

For reference: build log with the issue.

@aloeliger this is not urgent.

@hftsoi
Copy link
Contributor

hftsoi commented Jul 25, 2023

@hftsoi I also want to make one more attempt to ping you to see if there is a Wisconsin maintainer of L1TCaloLayer1. If not I will take a look into fixing it myself..

sorry I missed your earlier tag somehow. As far as I know there is no active emulator maintainer for CaloL1, people come and go making modification whenever their development depends on it.

@makortel
Copy link
Contributor

Given the statement

this should hopefully fix the remaining warnings in L1TCaloLayer1.

in #42390 (comment), maybe this issue could be closed now?

@cmsbuild
Copy link
Contributor

cms-bot internal usage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants