MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0024252Open CASCADE[OCCT] OCCT:Codingpublic2013-10-11 09:352017-01-23 12:02
Reporterabv 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformLinuxOSOS Version
Product Version[OCCT] 6.7.0 
Target Version[OCCT] 6.7.1Fixed in Version[OCCT] 6.7.1 
Summary0024252: GCC warnings on breakage of strict-aliasing rules
DescriptionWhen building OCCT on Linux platforms, GCC reports multiple warnings on breakage of strict-aliasing rules (about 100 cases in total), for instance:

NCollection_DataMap.hxx:175: dereferencing type-punned pointer will break strict-aliasing rules
TopoDS_Shape.hxx:54: dereferencing pointer ā€˜Eā€™ does break strict-aliasing rules
Steps To ReproduceSee http://jenkins-merge:8080/view/A_dashboard_sse2_master/job/inv_OCCT_master_Products_master_OCCT_Debian60-64_compile/1/warnings13Result/? [^]
TagsNo tags attached.
Test case numberNot needed
Attached Files

- Relationships
parent of 0024489closedbugmaster Open CASCADE Avoid type casts in call to Standard::Free() 
parent of 0024534closedabv Open CASCADE Improve design of Image_PixMap class 
parent of 0024536closedbugmaster Open CASCADE GCC compiler warning on breakage of pointer aliasing rules in BRepFill_Evolved.cxx 
parent of 0024535closedbugmaster Open CASCADE Bad type cast in TDocStd_Document::Update() 
parent of 0024537closedkgv Open CASCADE GCC compiler warnings in byte order reversion code 

-  Notes
(0026153)
rkv (developer)
2013-10-21 10:38

The branch CR24252 is created.

Violation of strict aliasing rules can lead to undefined behaviour when optimization mode is -O2 or higher.
One of possible solutions is usage of union to reference to an object using different types.

Please read
http://www.cyberforum.ru/c/thread802307.html [^]
http://dbp-consulting.com/tutorials/StrictAliasing.html [^]
http://cellperformance.beyond3d.com/articles/2006/06/understanding-strict-aliasing.html [^]
(0027512)
abv (manager)
2014-01-16 10:41

The patch is reviewed; the part which consists in elimination of unnecessary type casts is pushed to branch CR24252_extract; please test. Other remaining problems will be registered as separate issues.
(0027522)
mkv (tester)
2014-01-16 15:21

Dear BugMaster,

Branch CR24252_extract (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: 7f80d976ee40adb74229282e595b5761b94a7876

Number of compiler warnings:

occt component :
Linux: 38 (55 on master)
Windows: 1 (1 on master)

products component :
Linux: 12 (20 on master)
Windows: 2 (2 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 358283328 / 357072508
Total CPU difference: 44045.470000000154 / 42990.139999999854

Testing on Windows:
Total MEMORY difference: 409959504 / 412885964
Total CPU difference: 29722.703125 / 31989.96875

There are not differences in images found by testdiff.

- Related Changesets
occt: master fd03ee4b
Timestamp: 2014-01-15 02:40:18
Author: abv
Committer: bugmaster
Details ] Diff ]
0024252: GCC warnings on breakage of strict-aliasing rules

Fixed type casts in NCollection maps
Avoid invalid type cast in handling of LDOM text object
Use correct pointer type in callback function of Graphic3d_CGraduatedTrihedron class
Format of printf() simplified in IntPatch_Point.cxx
mod - src/Graphic3d/Graphic3d_CGraduatedTrihedron.hxx Diff ] File ]
mod - src/IntPatch/IntPatch_Point.cxx Diff ] File ]
mod - src/NCollection/NCollection_DataMap.hxx Diff ] File ]
mod - src/NCollection/NCollection_DoubleMap.hxx Diff ] File ]
mod - src/NCollection/NCollection_IndexedDataMap.hxx Diff ] File ]
mod - src/NCollection/NCollection_IndexedMap.hxx Diff ] File ]
mod - src/NCollection/NCollection_Map.hxx Diff ] File ]
mod - src/OpenGl/OpenGl_GraduatedTrihedron.hxx Diff ] File ]
mod - src/Visual3d/Visual3d_View.cxx Diff ] File ]
mod - src/XmlMNaming/XmlMNaming_NamedShapeDriver.cxx Diff ] File ]

- Issue History
Date Modified Username Field Change
2013-10-11 09:35 abv New Issue
2013-10-11 09:35 abv Assigned To => bugmaster
2013-10-11 09:36 abv Assigned To bugmaster => rkv
2013-10-11 09:36 abv Status new => assigned
2013-10-21 10:31 rkv Assigned To rkv => abv
2013-10-21 10:38 rkv Note Added: 0026153
2013-12-21 11:13 abv Relationship added parent of 0024489
2014-01-11 11:58 abv Category OCCT Release:BUILD => OCCT:Coding
2014-01-16 10:36 abv Status assigned => resolved
2014-01-16 10:41 abv Note Added: 0027512
2014-01-16 10:41 abv Assigned To abv => bugmaster
2014-01-16 10:41 abv Status resolved => reviewed
2014-01-16 10:52 kgv Platform => Linux
2014-01-16 10:52 kgv Product Version => 6.7.0
2014-01-16 10:52 kgv Target Version => 6.7.1
2014-01-16 11:25 abv Relationship added parent of 0024534
2014-01-16 11:51 mkv Assigned To bugmaster => mkv
2014-01-16 11:58 abv Relationship added parent of 0024536
2014-01-16 11:59 abv Relationship added parent of 0024535
2014-01-16 13:04 abv Relationship added parent of 0024537
2014-01-16 15:21 mkv Note Added: 0027522
2014-01-16 15:22 mkv Test case number => Not needed
2014-01-16 15:22 mkv Assigned To mkv => bugmaster
2014-01-16 15:22 mkv Status reviewed => tested
2014-01-21 11:22 bugmaster Changeset attached => occt master fd03ee4b
2014-01-21 11:22 bugmaster Status tested => verified
2014-01-21 11:22 bugmaster Resolution open => fixed
2014-05-05 13:36 aiv Status verified => closed
2014-05-05 13:37 aiv Fixed in Version => 6.7.1
2017-01-23 12:02 kgv Relationship added related to 0028361


Copyright © 2000 - 2021 MantisBT Team
Powered by Mantis Bugtracker