public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/113126] New: [14 Regression] ICE: in gimple_expand_vec_cond_expr, at gimple-isel.cc:325 at -O1
@ 2023-12-24  8:27 zsojka at seznam dot cz
  2023-12-24  8:29 ` [Bug tree-optimization/113126] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: zsojka at seznam dot cz @ 2023-12-24  8:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113126
           Summary: [14 Regression] ICE: in gimple_expand_vec_cond_expr,
                    at gimple-isel.cc:325 at -O1
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

Created attachment 56929
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56929&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O1 testcase.c
during GIMPLE pass: isel
testcase.c: In function 'foo':
testcase.c:8:1: internal compiler error: in gimple_expand_vec_cond_expr, at
gimple-isel.cc:325
    8 | foo (void)
      | ^~~
0x885994 gimple_expand_vec_cond_expr
        /repo/gcc-trunk/gcc/gimple-isel.cc:325
0x885994 execute
        /repo/gcc-trunk/gcc/gimple-isel.cc:389
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-6818-20231224094952-gbd901d76734-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-6818-20231224094952-gbd901d76734-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20231224 (experimental) (GCC)

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

* [Bug tree-optimization/113126] [14 Regression] ICE: in gimple_expand_vec_cond_expr, at gimple-isel.cc:325 at -O1
  2023-12-24  8:27 [Bug tree-optimization/113126] New: [14 Regression] ICE: in gimple_expand_vec_cond_expr, at gimple-isel.cc:325 at -O1 zsojka at seznam dot cz
@ 2023-12-24  8:29 ` pinskia at gcc dot gnu.org
  2023-12-24  8:39 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-12-24  8:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug tree-optimization/113126] [14 Regression] ICE: in gimple_expand_vec_cond_expr, at gimple-isel.cc:325 at -O1
  2023-12-24  8:27 [Bug tree-optimization/113126] New: [14 Regression] ICE: in gimple_expand_vec_cond_expr, at gimple-isel.cc:325 at -O1 zsojka at seznam dot cz
  2023-12-24  8:29 ` [Bug tree-optimization/113126] " pinskia at gcc dot gnu.org
@ 2023-12-24  8:39 ` pinskia at gcc dot gnu.org
  2024-01-08 14:00 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-12-24  8:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-12-24
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
13:

  h_6 = (G) f.0_1;
  _2 = h_6 <= h_6;
  _3 = VEC_COND_EXPR <_2, { -1, -1 }, { 0, 0 }>;
  _4 = VIEW_CONVERT_EXPR<G>(_3);


14:

  _2 = f.0_1 <= f.0_1;
  _3 = VEC_COND_EXPR <_2, { -1, -1 }, { 0, 0 }>;
  _4 = VIEW_CONVERT_EXPR<G>(_3);

Funny it was introduced accident by r14-2040-g6b32400e19a702 which is there to
fix a TYPE_PRECISION issue.

The result of `vector(2) float` is `vector(2) <signed-boolean:32>` but match
messes up here ...

Which means the patterns here are only valid for scalar conversions and not
vector based conversions or they need to add an conversion between the
resulting `vector boolean` types ...

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

* [Bug tree-optimization/113126] [14 Regression] ICE: in gimple_expand_vec_cond_expr, at gimple-isel.cc:325 at -O1
  2023-12-24  8:27 [Bug tree-optimization/113126] New: [14 Regression] ICE: in gimple_expand_vec_cond_expr, at gimple-isel.cc:325 at -O1 zsojka at seznam dot cz
  2023-12-24  8:29 ` [Bug tree-optimization/113126] " pinskia at gcc dot gnu.org
  2023-12-24  8:39 ` pinskia at gcc dot gnu.org
@ 2024-01-08 14:00 ` rguenth at gcc dot gnu.org
  2024-01-11 11:07 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-01-08 14:00 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
             Status|NEW                         |ASSIGNED
           Priority|P3                          |P1

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Mine.

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

* [Bug tree-optimization/113126] [14 Regression] ICE: in gimple_expand_vec_cond_expr, at gimple-isel.cc:325 at -O1
  2023-12-24  8:27 [Bug tree-optimization/113126] New: [14 Regression] ICE: in gimple_expand_vec_cond_expr, at gimple-isel.cc:325 at -O1 zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2024-01-08 14:00 ` rguenth at gcc dot gnu.org
