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

Fix compiler error with GCC 7 #235

Merged
merged 1 commit into from
Aug 13, 2019
Merged

Conversation

makortel
Copy link
Collaborator

Needed to build mkFit as a real CMSSW external.

@makortel makortel mentioned this pull request Aug 13, 2019
18 tasks
@osschar osschar merged commit 8372eb5 into trackreco:devel Aug 13, 2019
@makortel
Copy link
Collaborator Author

Here are the benchmarks for this PR
https://mkortela.web.cern.ch/mkortela/tracking/mkfit/PR/PR235/
(despite of the technical difficulties with phi2)

@davidlange6
Copy link
Collaborator

davidlange6 commented Aug 13, 2019 via email

@makortel
Copy link
Collaborator Author

Did gcc8 get checked as part of this testing? that may soon be the default...(so will hold things up)

No, but I'll test gcc8 as well before making a PR to cmsdist.

@makortel
Copy link
Collaborator Author

Did gcc8 get checked as part of this testing? that may soon be the default...(so will hold things up)

No, but I'll test gcc8 as well before making a PR to cmsdist.

The HEAD of devel (including this PR) compiles fine with gcc8 (there are bunch of warnings though, but no errors).

@davidlange6
Copy link
Collaborator

davidlange6 commented Aug 13, 2019 via email

@makortel
Copy link
Collaborator Author

warnings that cmssw fails on? (the gcc8 build of cmssw is currently warning free - I suppose that being an external it only matters which warnings spill over into the api)

No, the warnings are not part of the API exposed to (or more correctly being used by) CMSSW. Anyway, the full list of warnings (with gcc8) is here

Propagation.cc: In function 'mkfit::TrackState mkfit::propagateHelixToNextSolid(mkfit::TrackState, const mkfit::Geometry&, mkfit::PropagationFlags)':
Propagation.cc:299:7: warning: 'prev_solid' may be used uninitialized in this function [-Wmaybe-uninitialized]
       if (solid == prev_solid)
       ^~
Propagation.cc:301:9: warning: 'prev_distance' may be used uninitialized in this function [-Wmaybe-uninitialized]
         if (distance > prev_distance)
         ^~


CylCowWLids.cc:39:9: warning: 'float {anonymous}::getEta(float)' defined but not used [-Wunused-function]
   float getEta(float theta)
         ^~~~~~


CandCloner.cc: In member function 'void mkfit::CandCloner::ProcessSeedRange(int, int)':
CandCloner.cc:130:46: warning: 'void* memcpy(void*, const void*, size_t)' writing to an object of type '__gnu_cxx::__alloc_traits<std::allocator<mkfit::Track>, mkfit::Track>::value_type' {aka 'class mkfit::Track'} with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
  memcpy( & ccand[ii], & cv[ii], sizeof(Track));
                                              ^
In file included from MkFinder.h:6,
                 from CandCloner.h:4,
                 from CandCloner.cc:1:
../Track.h:125:7: note: '__gnu_cxx::__alloc_traits<std::allocator<mkfit::Track>, mkfit::Track>::value_type' {aka 'class mkfit::Track'} declared here
 class Track
       ^~~~~


MkBuilder.cc:161:8: warning: 'bool {anonymous}::sortCandByHitsChi2(const mkfit::Track&, const mkfit::Track&)' defined but not used [-Wunused-function]
   bool sortCandByHitsChi2(const Track& cand1, const Track& cand2)
        ^~~~~~~~~~~~~~~~~~


In file included from Ice/IceRevisitedRadix.cc:56:
Ice/IceFPU.h: In function 'float FastFabs(float)':
Ice/IceFPU.h:18:28: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 #define IR(x)  ((udword&)(x))
                            ^
Ice/IceFPU.h:37:22: note: in expansion of macro 'IR'
   udword FloatBits = IR(x)&0x7fffffff;
                      ^~
Ice/IceFPU.h:27:27: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 #define FR(x)  ((float&)(x))
                           ^
Ice/IceFPU.h:38:10: note: in expansion of macro 'FR'
   return FR(FloatBits);
          ^~
Ice/IceFPU.h: In function 'float fsat(float)':
Ice/IceFPU.h:61:23: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   udword y = (udword&)f & ~((sdword&)f >>31);
                       ^
