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/97405] ICE in get_or_alloc_expr_for in code hoisting with SVE intrinsics
Date: Wed, 14 Oct 2020 14:18:32 +0000	[thread overview]
Message-ID: <bug-97405-4-RVZyntxdB2@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-97405-4@http.gcc.gnu.org/bugzilla/>

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

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

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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to rsandifo@gcc.gnu.org from comment #3)
> (In reply to Richard Biener from comment #2)
> > OK, looks like the code expects
> > 
> > POLY_INT_CST [16, 16] /[ex] 16
> > 
> > to be constant folded - looks like poly_int_binop doesn't handle division
> > nor is there a wi::div_trunc for poly_wide_int.
> > 
> > This is generated here:
> > 
> > Breakpoint 5, copy_reference_ops_from_ref (ref=<array_ref 0x7ffff642fa10>, 
> > 891                 /* But record element size in units of the type
> > alignment.  */
> > 892                 temp.op2 = TREE_OPERAND (ref, 3);
> > 893                 temp.align = eltype->type_common.align;
> > 894                 if (! temp.op2)
> > 895                   temp.op2 = size_binop (EXACT_DIV_EXPR, TYPE_SIZE_UNIT
> > (eltype),
> > 896                                          size_int (TYPE_ALIGN_UNIT
> > (eltype)));
> > 
> > Hmm, I see that temp.op2 is indeed always needed unless we want to disrupt
> > valueization.  copy_reference_ops_from_ref also isn't really allowed to fail.
> > 
> > So we absolutely need to be able to fold this EXACT/TRUNC_DIV_EXPR.
> > 
> > Richard?
> Yeah, EXACT_DIV_EXPR can't in general be folded at compile time
> because it wraps differently.  We could perhaps fold it if
> TYPE_OVERFLOW_UNDEFINED is true, but by the letter of the law,
> we should issue a warning when doing that.
> 
> I guess we want something similar to bd8a2482569900a114d631f9c38353d3a96a1d85
> (And it would be nice if we didn't have too many copies of this code. ;-))

Ugh.  Maybe revisit, for the Nth time, the scaling by the alignment unit of
the COMPONENT_REF/ARRAY_REF sizes ... RTL expansion needs to recover
alignment guarantees for those in case of variable accesses on strict
alignment targets and the MULT_EXPRs we get from array_ref_element_size
and friends help the various helpers derive an alignment.  The last attempt
isn't that old but Eric shot it down in the end.

  parent reply	other threads:[~2020-10-14 14:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-13 17:11 [Bug tree-optimization/97405] New: " ktkachov at gcc dot gnu.org
2020-10-13 17:11 ` [Bug tree-optimization/97405] " ktkachov at gcc dot gnu.org
2020-10-14  6:25 ` rguenth at gcc dot gnu.org
2020-10-14  6:54 ` rguenth at gcc dot gnu.org
2020-10-14  7:19 ` rsandifo at gcc dot gnu.org
2020-10-14 14:18 ` rguenth at gcc dot gnu.org [this message]
2020-10-14 14:21 ` rguenth at gcc dot gnu.org
2022-01-09  0:39 ` pinskia at gcc dot gnu.org
2024-06-16  0:01 ` pinskia at gcc dot gnu.org
2024-06-17 23:40 ` pinskia at gcc dot gnu.org
2024-06-17 23:50 ` cvs-commit at gcc dot gnu.org
2024-06-17 23:50 ` pinskia 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-97405-4-RVZyntxdB2@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).