public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/105312] [12 Regression] ICE in gimple_expand_vec_cond_expr on arm-linux since r12-834-ga6eacbf1055520
Date: Wed, 20 Apr 2022 07:44:31 +0000	[thread overview]
Message-ID: <bug-105312-4-q5B7iAtAFy@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105312-4@http.gcc.gnu.org/bugzilla/>

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

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

_37 = vect_vec_iv_.13_32 == { 0, 0, 0, 0 };
vect_iftmp.14_38 = VEC_COND_EXPR <_37, { 1.0e+0, 1.0e+0, 1.0e+0, 1.0e+0 }, {
0.0, 0.0, 0.0, 0.0 }>;

(gdb) p debug_tree (op0)
 <ssa_name 0x7ffff642d708
    type <vector_type 0x7ffff6431888
        type <boolean_type 0x7ffff64317e0 public SI
            size <integer_cst 0x7ffff6528018 constant 32>
            unit-size <integer_cst 0x7ffff6528030 constant 4>
            align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff64317e0 precision:32 min <integer_cst 0x7ffff64326a8 -2147483648> max
<integer_cst 0x7ffff6432738 2147483647>>
        V4SI
        size <integer_cst 0x7ffff6528378 constant 128>
        unit-size <integer_cst 0x7ffff6528390 constant 16>
        align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff6431888 nunits:4>
    visited
    def_stmt _37 = vect_vec_iv_.13_32 == { 0, 0, 0, 0 };
    version:37>

we can't do VCONDEQ, we _can_ compute op0 but do not have vcond_mask which
we assume here.  So this is a mismatch between ISEL and vector lowering
or alternatively a failure to - for non-mask vectors - provide a fallback
via masking.

For vcond_mask I see there is v2sfv2si but no v4sfv4si, so not sure whether
this can be tackled on the backend side.

Note for a masking fallback we'd have to ensure support for integer mode
bitwise ops as well as view-converting V4SF to and from V4SI.  There is

  /* Lower mask typed, non-vector mode VEC_COND_EXPRs to bitwise operations.
     Those can end up generated by folding and at least for integer mode masks
     we cannot expect vcond expanders to exist.  We lower a ? b : c
     to (b & a) | (c & ~a).  */
  if (VECTOR_BOOLEAN_TYPE_P (TREE_TYPE (lhs))
      && !VECTOR_MODE_P (mode))
    {
      gcc_assert (types_compatible_p (TREE_TYPE (op0), TREE_TYPE (op1)));
      gimple_seq stmts = NULL;
      tree type = TREE_TYPE (lhs);
      location_t loc = gimple_location (stmt);
      tree tem0 = gimple_build (&stmts, loc, BIT_AND_EXPR, type, op1, op0);
      tree tem1 = gimple_build (&stmts, loc, BIT_NOT_EXPR, type, op0);
      tree tem2 = gimple_build (&stmts, loc, BIT_AND_EXPR, type, op2, tem1);
      tree tem3 = gimple_build (&stmts, loc, BIT_IOR_EXPR, type, tem0, tem2);
      gsi_insert_seq_before (gsi, stmts, GSI_SAME_STMT);
      return gimple_build_assign (lhs, tem3);
    }

but as said the immediate failure is that veclower thinks we can handle

  _37 = vect_vec_iv_.13_32 == { 0, 0, 0, 0 };
  vect_iftmp.14_38 = VEC_COND_EXPR <_37, { 1.0e+0, 1.0e+0, 1.0e+0, 1.0e+0 }, {
0.0, 0.0, 0.0, 0.0 }>;

but ISEL thinks we cannot.  I will look into that.

  parent reply	other threads:[~2022-04-20  7:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 17:34 [Bug middle-end/105312] New: attribute__((optimize("-O3"))) stress_matrix_xy_identity compiling stress-ng for arm raj.khem at gmail dot com
2022-04-20  3:31 ` [Bug tree-optimization/105312] [12 Regression] ICE in gimple_expand_vec_cond_expr on arm-linux pinskia at gcc dot gnu.org
2022-04-20  7:37 ` [Bug tree-optimization/105312] [12 Regression] ICE in gimple_expand_vec_cond_expr on arm-linux since r12-834-ga6eacbf1055520 marxin at gcc dot gnu.org
2022-04-20  7:44 ` rguenth at gcc dot gnu.org [this message]
2022-04-20  7:44 ` rguenth at gcc dot gnu.org
2022-04-20  8:14 ` rguenth at gcc dot gnu.org
2022-04-20  8:21 ` [Bug tree-optimization/105312] [11/12 " rguenth at gcc dot gnu.org
2022-04-20  8:44 ` clyon at gcc dot gnu.org
2022-04-20 11:27 ` cvs-commit at gcc dot gnu.org
2022-04-20 11:28 ` [Bug tree-optimization/105312] [11 " rguenth at gcc dot gnu.org
2022-04-20 15:28 ` raj.khem at gmail dot com
2022-04-21  7:51 ` rguenth at gcc dot gnu.org
2022-05-12 11:34 ` rguenth at gcc dot gnu.org
2022-05-19 14:03 ` cvs-commit at gcc dot gnu.org
2022-05-19 14:06 ` rguenth at gcc dot gnu.org
2022-05-20  3:50 ` sam at gentoo dot org
2022-10-20 19:55 ` pinskia at gcc dot gnu.org
2023-04-25  6:21 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-105312-4-q5B7iAtAFy@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).