From patchwork Fri Mar 20 15:41:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 1259036 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=CnWJrTGm; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48kSgb1Lghz9sRf for ; Sat, 21 Mar 2020 02:41:47 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B85453937419; Fri, 20 Mar 2020 15:41:44 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by sourceware.org (Postfix) with ESMTPS id 6BA52385F024 for ; Fri, 20 Mar 2020 15:41:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6BA52385F024 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nathanmsidwell@gmail.com Received: by mail-qt1-x832.google.com with SMTP id z8so5222162qto.12 for ; Fri, 20 Mar 2020 08:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=ioMEiHwGnbwN9pDM05775B4XdJijWuQ9EbkbnZJpXl8=; b=CnWJrTGmd7Owv10t1j6prlji4eAfDXA+SAKGBG/6I93uwlLA254IeXZe5KeheHiYZ+ 1MirJ7/UGqMvQrwzXZHGV81YkXcxq+zBhSv25YrJB/9zRPhHLB52EPTeCDkWWtSjAuSx 5RAoQK9OqfztKq2jyzyPwBzclEcPyOI9Wojcwwn6rQm5Sxpc12S/P2RGRUNym4q7642P kuQdHccNG/u9MwLc09JpC1l1Ra6NAts4rG28ugvfFMsPEvgbwVcYEl2WD1gu+ltFPwRV eymQe6Qji3sAUKN4hDsuGBBlFJjtkYLvihHJddsgh9r/NfY05VuMZpqEhoCF6BYbBAGf 8U0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version:content-language; bh=ioMEiHwGnbwN9pDM05775B4XdJijWuQ9EbkbnZJpXl8=; b=fzRFiNlIfGWm2+OOcmbZRN2ShfEl1Z4SWVwILiI5PIXlLHbBWkLLx1GGHc6d7W+xYO LtoAQmC+qSXBQhF8PxJciAV1crSWGZH7WmBpuq5quNw6KYU7EBDcQIarMzpAVQ4Yyetd KR3Cb60UAKIh1EG/jh6a/g/BZSrFaGONjMzIlrVmgqPpFQgI/HovjOPL/moeKSBCeEsW Wfmh6iFiwYES/3Y5qa6rc67Ri9fMw65yZzF8ZoW+hNzLAfcjLP9bNjK/EBx/b63xl69n jlF0IjoPUq9sVnw4QO8EeaSb6bqUhnpNVM8bjkRSFbuXZy+NquCN9BBS8HubFwumdYrS POtg== X-Gm-Message-State: ANhLgQ2YElCUw6j2wVRVYaUA9x76SGLLverfoHFMiE/1AQpPJ1E2v9tD datWhSVMqR41ybMtjNs9KZk= X-Google-Smtp-Source: ADFU+vsm7nuLxUtJeMVfkou6OlpUUzA3S/n9D/XTtO5eEjqWxomBSMYmYwlAIHhcEiuujSOkt/M4Mg== X-Received: by 2002:ac8:b84:: with SMTP id h4mr9056239qti.295.1584718901526; Fri, 20 Mar 2020 08:41:41 -0700 (PDT) Received: from ?IPv6:2620:10d:c0a8:1102:c112:36f6:c3bf:3c88? ([2620:10d:c091:480::1:914a]) by smtp.googlemail.com with ESMTPSA id r15sm5076741qtr.40.2020.03.20.08.41.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Mar 2020 08:41:40 -0700 (PDT) To: GCC Patches , Jim Wilson , kito.cheng@gmail.com From: Nathan Sidwell Subject: [PR 94044] ICE with sizeof & argument pack Message-ID: <522b46d2-70c7-1555-b9c3-e8950fac9b4a@acm.org> Date: Fri, 20 Mar 2020 11:41:39 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 Content-Language: en-US X-Spam-Status: No, score=-26.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Thanks to Jim for figuring out how to reproduce the problem, I was able to apply pr94044-jig.diff to poorly hash the specialization table. (That places all the specializations of a particular template in the same bucket, forcing us to compare the arguments.) The testcase creates sizeof_exprs containing argument packs, and we can no longer use same_type_p on those. I did think this was going to be whack-a-mole, but bootstrapping & testing with the poor hash function, found no other cases. Hurrah! If it could be tested on arm &| riscv, that'd be additional verification. nathan diff --git i/gcc/cp/pt.c w/gcc/cp/pt.c index 03a8dfbd37c..d8544d66ca5 100644 --- i/gcc/cp/pt.c +++ w/gcc/cp/pt.c @@ -1724,7 +1724,12 @@ static hashval_t hash_tmpl_and_args (tree tmpl, tree args) { hashval_t val = iterative_hash_object (DECL_UID (tmpl), 0); - return iterative_hash_template_arg (args, val); +#if 0 + val = iterative_hash_template_arg (args, val); +#else + (void) args; +#endif + return val; } /* Returns a hash for a spec_entry node based on the TMPL and ARGS members,