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 c++/100281] ICE with SImode pointer assignment in C++
Date: Tue, 18 May 2021 06:45:48 +0000	[thread overview]
Message-ID: <bug-100281-4-DLGtLxeGre@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100281-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andreas Krebbel <krebbel@gcc.gnu.org>:

https://gcc.gnu.org/g:720dff974ea0487c35c0a4bfa527f30df5066ce1

commit r12-857-g720dff974ea0487c35c0a4bfa527f30df5066ce1
Author: Andreas Krebbel <krebbel@linux.ibm.com>
Date:   Tue Apr 27 10:09:06 2021 +0200

    PR100281 C++: Fix SImode pointer handling

    The problem appears to be triggered by two locations in the front-end
    where non-POINTER_SIZE pointers aren't handled right now.

    1. An assertion in strip_typedefs is triggered because the alignment
    of the types don't match. This in turn is caused by creating the new
    type with build_pointer_type instead of taking the type of the
    original pointer into account.

    2. An assertion in cp_convert_to_pointer is triggered which expects
    the target type to always have POINTER_SIZE.

    gcc/cp/ChangeLog:

            PR c++/100281
            * cvt.c (cp_convert_to_pointer): Use the size of the target
            pointer type.
            * tree.c (cp_build_reference_type): Call
            cp_build_reference_type_for_mode with VOIDmode.
            (cp_build_reference_type_for_mode): Rename from
            cp_build_reference_type.  Add MODE argument and invoke
            build_reference_type_for_mode.
            (strip_typedefs): Use build_pointer_type_for_mode and
            cp_build_reference_type_for_mode for pointers and references.

    gcc/ChangeLog:

            PR c++/100281
            * tree.c (build_reference_type_for_mode)
            (build_pointer_type_for_mode): Pick pointer mode if MODE argument
            is VOIDmode.
            (build_reference_type, build_pointer_type): Invoke
            build_*_type_for_mode with VOIDmode.

    gcc/testsuite/ChangeLog:

            PR c++/100281
            * g++.target/s390/pr100281-1.C: New test.
            * g++.target/s390/pr100281-2.C: New test.

  parent reply	other threads:[~2021-05-18  6:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27  8:20 [Bug c++/100281] New: " krebbel at gcc dot gnu.org
2021-04-27  9:42 ` [Bug c++/100281] " rguenth at gcc dot gnu.org
2021-04-27  9:42 ` rguenth at gcc dot gnu.org
2021-04-27  9:51 ` krebbel at gcc dot gnu.org
2021-04-27  9:56 ` rguenth at gcc dot gnu.org
2021-04-27 15:07 ` krebbel at gcc dot gnu.org
2021-05-18  6:45 ` cvs-commit at gcc dot gnu.org [this message]
2021-05-20 15:26 ` cvs-commit at gcc dot gnu.org
2021-08-12 23:13 ` 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-100281-4-DLGtLxeGre@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).