Ice/IceFPU.h:61:38: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   udword y = (udword&)f & ~((sdword&)f >>31);
                                      ^
Ice/IceFPU.h:62:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   return (float&)y;
                  ^
Ice/IceFPU.h: In function 'float frsqrt(float)':
Ice/IceFPU.h:69:37: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   udword y = 0x5f3759df - ((udword&)f >> 1);
                                     ^
Ice/IceFPU.h:71:11: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   (float&)y  = (float&)y * ( 1.5f - ( x * (float&)y * (float&)y ) );
           ^
Ice/IceFPU.h:71:24: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   (float&)y  = (float&)y * ( 1.5f - ( x * (float&)y * (float&)y ) );
                        ^
Ice/IceFPU.h:71:51: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   (float&)y  = (float&)y * ( 1.5f - ( x * (float&)y * (float&)y ) );
                                                   ^
Ice/IceFPU.h:71:63: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   (float&)y  = (float&)y * ( 1.5f - ( x * (float&)y * (float&)y ) );
                                                               ^
Ice/IceFPU.h:73:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   return (float&)y;
                  ^
Ice/IceFPU.h: In function 'float InvSqrt(const float&)':
Ice/IceFPU.h:80:14: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   float y = *(float*)&tmp;
              ^~~~~~~~~~~~
Ice/IceFPU.h: In function 'float RSqrt(float)':
Ice/IceFPU.h:94:10: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   i  = * (long *) &y;
          ^~~~~~~~~~~
Ice/IceFPU.h:96:10: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   y  = * (float *) &i;
          ^~~~~~~~~~~~
Ice/IceFPU.h: In function 'float fsqrt(float)':
Ice/IceFPU.h:105:27: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   udword y = ( ( (sdword&)f - 0x3f800000 ) >> 1 ) + 0x3f800000;
                           ^
Ice/IceFPU.h:109:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   return (float&)y;
                  ^
Ice/IceFPU.h: In function 'float fepsilon(float)':
Ice/IceFPU.h:115:23: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   udword b = (udword&)f & 0xff800000;
                       ^
Ice/IceFPU.h:117:11: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   (float&)a -= (float&)b;
           ^
Ice/IceFPU.h:117:24: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   (float&)a -= (float&)b;
                        ^
Ice/IceFPU.h:119:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   return (float&)a;
                  ^
Ice/IceFPU.h: In function 'bool IsNAN(float)':
Ice/IceFPU.h:18:28: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 #define IR(x)  ((udword&)(x))
                            ^
Ice/IceFPU.h:123:45: note: in expansion of macro 'IR'
 inline_ bool IsNAN(float value)   { return (IR(value)&0x7f800000) == 0x7f800000; }
                                             ^~
Ice/IceFPU.h: In function 'bool IsIndeterminate(float)':
Ice/IceFPU.h:18:28: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 #define IR(x)  ((udword&)(x))
                            ^
Ice/IceFPU.h:124:52: note: in expansion of macro 'IR'
 inline_ bool IsIndeterminate(float value) { return IR(value) == 0xffc00000; }
                                                    ^~
Ice/IceFPU.h: In function 'bool IsPlusInf(float)':
Ice/IceFPU.h:18:28: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 #define IR(x)  ((udword&)(x))
                            ^
Ice/IceFPU.h:125:47: note: in expansion of macro 'IR'
 inline_ bool IsPlusInf(float value)  { return IR(value) == 0x7f800000; }
                                               ^~
Ice/IceFPU.h: In function 'bool IsMinusInf(float)':
Ice/IceFPU.h:18:28: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 #define IR(x)  ((udword&)(x))
                            ^
Ice/IceFPU.h:126:48: note: in expansion of macro 'IR'
 inline_ bool IsMinusInf(float value)  { return IR(value) == 0xff800000; }
                                                ^~
Ice/IceFPU.h: In function 'float ComputeFloatEpsilon()':
Ice/IceFPU.h:174:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   ((udword&)f)^=1;
             ^
Ice/IceFPU.h: In function 'int ConvertToSortable(float)':
Ice/IceFPU.h:285:19: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   int& Fi = (int&)f;
                   ^

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

Successfully merging this pull request may close these issues.

3 participants