public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/96466] [11 Regression] ICE: in gimple_expand_vec_cond_expr, at gimple-isel.cc:122 with -Og -finline-functions-called-once -fno-tree-ccp
Date: Fri, 28 Aug 2020 08:09:17 +0000	[thread overview]
Message-ID: <bug-96466-4-XSJrXOPVfh@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-96466-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 from rguenther at suse dot de <rguenther at suse dot de> ---
On Fri, 28 Aug 2020, marxin at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96466
> 
> --- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
> Looking at the ICE, we actually ICE at the place where a fake comparison is
> constructed:
> 
>   if (TREE_CODE_CLASS (tcode) != tcc_comparison)
>     {
>       gcc_assert (VECTOR_BOOLEAN_TYPE_P (TREE_TYPE (op0)));
>       if (get_vcond_mask_icode (mode, TYPE_MODE (TREE_TYPE (op0)))
>           != CODE_FOR_nothing)
>         return gimple_build_call_internal (IFN_VCOND_MASK, 3, op0, op1, op2);
>       /* Fake op0 < 0.  */
>       else
>         {
>           gcc_assert (GET_MODE_CLASS (TYPE_MODE (TREE_TYPE (op0)))
>                       == MODE_VECTOR_INT);
>           op0a = op0;
>           op0b = build_zero_cst (TREE_TYPE (op0));
>           tcode = LT_EXPR;
>         }
>     }
> 
> So we have:
> 
> (gdb) p debug_tree(op0a)
>  <ssa_name 0x7ffff74815e8
>     type <vector_type 0x7ffff743b1f8
>         type <boolean_type 0x7ffff743bf18 public DI
>             size <integer_cst 0x7ffff75d4d98 constant 64>
>             unit-size <integer_cst 0x7ffff75d4db0 constant 8>
>             align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
> 0x7ffff743bf18 precision:64 min <integer_cst 0x7ffff73da090
> -9223372036854775808> max <integer_cst 0x7ffff7448d20 9223372036854775807>>
>         BLK size <integer_cst 0x7ffff75d4d98 64> unit-size <integer_cst
> 0x7ffff75d4db0 8>
>         align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
> 0x7ffff743b1f8 nunits:1>
>     visited
>     def_stmt _4 = { 0 };
>     version:4>
> $4 = void
> (gdb) p debug_tree(op0b)
>  <vector_cst 0x7ffff74892a0
>     type <vector_type 0x7ffff743b1f8
>         type <boolean_type 0x7ffff743bf18 public DI
>             size <integer_cst 0x7ffff75d4d98 constant 64>
>             unit-size <integer_cst 0x7ffff75d4db0 constant 8>
>             align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
> 0x7ffff743bf18 precision:64 min <integer_cst 0x7ffff73da090
> -9223372036854775808> max <integer_cst 0x7ffff7448d20 9223372036854775807>>
>         BLK size <integer_cst 0x7ffff75d4d98 64> unit-size <integer_cst
> 0x7ffff75d4db0 8>
>         align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
> 0x7ffff743b1f8 nunits:1>
>     constant npatterns:1 nelts-per-pattern:1
>     elt:0:  <integer_cst 0x7ffff7489258 type <boolean_type 0x7ffff743bf18>
> constant 0>>
> $5 = void
> (gdb) p tcode
> $7 = LT_EXPR
> 
> but the modes do not match:
> 
> (gdb) p mode
> $1 = E_DImode
> (gdb) p cmp_op_mode
> $2 = E_BLKmode
> 
> and so we ICE here:
> 
>   gcc_assert (known_eq (GET_MODE_SIZE (mode), GET_MODE_SIZE (cmp_op_mode))
>               && known_eq (GET_MODE_NUNITS (mode),
>                            GET_MODE_NUNITS (cmp_op_mode)));
> 
> So what to do about it?

As said you have to fake "regular" non-bool comparison operands,
best based on the COND_EXPRs operand types (using integer types
of the same size)

  parent reply	other threads:[~2020-08-28  8:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-04 16:29 [Bug tree-optimization/96466] New: 11 " zsojka at seznam dot cz
2020-08-05  7:29 ` [Bug tree-optimization/96466] [11 " rguenth at gcc dot gnu.org
2020-08-10  4:15 ` marxin at gcc dot gnu.org
2020-08-10 10:39 ` marxin at gcc dot gnu.org
2020-08-10 11:46 ` marxin at gcc dot gnu.org
2020-08-26 14:19 ` rguenth at gcc dot gnu.org
2020-08-28  7:37 ` marxin at gcc dot gnu.org
2020-08-28  8:09 ` rguenther at suse dot de [this message]
2020-08-28  8:15 ` marxin at gcc dot gnu.org
2020-08-28 10:12 ` rguenther at suse dot de
2020-09-23 12:20 ` rguenth at gcc dot gnu.org
2020-09-23 13:11 ` cvs-commit at gcc dot gnu.org
2020-09-23 13:11 ` rguenth 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-96466-4-XSJrXOPVfh@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).