[Bug middle-end/87623] bytes swapped in register when comparing cause fail when compiled with -O1 or higher

2018-10-18 Thread george.thopas at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87623

--- Comment #9 from George Thopas  ---
(In reply to Eric Botcazou from comment #8)
> Thanks for reporting the problem.

And thanks for the swift resolution !

[Bug middle-end/87623] bytes swapped in register when comparing cause fail when compiled with -O1 or higher

2018-10-17 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87623

Eric Botcazou  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |6.5

--- Comment #8 from Eric Botcazou  ---
Thanks for reporting the problem.

[Bug middle-end/87623] bytes swapped in register when comparing cause fail when compiled with -O1 or higher

2018-10-17 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87623

--- Comment #7 from Eric Botcazou  ---
Author: ebotcazou
Date: Wed Oct 17 17:54:26 2018
New Revision: 265245

URL: https://gcc.gnu.org/viewcvs?rev=265245=gcc=rev
Log:
PR middle-end/87623
* fold-const.c (fold_truth_andor_1): If the right side is not constant,
bail out if both sides do not have the same storage order.

Added:
branches/gcc-6-branch/gcc/testsuite/gcc.c-torture/execute/pr87623.c
  - copied unchanged from r265242,
trunk/gcc/testsuite/gcc.c-torture/execute/pr87623.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/fold-const.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug middle-end/87623] bytes swapped in register when comparing cause fail when compiled with -O1 or higher

2018-10-17 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87623

--- Comment #6 from Eric Botcazou  ---
Author: ebotcazou
Date: Wed Oct 17 17:53:02 2018
New Revision: 265244

URL: https://gcc.gnu.org/viewcvs?rev=265244=gcc=rev
Log:
PR middle-end/87623
* fold-const.c (fold_truth_andor_1): If the right side is not constant,
bail out if both sides do not have the same storage order.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.c-torture/execute/pr87623.c
  - copied unchanged from r265242,
trunk/gcc/testsuite/gcc.c-torture/execute/pr87623.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/fold-const.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug middle-end/87623] bytes swapped in register when comparing cause fail when compiled with -O1 or higher

2018-10-17 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87623

--- Comment #5 from Eric Botcazou  ---
Author: ebotcazou
Date: Wed Oct 17 17:52:10 2018
New Revision: 265243

URL: https://gcc.gnu.org/viewcvs?rev=265243=gcc=rev
Log:
PR middle-end/87623
* fold-const.c (fold_truth_andor_1): If the right side is not constant,
bail out if both sides do not have the same storage order.

Added:
branches/gcc-8-branch/gcc/testsuite/gcc.c-torture/execute/pr87623.c
  - copied unchanged from r265242,
trunk/gcc/testsuite/gcc.c-torture/execute/pr87623.c
Modified:
branches/gcc-8-branch/gcc/ChangeLog
branches/gcc-8-branch/gcc/fold-const.c
branches/gcc-8-branch/gcc/testsuite/ChangeLog

[Bug middle-end/87623] bytes swapped in register when comparing cause fail when compiled with -O1 or higher

2018-10-17 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87623

--- Comment #4 from Eric Botcazou  ---
Author: ebotcazou
Date: Wed Oct 17 17:49:28 2018
New Revision: 265242

URL: https://gcc.gnu.org/viewcvs?rev=265242=gcc=rev
Log:
PR middle-end/87623
* fold-const.c (fold_truth_andor_1): If the right side is not constant,
bail out if both sides do not have the same storage order.

Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr87623.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
trunk/gcc/testsuite/ChangeLog

[Bug middle-end/87623] bytes swapped in register when comparing cause fail when compiled with -O1 or higher

2018-10-17 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87623

Eric Botcazou  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |ebotcazou at gcc dot 
gnu.org

--- Comment #3 from Eric Botcazou  ---
> I would guess optimize_bit_field_compare or friends in fold-const.c wreck
> this.

It's the coaslescing done in fold_truth_andor_1.

[Bug middle-end/87623] bytes swapped in register when comparing cause fail when compiled with -O1 or higher

2018-10-17 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87623

Eric Botcazou  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-10-17
 Ever confirmed|0   |1
  Known to fail||6.4.1, 7.3.1, 8.2.1, 9.0

--- Comment #2 from Eric Botcazou  ---
Confirmed with all tested compilers.

[Bug middle-end/87623] bytes swapped in register when comparing cause fail when compiled with -O1 or higher

2018-10-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87623

Richard Biener  changed:

   What|Removed |Added

   Keywords||wrong-code
 CC||ebotcazou at gcc dot gnu.org
  Component|tree-optimization   |middle-end
  Build|gcc version 8.2.0 (Gentoo   |
   |8.2.0-r3 p1.4)  |

--- Comment #1 from Richard Biener  ---
I would guess optimize_bit_field_compare or friends in fold-const.c wreck this.