public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/110490] New: tree-ssa/clz-* and tree-ssa/ctz-* fail on s390x with arch14
@ 2023-06-29 20:25 mpolacek at gcc dot gnu.org
  2023-06-29 20:42 ` [Bug testsuite/110490] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2023-06-29 20:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110490

            Bug ID: 110490
           Summary: tree-ssa/clz-* and tree-ssa/ctz-* fail on s390x with
                    arch14
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

(Not sure what component is most appropriate for this.)

The following FAILs can be seen in
<https://gcc.gnu.org/pipermail/gcc-testresults/2023-June/786039.html>
(s390x-ibm-linux-gnu arch14)
but not in
<https://gcc.gnu.org/pipermail/gcc-testresults/2023-June/786004.html>
(s390x-ibm-linux-gnu default)

It would be great to fix them.

FAIL: gcc.dg/tree-ssa/clz-char.c scan-tree-dump-times optimized
"__builtin_clz|\\\\.CLZ" 1
FAIL: gcc.dg/tree-ssa/clz-complement-char.c scan-tree-dump-times optimized
"__builtin_clz|\\\\.CLZ" 1
FAIL: gcc.dg/tree-ssa/clz-complement-int.c scan-tree-dump-times optimized
"__builtin_clz|\\\\.CLZ" 1
FAIL: gcc.dg/tree-ssa/clz-complement-long.c scan-tree-dump-times optimized
"__builtin_clz|\\\\.CLZ" 1
FAIL: gcc.dg/tree-ssa/clz-int.c scan-tree-dump-times optimized
"__builtin_clz|\\\\.CLZ" 1
FAIL: gcc.dg/tree-ssa/clz-long.c scan-tree-dump-times optimized
"__builtin_clz|\\\\.CLZ" 1
FAIL: gcc.dg/tree-ssa/ctz-char.c scan-tree-dump-times optimized
"__builtin_ctz|\\\\.CTZ" 1
FAIL: gcc.dg/tree-ssa/ctz-complement-char.c scan-tree-dump-times optimized
"__builtin_ctz|\\\\.CTZ" 1
FAIL: gcc.dg/tree-ssa/ctz-complement-int.c scan-tree-dump-times optimized
"__builtin_ctz|\\\\.CTZ" 1
FAIL: gcc.dg/tree-ssa/ctz-complement-long-long.c scan-tree-dump-times optimized
"__builtin_ctz|\\\\.CTZ" 1
FAIL: gcc.dg/tree-ssa/ctz-complement-long.c scan-tree-dump-times optimized
"__builtin_ctz|\\\\.CTZ" 1
FAIL: gcc.dg/tree-ssa/ctz-int.c scan-tree-dump-times optimized
"__builtin_ctz|\\\\.CTZ" 1
FAIL: gcc.dg/tree-ssa/ctz-long-long.c scan-tree-dump-times optimized
"__builtin_ctz|\\\\.CTZ" 1
FAIL: gcc.dg/tree-ssa/ctz-long.c scan-tree-dump-times optimized
"__builtin_ctz|\\\\.CTZ" 1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug testsuite/110490] tree-ssa/clz-* and tree-ssa/ctz-* fail on s390x with arch14
  2023-06-29 20:25 [Bug testsuite/110490] New: tree-ssa/clz-* and tree-ssa/ctz-* fail on s390x with arch14 mpolacek at gcc dot gnu.org
@ 2023-06-29 20:42 ` pinskia at gcc dot gnu.org
  2023-06-29 21:19 ` [Bug tree-optimization/110490] " pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-29 20:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110490

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu.org

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I suspect this is a testsuite issue:
>/* { dg-require-effective-target clzl } */

basically the check_effective_target_clz* (ctz*) test is passing for some
reason when it should not be ...

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/110490] tree-ssa/clz-* and tree-ssa/ctz-* fail on s390x with arch14
  2023-06-29 20:25 [Bug testsuite/110490] New: tree-ssa/clz-* and tree-ssa/ctz-* fail on s390x with arch14 mpolacek at gcc dot gnu.org
  2023-06-29 20:42 ` [Bug testsuite/110490] " pinskia at gcc dot gnu.org
