[Bug c++/104008] [11 Regression] New g++ folly compile error since r11-7931-ga2531859bf5bf6cf

2022-04-12 Thread jason at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104008

Jason Merrill  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #16 from Jason Merrill  ---
Fixed for 11.3/12.

[Bug c++/104008] [11 Regression] New g++ folly compile error since r11-7931-ga2531859bf5bf6cf

2022-04-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104008

--- Comment #15 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Jason Merrill
:

https://gcc.gnu.org/g:00e7d6e66638b8d2d93ff6659a140f8b3cf37aeb

commit r11-9827-g00e7d6e66638b8d2d93ff6659a140f8b3cf37aeb
Author: Jason Merrill 
Date:   Fri Mar 25 13:13:35 2022 -0400

c++: hash table ICE with variadic alias [PR105003]

For PR104008 we thought it might be enough to keep strip_typedefs from
removing this alias template specialization, but this PR demonstrates that
other parts of the compiler also need to know to consider it dependent.

So, this patch changes complex_alias_template_p to no longer consider
template parameters used when their only use appears in a pack expansion,
unless they are the parameter packs being expanded.

To do that I also needed to change it to use cp_walk_tree instead of
for_each_template_parm.  It occurs to me that find_template_parameters
should probably also use cp_walk_tree, but I'm not messing with that now.

PR c++/105003
PR c++/104008
PR c++/102869

gcc/cp/ChangeLog:

* pt.c (complex_alias_template_r): walk_tree callback,  replacing
uses_all_template_parms_r, complex_pack_expansion_r.
(complex_alias_template_p): Adjust.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/variadic-alias6.C: New test.
* g++.dg/cpp0x/variadic-alias7.C: New test.

[Bug c++/104008] [11 Regression] New g++ folly compile error since r11-7931-ga2531859bf5bf6cf

2022-03-28 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104008

--- Comment #14 from CVS Commits  ---
The master branch has been updated by Jason Merrill :

https://gcc.gnu.org/g:fc50d9a252c89c1bac78192bd0884ff23f2bf48b

commit r12-7857-gfc50d9a252c89c1bac78192bd0884ff23f2bf48b
Author: Jason Merrill 
Date:   Fri Mar 25 13:13:35 2022 -0400

c++: hash table ICE with variadic alias [PR105003]

For PR104008 we thought it might be enough to keep strip_typedefs from
removing this alias template specialization, but this PR demonstrates that
other parts of the compiler also need to know to consider it dependent.

So, this patch changes complex_alias_template_p to no longer consider
template parameters used when their only use appears in a pack expansion,
unless they are the parameter packs being expanded.

To do that I also needed to change it to use cp_walk_tree instead of
for_each_template_parm.  It occurs to me that find_template_parameters
should probably also use cp_walk_tree, but I'm not messing with that now.

PR c++/105003
PR c++/104008
PR c++/102869

gcc/cp/ChangeLog:

* pt.cc (complex_alias_template_r): walk_tree callback, replacing
uses_all_template_parms_r, complex_pack_expansion_r.
(complex_alias_template_p): Adjust.
* tree.cc (strip_typedefs): Revert r12-7710 change.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/variadic-alias6.C: New test.
* g++.dg/cpp0x/variadic-alias7.C: New test.

[Bug c++/104008] [11 Regression] New g++ folly compile error since r11-7931-ga2531859bf5bf6cf

2022-03-21 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104008

--- Comment #13 from Marek Polacek  ---
Ah, need -fchecking=2:

$ ./cc1plus -quiet variadic-alias3.C -Iinclude
--param=hash-table-verification-limit=1000 -fchecking=2
hash table checking failed: equal operator returns true for a pair of values
with a different hash value
variadic-alias3.C: In instantiation of ‘struct any_badge<>’:
variadic-alias3.C:44:10:   required from ‘unique_ptr make_unique(_Args ...)
[with  = B; _Args = {badge}]’
variadic-alias3.C:40:33:   required from here
variadic-alias3.C:33:3: internal compiler error: in hashtab_chk_error, at
hash-table.cc:137
   33 |   any_badge();
  |   ^