@ 2024-01-11 11:07 ` rguenth at gcc dot gnu.org
  2024-01-11 14:13 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-01-11 11:07 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |crazylht at gmail dot com

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
diff --git a/gcc/match.pd b/gcc/match.pd
index 876a9d1c06e..abbd03742f9 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -6792,11 +6792,12 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
               && exact_real_truncate (TYPE_MODE (double_type_node), &orig))
             type1 = double_type_node;
         }
-      tree newtype
-        = (element_precision (TREE_TYPE (@00)) > element_precision (type1)
-          ? TREE_TYPE (@00) : type1);
+       tree newtype
+        = (element_precision (TREE_TYPE (@00)) > element_precision (type1)
+           ? TREE_TYPE (@00) : type1);
      }
-     (if (element_precision (TREE_TYPE (@0)) > element_precision (newtype))
+     (if (element_precision (TREE_TYPE (@0)) > element_precision (newtype)
+         && is_truth_type_for (newtype, type))
       (cmp (convert:newtype @00) (convert:newtype @10))))))))


as I thought with AVX512VL we can handle this, but for V2SFmode we get
V2SImode as mask_mode.  And changing the test to V4SF/V4DFmode reveals
that we don't use float-extend (I'd have to trace vector lowering and
forwprop).  There might be an opportunity to improve what we do
for convertvector.

But it fixes the testcase.

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

* [Bug tree-optimization/113126] [14 Regression] ICE: in gimple_expand_vec_cond_expr, at gimple-isel.cc:325 at -O1
  2023-12-24  8:27 [Bug tree-optimization/113126] New: [14 Regression] ICE: in gimple_expand_vec_cond_expr, at gimple-isel.cc:325 at -O1 zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2024-01-11 11:07 ` rguenth at gcc dot gnu.org
@ 2024-01-11 14:13 ` cvs-commit at gcc dot gnu.org
  2024-01-11 14:14 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-11 14:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:897b95a12b7fe549ec2cb8ef3a3f0e4fbabf9737

commit r14-7139-g897b95a12b7fe549ec2cb8ef3a3f0e4fbabf9737
Author: Richard Biener <rguenther@suse.de>
Date:   Thu Jan 11 12:02:43 2024 +0100

    tree-optimization/113126 - vector extension compare optimization

    The following makes sure the resulting boolean type is the same
    when eliding a float extension.

            PR tree-optimization/113126
            * match.pd ((double)float CMP (double)float -> float CMP float):
            Make sure the boolean type is the same.
            * fold-const.cc (fold_binary_loc): Likewise.

            * gcc.dg/torture/pr113126.c: New testcase.

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

* [Bug tree-optimization/113126] [14 Regression] ICE: in gimple_expand_vec_cond_expr, at gimple-isel.cc:325 at -O1
  2023-12-24  8:27 [Bug tree-optimization/113126] New: [14 Regression] ICE: in gimple_expand_vec_cond_expr, at gimple-isel.cc:325 at -O1 zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2024-01-11 14:13 ` cvs-commit at gcc dot gnu.org
@ 2024-01-11 14:14 ` rguenth at gcc dot gnu.org
  2024-01-12  7:21 ` liuhongt at gcc dot gnu.org
  2024-01-12  8:54 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-01-11 14:14 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

* [Bug tree-optimization/113126] [14 Regression] ICE: in gimple_expand_vec_cond_expr, at gimple-isel.cc:325 at -O1
  2023-12-24  8:27 [Bug tree-optimization/113126] New: [14 Regression] ICE: in gimple_expand_vec_cond_expr, at gimple-isel.cc:325 at -O1 zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2024-01-11 14:14 ` rguenth at gcc dot gnu.org
@ 2024-01-12  7:21 ` liuhongt at gcc dot gnu.org
  2024-01-12  8:54 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: liuhongt at gcc dot gnu.org @ 2024-01-12  7:21 UTC (permalink / raw)
  To: gcc-bugs

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

Hongtao Liu <liuhongt at gcc dot gnu.org> changed:

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

--- Comment #6 from Hongtao Liu <liuhongt at gcc dot gnu.org> ---

> as I thought with AVX512VL we can handle this, but for V2SFmode we get
> V2SImode as mask_mode.  And changing the test to V4SF/V4DFmode reveals
> that we don't use float-extend (I'd have to trace vector lowering and
> forwprop).  There might be an opportunity to improve what we do
> for convertvector.
Yes, it's https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107432

> 
> But it fixes the testcase.

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

* [Bug tree-optimization/113126] [14 Regression] ICE: in gimple_expand_vec_cond_expr, at gimple-isel.cc:325 at -O1
  2023-12-24  8:27 [Bug tree-optimization/113126] New: [14 Regression] ICE: in gimple_expand_vec_cond_expr, at gimple-isel.cc:325 at -O1 zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2024-01-12  7:21 ` liuhongt at gcc dot gnu.org
@ 2024-01-12  8:54 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-01-12  8:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113126
Bug 113126 depends on bug 113344, which changed state.

Bug 113344 Summary: [14 regression] gcc.dg/pr15784-1.c fails after r14-7139-g897b95a12b7fe5
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113344

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

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

end of thread, other threads:[~2024-01-12  8:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-24  8:27 [Bug tree-optimization/113126] New: [14 Regression] ICE: in gimple_expand_vec_cond_expr, at gimple-isel.cc:325 at -O1 zsojka at seznam dot cz
2023-12-24  8:29 ` [Bug tree-optimization/113126] " pinskia at gcc dot gnu.org
2023-12-24  8:39 ` pinskia at gcc dot gnu.org
2024-01-08 14:00 ` rguenth at gcc dot gnu.org
2024-01-11 11:07 ` rguenth at gcc dot gnu.org
2024-01-11 14:13 ` cvs-commit at gcc dot gnu.org
2024-01-11 14:14 ` rguenth at gcc dot gnu.org
2024-01-12  7:21 ` liuhongt at gcc dot gnu.org
2024-01-12  8:54 ` rguenth 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).