[Bug tree-optimization/97386] [8/9 Regression] wrong code with __builtin_bswap16() of rotated 64bit value

2021-04-22 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97386

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #9 from Jakub Jelinek  ---
Fixed.

[Bug tree-optimization/97386] [8/9 Regression] wrong code with __builtin_bswap16() of rotated 64bit value

2021-04-22 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97386

--- Comment #8 from CVS Commits  ---
The releases/gcc-8 branch has been updated by Jakub Jelinek
:

https://gcc.gnu.org/g:615b19069a9afd9faf803d6888ac49d03065762d

commit r8-10860-g615b19069a9afd9faf803d6888ac49d03065762d
Author: Jakub Jelinek 
Date:   Tue Oct 13 19:13:26 2020 +0200

combine: Fix up simplify_shift_const_1 for nested ROTATEs [PR97386]

The following testcases are miscompiled (the first one since my
improvements
to rotate discovery on GIMPLE, the other one for many years) because
combiner optimizes nested ROTATEs with narrowing SUBREG in between (i.e.
the outer rotate is performed in shorter precision than the inner one) to
just one ROTATE of the rotated constant.  While that (under certain
conditions) can work for shifts, it can't work for rotates where we can
only
do that with rotates of the same precision.

2020-10-13  Jakub Jelinek  

PR rtl-optimization/97386
* combine.c (simplify_shift_const_1): Don't optimize nested ROTATEs
if
they have different modes.

* gcc.c-torture/execute/pr97386-1.c: New test.
* gcc.c-torture/execute/pr97386-2.c: New test.

(cherry picked from commit 1a98b22b0468214ae8463d075dacaeea1d46df15)

[Bug tree-optimization/97386] [8/9 Regression] wrong code with __builtin_bswap16() of rotated 64bit value

2021-04-20 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97386

--- Comment #7 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
:

https://gcc.gnu.org/g:1471e383f4909e7d6bd548d010eb96afcf2d241e

commit r9-9390-g1471e383f4909e7d6bd548d010eb96afcf2d241e
Author: Jakub Jelinek 
Date:   Tue Oct 13 19:13:26 2020 +0200

combine: Fix up simplify_shift_const_1 for nested ROTATEs [PR97386]

The following testcases are miscompiled (the first one since my
improvements
to rotate discovery on GIMPLE, the other one for many years) because
combiner optimizes nested ROTATEs with narrowing SUBREG in between (i.e.
the outer rotate is performed in shorter precision than the inner one) to
just one ROTATE of the rotated constant.  While that (under certain
conditions) can work for shifts, it can't work for rotates where we can
only
do that with rotates of the same precision.

2020-10-13  Jakub Jelinek  

PR rtl-optimization/97386
* combine.c (simplify_shift_const_1): Don't optimize nested ROTATEs
if
they have different modes.

* gcc.c-torture/execute/pr97386-1.c: New test.
* gcc.c-torture/execute/pr97386-2.c: New test.

(cherry picked from commit 1a98b22b0468214ae8463d075dacaeea1d46df15)

[Bug tree-optimization/97386] [8/9 Regression] wrong code with __builtin_bswap16() of rotated 64bit value

2020-10-16 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97386

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[8/9/10/11 Regression]  |[8/9 Regression] wrong code
   |wrong code with |with __builtin_bswap16() of
   |__builtin_bswap16() of  |rotated 64bit value
   |rotated 64bit value |

--- Comment #6 from Jakub Jelinek  ---
Fixed for 10.3+ and 11.1+ so far.