public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "wilson at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/94044] [10 Regression] internal compiler error: in comptypes, at cp/typeck.c:1490 on riscv64-unknown-linux-gnu and arm-eabi
Date: Sat, 14 Mar 2020 03:53:37 +0000	[thread overview]
Message-ID: <bug-94044-4-RPnJGC75OT@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94044-4@http.gcc.gnu.org/bugzilla/>

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

Jim Wilson <wilson at gcc dot gnu.org> changed:

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

--- Comment #7 from Jim Wilson <wilson at gcc dot gnu.org> ---
I made an attempt to reproduce this.  I wasn't able to reproduce with an
arm-eabi build.  I was able to reproduce with a riscv64-linux build.  The funny
part is that I was able to build two compilers from the same gcc sources, one
which reproduces and one which does not, which differ only in exactly how I did
the build.  For the failing build, I had a complete riscv-gnu-toolchain build
available when configuring.  For the working build it was just binutils and gcc
without glibc/linux header files, and a top-of-tree binutils version unlike the
first build.

Debugging the two side by side, I see that execution diverges at line 9680 in
cp/pt.c
      entry = type_specializations->find_with_hash (&elt, hash);
The working compiler has no hash hit and returns zero.  The failing compiler
has a hash hit, and then dies inside spec_hasher::equal.

In the spec_hasher::equal function I see

(gdb) print *e1
$29 = {tmpl = <template_decl 0x7ffff5edc300 size>,
  args = <tree_vec 0x7ffff5ec7be0>, spec = <record_type 0x7ffff5ef45e8 size>}
(gdb) print *e2
$30 = {tmpl = <template_decl 0x7ffff5edc300 size>,
  args = <tree_vec 0x7ffff5efb080>, spec = <tree 0x0>}

(gdb) pt
 <tree_vec 0x7ffff5ec7be0 length:1
    elt:0 <sizeof_expr 0x7ffff5ec7ba0
        type <integer_type 0x7ffff5deb7e0 long unsigned int public unsigned
type_6 DI
            size <integer_cst 0x7ffff5dd6ae0 constant 64>
            unit-size <integer_cst 0x7ffff5dd6af8 constant 8>
            align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff5deb7e0 precision:64 min <integer_cst 0x7ffff5dd6db0 0> max <integer_cst
0x7ffff5dd7620 18446744073709551615>
            pointer_to_this <pointer_type 0x7ffff5df8f18>>
        readonly
        arg:0 <type_argument_pack 0x7ffff5ef4540
            type <tree_vec 0x7ffff5ef3668 length:2 elt:0 <template_type_parm
0x7ffff5ef4000 T> elt:1 <type_pack_expansion 0x7ffff5ef4150>>
            type_0 type_6 VOID
            align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff5ef4540>
        tmp.C:13:23 start: tmp.C:13:23 finish: tmp.C:13:35>>
(gdb) print e2->args
$32 = <tree_vec 0x7ffff5efb080>
(gdb) pt
 <tree_vec 0x7ffff5efb080 length:1
    elt:0 <sizeof_expr 0x7ffff5efb040
        type <integer_type 0x7ffff5deb7e0 long unsigned int public unsigned
type_6 DI
            size <integer_cst 0x7ffff5dd6ae0 constant 64>
            unit-size <integer_cst 0x7ffff5dd6af8 constant 8>
            align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff5deb7e0 precision:64 min <integer_cst 0x7ffff5dd6db0 0> max <integer_cst
0x7ffff5dd7620 18446744073709551615>
            pointer_to_this <pointer_type 0x7ffff5df8f18>>
        readonly
        arg:0 <type_argument_pack 0x7ffff5efa2a0
            type <tree_vec 0x7ffff5ef9258 length:2 elt:0 <type_pack_expansion
0x7ffff5ef6dc8> elt:1 <template_type_parm 0x7ffff5ef6f18 T>>
            type_0 type_6 VOID
            align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff5efa2a0>
        tmp.C:13:23 start: tmp.C:13:23 finish: tmp.C:13:35>>
(gdb) 

It then eventually dies inside comptypes because TREE_CODE (t1) is
type_pack_expansion.  And also TREE_CODE (t2) is type_pack_expansion.  This is
called from the SIZEOF_EXPR case in cp_tree_equal.

If tree addresses are being used for the hash codes, this could just be bad
luck whether it fails or not.

  parent reply	other threads:[~2020-03-14  3:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-94044-4@http.gcc.gnu.org/bugzilla/>
2020-03-12  9:35 ` kito.cheng at gmail dot com
2020-03-12 11:14 ` nathan at gcc dot gnu.org
2020-03-13 13:33 ` nathan at gcc dot gnu.org
2020-03-13 16:12 ` kito.cheng at gmail dot com
2020-03-13 19:31 ` nathan at gcc dot gnu.org
2020-03-14  3:53 ` wilson at gcc dot gnu.org [this message]
2020-03-14 10:32 ` jakub at gcc dot gnu.org
2020-03-14 16:57 ` wilson at gcc dot gnu.org
2020-03-16 11:55 ` nathan at gcc dot gnu.org
2020-03-20 11:44 ` rguenth at gcc dot gnu.org
2020-03-23 10:41 ` cvs-commit at gcc dot gnu.org
2020-03-23 10:41 ` nathan 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-94044-4-RPnJGC75OT@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).