[Bug c/94631] Wrong codegen for arithmetic on bitfields

2022-10-25 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94631 Andrew Pinski changed: What|Removed |Added CC||hjl.tools at gmail dot com --- Comment #

[Bug c/94631] Wrong codegen for arithmetic on bitfields

2020-04-17 Thread bugdal at aerifal dot cx
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94631 --- Comment #8 from Rich Felker --- OK, I think it's in 6.3.1.1 Boolean, characters, and integers, ΒΆ2, but somewhat poorly worded: "The following may be used in an expression wherever an int or unsigned int may be used: - An object or expressi

[Bug c/94631] Wrong codegen for arithmetic on bitfields

2020-04-17 Thread bugdal at aerifal dot cx
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94631 --- Comment #7 from Rich Felker --- Can you provide a citation for that?

[Bug c/94631] Wrong codegen for arithmetic on bitfields

2020-04-17 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94631 --- Comment #6 from joseph at codesourcery dot com --- On Fri, 17 Apr 2020, bugdal at aerifal dot cx wrote: > No, GCC's treatment also seems to mess up bitfields smaller than int and fully > governed by the standard (no implementation-defined us

[Bug c/94631] Wrong codegen for arithmetic on bitfields

2020-04-17 Thread bugdal at aerifal dot cx
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94631 --- Comment #5 from Rich Felker --- No, GCC's treatment also seems to mess up bitfields smaller than int and fully governed by the standard (no implementation-defined use of non-int types): struct foo { unsigned x:31; }; struct foo bar = {0

[Bug c/94631] Wrong codegen for arithmetic on bitfields

2020-04-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94631 --- Comment #4 from Richard Biener --- (In reply to Andrew Pinski from comment #3) > (In reply to Rich Felker from comment #2) > > So basically the outcome of DR120 was allowing the GCC behavior? It still > > seems like a bad thing, not required,

[Bug c/94631] Wrong codegen for arithmetic on bitfields

2020-04-16 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94631 --- Comment #3 from Andrew Pinski --- (In reply to Rich Felker from comment #2) > So basically the outcome of DR120 was allowing the GCC behavior? It still > seems like a bad thing, not required, and likely to produce exploitable bugs > (due to t

[Bug c/94631] Wrong codegen for arithmetic on bitfields

2020-04-16 Thread bugdal at aerifal dot cx
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94631 --- Comment #2 from Rich Felker --- So basically the outcome of DR120 was allowing the GCC behavior? It still seems like a bad thing, not required, and likely to produce exploitable bugs (due to truncation of arithmetic) as well as very poor-perf

[Bug c/94631] Wrong codegen for arithmetic on bitfields

2020-04-16 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94631 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---