0x2ec90b2 hashtab_chk_error()
/home/mpolacek/src/gcc/gcc/hash-table.cc:137
0xe60acd hash_table::verify(spec_entry*
const&, unsigned int)
/home/mpolacek/src/gcc/gcc/hash-table.h:1036
0xdf449f lookup_template_class_1
/home/mpolacek/src/gcc/gcc/cp/pt.cc:9954
0xdf6cd6 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
/home/mpolacek/src/gcc/gcc/cp/pt.cc:10309
0xe0552c tsubst_aggr_type
/home/mpolacek/src/gcc/gcc/cp/pt.cc:13697
0xe12f43 tsubst(tree_node*, tree_node*, int, tree_node*)
/home/mpolacek/src/gcc/gcc/cp/pt.cc:15607
0xe16e9e tsubst_qualified_id
/home/mpolacek/src/gcc/gcc/cp/pt.cc:16585
0xe2d0bc tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
/home/mpolacek/src/gcc/gcc/cp/pt.cc:20289
0xe29494 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/mpolacek/src/gcc/gcc/cp/pt.cc:19419
0xe001f9 tsubst_template_arg(tree_node*, tree_node*, int, tree_node*)
/home/mpolacek/src/gcc/gcc/cp/pt.cc:12373
0xe045f8 tsubst_template_args(tree_node*, tree_node*, int, tree_node*)
/home/mpolacek/src/gcc/gcc/cp/pt.cc:13467
0xe05375 tsubst_aggr_type
/home/mpolacek/src/gcc/gcc/cp/pt.cc:13679
0xe15272 tsubst(tree_node*, tree_node*, int, tree_node*)
/home/mpolacek/src/gcc/gcc/cp/pt.cc:16148
0xe14629 tsubst(tree_node*, tree_node*, int, tree_node*)
/home/mpolacek/src/gcc/gcc/cp/pt.cc:15904
0xe1b4fd tsubst_copy
/home/mpolacek/src/gcc/gcc/cp/pt.cc:17398
0xe32aca tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
/home/mpolacek/src/gcc/gcc/cp/pt.cc:21327
0xe29494 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/mpolacek/src/gcc/gcc/cp/pt.cc:19419
0xe001f9 tsubst_template_arg(tree_node*, tree_node*, int, tree_node*)
/home/mpolacek/src/gcc/gcc/cp/pt.cc:12373
0xe045f8 tsubst_template_args(tree_node*, tree_node*, int, tree_node*)
/home/mpolacek/src/gcc/gcc/cp/pt.cc:13467
0xe0451d tsubst_template_args(tree_node*, tree_node*, int, tree_node*)
/home/mpolacek/src/gcc/gcc/cp/pt.cc:13449

[Bug c++/104008] [11 Regression] New g++ folly compile error since r11-7931-ga2531859bf5bf6cf

2022-03-18 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104008

--- Comment #12 from Marek Polacek  ---
(In reply to Patrick Palka from comment #11)
> FWIW it seems the new test g++.dg/cpp0x/variadic-alias3.C crashes when using
> --param=hash-table-verification-limit=1000, similar to PR103769.

I cannot reproduce that:

$ ./cc1plus -quiet variadic-alias3.C --param=hash-table-verification-limit=1000
# OK

[Bug c++/104008] [11 Regression] New g++ folly compile error since r11-7931-ga2531859bf5bf6cf

2022-03-18 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104008

Patrick Palka  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=103769
 CC||ppalka at gcc dot gnu.org

--- Comment #11 from Patrick Palka  ---
FWIW it seems the new test g++.dg/cpp0x/variadic-alias3.C crashes when using
--param=hash-table-verification-limit=1000, similar to PR103769.

[Bug c++/104008] [11 Regression] New g++ folly compile error since r11-7931-ga2531859bf5bf6cf

2022-03-18 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104008

Marek Polacek  changed:

   What|Removed |Added

Summary|[11/12 Regression] New g++  |[11 Regression] New g++
   |folly compile error since   |folly compile error since
   |r11-7931-ga2531859bf5bf6cf  |r11-7931-ga2531859bf5bf6cf

--- Comment #10 from Marek Polacek  ---
Fixed on trunk so far.