public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/105211] ICE: SIGSEGV in contains_struct_check (tree.h:3570) with -Os -ffast-math and __builtin_roundf()
Date: Tue, 12 Apr 2022 07:18:46 +0000	[thread overview]
Message-ID: <bug-105211-4-TjE06RIWoc@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105211-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:91a38e8a848c61b2e23ee277306dc8cd194d135b

commit r12-8101-g91a38e8a848c61b2e23ee277306dc8cd194d135b
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Apr 12 09:16:06 2022 +0200

    builtins: Fix up expand_builtin_int_roundingfn_2 [PR105211]

    The expansion of __builtin_iround{,f,l} etc. builtins in some cases
    emits calls to a different fallback builtin.  To locate the right builtin
    it uses mathfn_built_in_1 with the type of the first argument.
    If its TYPE_MAIN_VARIANT is {float,double,long_double}_type_node, all is
    fine, but on the following testcase, because GIMPLE considers scalar
    float conversions between types with the same mode as useless,
    TYPE_MAIN_VARIANT of the arg's type is float32_type_node and because there
    isn't __builtin_lroundf32 returns NULL and we ICE.

    This patch will first try the type of the first argument of the builtin's
    prototype (so that say on sizeof(double)==sizeof(long double) target it
honors
    whether it was a *l or non-*l call; though even that can't be 100% trusted,
    user could incorrectly prototype it) and as fallback the type argument.
    If neither works, doesn't fallback.

    2022-04-11  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/105211
            * builtins.cc (expand_builtin_int_roundingfn_2): If
mathfn_built_in_1
            fails for TREE_TYPE (arg), retry it with
            TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (fndecl))) and if even that
            fails, emit call normally.

            * gcc.dg/pr105211.c: New test.

  parent reply	other threads:[~2022-04-12  7:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-10 20:17 [Bug rtl-optimization/105211] New: " zsojka at seznam dot cz
2022-04-10 20:46 ` [Bug rtl-optimization/105211] " jakub at gcc dot gnu.org
2022-04-11 10:02 ` jakub at gcc dot gnu.org
2022-04-12  7:18 ` cvs-commit at gcc dot gnu.org [this message]
2022-04-12  7:21 ` jakub at gcc dot gnu.org
2022-04-13  4:28 ` cvs-commit at gcc dot gnu.org
2022-05-10  8:26 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:26 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:36 ` 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-105211-4-TjE06RIWoc@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).