[Bug tree-optimization/91126] [10 regression] Incorrect constant propagation of BIT_FIELD_REF

2019-07-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91126 --- Comment #6 from Richard Biener --- Testcase that fails for a longer time already: struct S { int a : 24; int b : 8; } s; int main() { s.a = 0xfefefe; s.b = 0xfe; unsigned char c; c = ((unsigned char *))[0]; if (c != 0xfe)

[Bug tree-optimization/91126] [10 regression] Incorrect constant propagation of BIT_FIELD_REF

2019-07-09 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91126 --- Comment #5 from Richard Biener --- Oh, and I think it's a pity we're trying to stay away from optimizing the bitfield cases. I suppose we could also use encode_tree_to_bitpos from the store-merging pass for this purpose, but while operating

[Bug tree-optimization/91126] [10 regression] Incorrect constant propagation of BIT_FIELD_REF

2019-07-09 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91126 --- Comment #4 from Richard Biener --- Created attachment 46581 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46581=edit patch Untested patch that fixes the issue. Value numbering stmt = _1 = BIT_FIELD_REF ; Successfully combined 2

[Bug tree-optimization/91126] [10 regression] Incorrect constant propagation of BIT_FIELD_REF

2019-07-09 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91126 --- Comment #3 from Richard Biener --- So the issue is the usual GET_MODE_SIZE != ref->size. native_encode_int encodes two 32bit numbers (but only 3 bytes from them, in big-endian) while VN expects it to encode a 3-byte 24bit number. There's

[Bug tree-optimization/91126] [10 regression] Incorrect constant propagation of BIT_FIELD_REF

2019-07-09 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91126 Richard Biener changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed|

[Bug tree-optimization/91126] [10 regression] Incorrect constant propagation of BIT_FIELD_REF

2019-07-09 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91126 Andrew Pinski changed: What|Removed |Added Keywords||wrong-code CC|