Open
Description
Description
Several warnings, e.g.
warning: iteration 2 invokes undefined behavior [-Waggressive-loop-optimizations]
are suggesting that for some assignments across loops, e.g.
point[j] += displacement[j];
the result may result in undefined behavior.
Steps to Reproduce
- Clone ITK
- Configure and build
- Run tests
Expected behavior
No warnings are present/no undefined behavior is present across the code base.
Actual behavior
Undefined behavior is present:
Modules/Filtering/ImageGrid/include/itkWarpImageFilter.hxx:308:18:
warning: iteration 2 invokes undefined behavior [-Waggressive-loop-optimizations]
308 | point[j] += displacement[j];
| ^
and
Modules/Filtering/ImageGrid/include/itkWarpImageFilter.hxx:338:18:
warning: iteration 2 invokes undefined behavior [-Waggressive-loop-optimizations]
338 | point[j] += displacement[j];
|
and
Modules/Registration/PDEDeformable/include/itkESMDemonsRegistrationFunction.hxx:331:22:
warning: iteration 2 invokes undefined behavior [-Waggressive-loop-optimizations]
331 | mappedPoint[j] += it.GetCenterPixel()[j];
|
and
Modules/Registration/PDEDeformable/include/itkESMDemonsRegistrationFunction.hxx:383:19:
warning: iteration 2 invokes undefined behavior [-Waggressive-loop-optimizations]
383 | update[j] = factor * usedGradientTimes2[j];
|
Reproducibility
%100
Versions
HEAD
(at this point, ee1f1fc)
Environment
Ubuntu-22.04-gcc11.2-Rel-Python
Additional Information
https://open.cdash.org/viewBuildError.php?type=1&buildid=10193131
PR #5166 unsuccessfully claimed to fix these warnings.