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 middle-end/113988] during GIMPLE pass: bitintlower: internal compiler error: in lower_stmt, at gimple-lower-bitint.cc:5470
Date: Thu, 22 Feb 2024 07:47:23 +0000	[thread overview]
Message-ID: <bug-113988-4-9m7ud22YX1@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113988-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #19 from rguenther at suse dot de <rguenther at suse dot de> ---
On Wed, 21 Feb 2024, jakub at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113988
> 
> --- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> So, either we could somehow handle that case during expansion (treat it
> basically as VCE), or tweak the
> /* For integral conversions with the same precision or pointer
>    conversions use a NOP_EXPR instead.  */
> (simplify
>   (view_convert @0)
>   (if ((INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type))
>        && (INTEGRAL_TYPE_P (TREE_TYPE (@0)) || POINTER_TYPE_P (TREE_TYPE (@0)))
>        && TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (@0)))
>    (convert @0)))
> match.pd rule not to do that for INTEGER_TYPEs with PRECISION >
> MAX_FIXED_TYPE_PRECISION (then we don't need the gimple-lower-bitint.cc changes
> either).
> --- gcc/match.pd.jj     2024-02-19 09:42:16.583617451 +0100
> +++ gcc/match.pd        2024-02-21 13:32:06.567816298 +0100
> @@ -4679,7 +4679,13 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
>    (view_convert @0)
>    (if ((INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type))
>         && (INTEGRAL_TYPE_P (TREE_TYPE (@0)) || POINTER_TYPE_P (TREE_TYPE
> (@0)))
> -       && TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (@0)))
> +       && TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (@0))
> +       /* Punt for conversions from or to barely supported huge
> +         INTEGER_TYPEs.  Those can handle just loads/stores/moves but
> +         nothing else.  */
> +       && (TYPE_PRECISION (type) <= MAX_FIXED_MODE_SIZE
> +          || (TREE_CODE (type) != INTEGER_TYPE
> +              && TREE_CODE (TREE_TYPE (@0)) != INTEGER_TYPE)))
>     (convert @0)))
> 
>  /* Strip inner integral conversions that do not change precision or size, or

I think the usual BLKmode check would be better here?  Apart from
that this looks correct, we shouldn't use a regular convert on
a non-register type.  In fact, it looks like all bitint types are
register types because we want SSA names for them.  A bit of a
"bad" design ...

We've used BLKmode checks elsewhere so I think it would be appropriate
here, too.

  parent reply	other threads:[~2024-02-22  7:47 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19  9:51 [Bug c++/113988] New: " janschultke at googlemail dot com
2024-02-19 10:00 ` [Bug middle-end/113988] " pinskia at gcc dot gnu.org
2024-02-19 10:01 ` janschultke at googlemail dot com
2024-02-19 10:05 ` jakub at gcc dot gnu.org
2024-02-19 14:22 ` rguenth at gcc dot gnu.org
2024-02-19 14:30 ` rguenth at gcc dot gnu.org
2024-02-19 14:34 ` rguenth at gcc dot gnu.org
2024-02-19 14:34 ` jakub at gcc dot gnu.org
2024-02-19 14:37 ` rguenth at gcc dot gnu.org
2024-02-19 14:39 ` rguenth at gcc dot gnu.org
2024-02-19 14:40 ` jakub at gcc dot gnu.org
2024-02-19 14:42 ` jakub at gcc dot gnu.org
2024-02-19 14:44 ` rguenther at suse dot de
2024-02-19 15:35 ` hjl.tools at gmail dot com
2024-02-19 18:57 ` jakub at gcc dot gnu.org
2024-02-20  7:32 ` rguenth at gcc dot gnu.org
2024-02-20  9:12 ` rsandifo at gcc dot gnu.org
2024-02-21 12:40 ` jakub at gcc dot gnu.org
2024-02-21 12:50 ` jakub at gcc dot gnu.org
2024-02-22  7:47 ` rguenther at suse dot de [this message]
2024-02-22  8:10 ` jakub at gcc dot gnu.org
2024-02-22  8:34 ` rguenther at suse dot de
2024-02-22  8:37 ` jakub at gcc dot gnu.org
2024-02-22  8:52 ` rguenther at suse dot de
2024-02-23 10:06 ` jakub at gcc dot gnu.org
2024-02-24 11:46 ` jakub at gcc dot gnu.org
2024-02-25 18:37 ` zsojka at seznam dot cz
2024-02-26 21:41 ` zsojka at seznam dot cz
2024-02-27 11:53 ` jakub at gcc dot gnu.org
2024-02-28  8:55 ` cvs-commit at gcc dot gnu.org
2024-02-28  9:01 ` jakub 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-113988-4-9m7ud22YX1@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).