[Bug tree-optimization/82192] gcc produces incorrect code with -O2 and bit-field

2017-09-12 Thread vsevolod.livinskij at frtk dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82192 --- Comment #4 from Vsevolod Livinskiy --- (In reply to jos...@codesourcery.com from comment #3) > On Tue, 12 Sep 2017, vsevolod.livinskij at frtk dot ru wrote: > > > struct struct_t { > > unsigned int memb : 13; > > }; > > > > extern struc

[Bug tree-optimization/82192] gcc produces incorrect code with -O2 and bit-field

2017-09-12 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82192 --- Comment #3 from joseph at codesourcery dot com --- On Tue, 12 Sep 2017, vsevolod.livinskij at frtk dot ru wrote: > struct struct_t { > unsigned int memb : 13; > }; > > extern struct_t b; > printf("%llu\n", b.memb); unsigned int :

[Bug tree-optimization/82192] gcc produces incorrect code with -O2 and bit-field

2017-09-12 Thread vsevolod.livinskij at frtk dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82192 --- Comment #2 from Vsevolod Livinskiy --- (In reply to Andrew Pinski from comment #1) > Does -fsantize=undefined show anything? > > I am suspecting you have undefined behavior with respect to the shift. Test doesn't contain undefined behavior,

[Bug tree-optimization/82192] gcc produces incorrect code with -O2 and bit-field

2017-09-12 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82192 --- Comment #1 from Andrew Pinski --- Does -fsantize=undefined show anything? I am suspecting you have undefined behavior with respect to the shift.