diff mbox series

[PR,94044] ICE with sizeof & argument pack

Message ID 522b46d2-70c7-1555-b9c3-e8950fac9b4a@acm.org
State New
Headers show
Series [PR,94044] ICE with sizeof & argument pack | expand

Commit Message

Nathan Sidwell March 20, 2020, 3:41 p.m. UTC
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

Comments

Jim Wilson March 22, 2020, 6:26 p.m. UTC | #1
On Fri, Mar 20, 2020 at 8:41 AM Nathan Sidwell <nathan@acm.org> wrote:
> If it could be tested on arm &| riscv, that'd be additional verification.

I did riscv testing, both cross and native, and didn't see any new
problems with the patch.

Jim
Li, Pan2 via Gcc-patches March 23, 2020, 9:36 a.m. UTC | #2
Hi Nathan:

Tested variadic-sizeof4.C on x86, x86_64 with native compiler
Tested  variadic-sizeof4.C on aarch64, arm-eabi, riscv32, riscv64,
mips, mips64 and nds32 with cross compiler.

And tested g++/dg.exp on arm-eabi with this patch, no new fail introduced.


On Mon, Mar 23, 2020 at 2:27 AM Jim Wilson <jimw@sifive.com> wrote:
>
> On Fri, Mar 20, 2020 at 8:41 AM Nathan Sidwell <nathan@acm.org> wrote:
> > If it could be tested on arm &| riscv, that'd be additional verification.
>
> I did riscv testing, both cross and native, and didn't see any new
> problems with the patch.
>
> Jim
Nathan Sidwell March 23, 2020, 10:43 a.m. UTC | #3
On 3/23/20 5:36 AM, Kito Cheng wrote:
> Hi Nathan:
> 
> Tested variadic-sizeof4.C on x86, x86_64 with native compiler
> Tested  variadic-sizeof4.C on aarch64, arm-eabi, riscv32, riscv64,
> mips, mips64 and nds32 with cross compiler.
> 
> And tested g++/dg.exp on arm-eabi with this patch, no new fail introduced.
> 
> 
> On Mon, Mar 23, 2020 at 2:27 AM Jim Wilson <jimw@sifive.com> wrote:
>>
>> On Fri, Mar 20, 2020 at 8:41 AM Nathan Sidwell <nathan@acm.org> wrote:
>>> If it could be tested on arm &| riscv, that'd be additional verification.
>>
>> I did riscv testing, both cross and native, and didn't see any new
>> problems with the patch.
>>

Thanks for checking guys.  Committed.

nathan
diff mbox series

Patch

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,