http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38077
Bernd Edlinger <bernd.edlinger at hotmail dot de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bernd.edlinger at hotmail dot de --- Comment #2 from Bernd Edlinger <bernd.edlinger at hotmail dot de> --- 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.