@ 2023-06-29 21:19 ` pinskia at gcc dot gnu.org
  2023-06-29 21:48 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-29 21:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110490

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|testsuite                   |tree-optimization
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-06-29
           Keywords|                            |missed-optimization
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So the problem is a missing optimization.
In this case, arch14 (which enables TARGET_EXTIMM) only defines a clzdi2 and
not a clzsi2 so the code in build_cltz_expr does not realize that it could
still support clzsi2 ...

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/110490] tree-ssa/clz-* and tree-ssa/ctz-* fail on s390x with arch14
  2023-06-29 20:25 [Bug testsuite/110490] New: tree-ssa/clz-* and tree-ssa/ctz-* fail on s390x with arch14 mpolacek at gcc dot gnu.org
  2023-06-29 20:42 ` [Bug testsuite/110490] " pinskia at gcc dot gnu.org
  2023-06-29 21:19 ` [Bug tree-optimization/110490] " pinskia at gcc dot gnu.org
@ 2023-06-29 21:48 ` pinskia at gcc dot gnu.org
  2024-04-26 15:29 ` [Bug tree-optimization/110490] tree-ssa/clz-* and tree-ssa/ctz-* fail on s390x with arch14 (expression_expensive_p not handling if there is wider clz/ctz/popcount optab) stefansf at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-29 21:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110490

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I was wrong about where the problem was but not wrong about the missed
optimization.

Anyways the issue is in expression_expensive_p where the issue of clzdi2 and
not having clzsi2 ...

expression_expensive_p should check if you can do a widening of the mode ...

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/110490] tree-ssa/clz-* and tree-ssa/ctz-* fail on s390x with arch14 (expression_expensive_p not handling if there is wider clz/ctz/popcount optab)
  2023-06-29 20:25 [Bug testsuite/110490] New: tree-ssa/clz-* and tree-ssa/ctz-* fail on s390x with arch14 mpolacek at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-06-29 21:48 ` pinskia at gcc dot gnu.org
@ 2024-04-26 15:29 ` stefansf at gcc dot gnu.org
  2024-05-07 12:13 ` cvs-commit at gcc dot gnu.org
  2024-05-08  8:17 ` stefansf at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: stefansf at gcc dot gnu.org @ 2024-04-26 15:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110490

Stefan Schulze Frielinghaus <stefansf at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |stefansf at gcc dot gnu.org

--- Comment #4 from Stefan Schulze Frielinghaus <stefansf at gcc dot gnu.org> ---
https://gcc.gnu.org/pipermail/gcc-patches/2024-April/650001.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/110490] tree-ssa/clz-* and tree-ssa/ctz-* fail on s390x with arch14 (expression_expensive_p not handling if there is wider clz/ctz/popcount optab)
  2023-06-29 20:25 [Bug testsuite/110490] New: tree-ssa/clz-* and tree-ssa/ctz-* fail on s390x with arch14 mpolacek at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-04-26 15:29 ` [Bug tree-optimization/110490] tree-ssa/clz-* and tree-ssa/ctz-* fail on s390x with arch14 (expression_expensive_p not handling if there is wider clz/ctz/popcount optab) stefansf at gcc dot gnu.org
@ 2024-05-07 12:13 ` cvs-commit at gcc dot gnu.org
  2024-05-08  8:17 ` stefansf at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-07 12:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110490

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Stefan Schulze Frielinghaus
<stefansf@gcc.gnu.org>:

https://gcc.gnu.org/g:e1f56c67a82172730c377a96a46e8d75445e6a48

commit r15-274-ge1f56c67a82172730c377a96a46e8d75445e6a48
Author: Stefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Date:   Tue May 7 14:12:55 2024 +0200

    tree-optimization/110490 - bitcount for narrow modes

    Bitcount operations popcount, clz, and ctz are emulated for narrow modes
    in case an operation is only supported for wider modes.  Beside that ctz
    may be emulated via clz in expand_ctz.  Reflect this in
    expression_expensive_p.

    I considered the emulation of ctz via clz as not expensive since this
    basically reduces to ctz (x) = c - (clz (x & ~x)) where c is the mode
    precision minus 1 which should be faster than a loop.

    gcc/ChangeLog:

            PR tree-optimization/110490
            * tree-scalar-evolution.cc (expression_expensive_p): Also
            consider mode widening for popcount, clz, and ctz.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/110490] tree-ssa/clz-* and tree-ssa/ctz-* fail on s390x with arch14 (expression_expensive_p not handling if there is wider clz/ctz/popcount optab)
  2023-06-29 20:25 [Bug testsuite/110490] New: tree-ssa/clz-* and tree-ssa/ctz-* fail on s390x with arch14 mpolacek at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-05-07 12:13 ` cvs-commit at gcc dot gnu.org
@ 2024-05-08  8:17 ` stefansf at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: stefansf at gcc dot gnu.org @ 2024-05-08  8:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110490

Stefan Schulze Frielinghaus <stefansf at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #6 from Stefan Schulze Frielinghaus <stefansf at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-05-08  8:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-29 20:25 [Bug testsuite/110490] New: tree-ssa/clz-* and tree-ssa/ctz-* fail on s390x with arch14 mpolacek at gcc dot gnu.org
2023-06-29 20:42 ` [Bug testsuite/110490] " pinskia at gcc dot gnu.org
2023-06-29 21:19 ` [Bug tree-optimization/110490] " pinskia at gcc dot gnu.org
2023-06-29 21:48 ` pinskia at gcc dot gnu.org
2024-04-26 15:29 ` [Bug tree-optimization/110490] tree-ssa/clz-* and tree-ssa/ctz-* fail on s390x with arch14 (expression_expensive_p not handling if there is wider clz/ctz/popcount optab) stefansf at gcc dot gnu.org
2024-05-07 12:13 ` cvs-commit at gcc dot gnu.org
2024-05-08  8:17 ` stefansf at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).