Summary: | strict aliasing is not controllable via the option pragma | ||
---|---|---|---|
Product: | gcc | Reporter: | Andrew Pinski <pinskia> |
Component: | other | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | gcc-bugs, jakub, sandra |
Priority: | P3 | Keywords: | documentation |
Version: | 4.4.0 | ||
Target Milestone: | 5.5 | ||
Host: | Target: | ||
Build: | Known to work: | 5.5.0, 6.1.0 | |
Known to fail: | 5.4.0 | Last reconfirmed: | 2008-11-11 20:34:48 |
Description
Andrew Pinski
2008-11-11 01:23:52 UTC
Confirmed. As of current 4.9 trunk, that may have changed a bit. but it still does not do what one would expect: struct s { int x:8; int y:24; }; #pragma GCC push #pragma GCC optimize ("strict-volatile-bitfields") int foo(volatile struct s *x) { return x->x; } #pragma GCC pop #pragma GCC push #pragma GCC optimize ("no-strict-volatile-bitfields") int bar(volatile struct s *x) { return x->x; } #pragma GCC pop Both foo and bar are compiled as if -fno-strict-volatile-bitfields was used on gcc-invocation. Whatever pragma is used last, wins... push/pop are ignored, and does not restore the original settings. (In reply to Bernd Edlinger from comment #2) > As of current 4.9 trunk, that may have changed a bit. > but it still does not do what one would expect: That is a different issue ... This was fixed for GCC 5.5.0 by r5-10168-g26736ac3d17699 and GCC 6.1.0+ by r6-5413-g9dc39706b4afc3 . (In reply to Andrew Pinski from comment #3) > (In reply to Bernd Edlinger from comment #2) > > As of current 4.9 trunk, that may have changed a bit. > > but it still does not do what one would expect: > > That is a different issue ... That was fixed in GCC 5.1.0 (I have not looked into what fixed it though). (In reply to Andrew Pinski from comment #4) > This was fixed for GCC 5.5.0 by r5-10168-g26736ac3d17699 and GCC 6.1.0+ by > r6-5413-g9dc39706b4afc3 . I should say that was the last patch which was needed to fix this, there was most likely others that happened beforehand. |