[Bug c++/68290] g++.dg/concepts/auto1.C FAILs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68290 Bug 68290 depends on bug 68434, which changed state. Bug 68434 Summary: [concepts] function tsubst sets TYPE_CANONICAL before setting a type's PLACEHOLDER_TYPE_CONSTRAINTS https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68434 What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED
[Bug c++/68290] g++.dg/concepts/auto1.C FAILs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68290 Eric Botcazou changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #7 from Eric Botcazou --- .
[Bug c++/68290] g++.dg/concepts/auto1.C FAILs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68290 --- Comment #6 from Eric Botcazou --- Author: ebotcazou Date: Wed Dec 2 16:41:02 2015 New Revision: 231189 URL: https://gcc.gnu.org/viewcvs?rev=231189&root=gcc&view=rev Log: PR c++/68290 * constraint.cc (make_constrained_auto): Move to... * pt.c (make_auto_1): Add set_canonical parameter and set TYPE_CANONICAL on the type only if it is true. (make_decltype_auto): Adjust call to make_auto_1. (make_auto): Likewise. (splice_late_return_type): Likewise. (make_constrained_auto): ...here. Call make_auto_1 instead of make_auto and pass false. Set TYPE_CANONICAL directly. Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/constraint.cc trunk/gcc/cp/pt.c
[Bug c++/68290] g++.dg/concepts/auto1.C FAILs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68290 --- Comment #5 from Eric Botcazou --- > This issue is host-dependent, it doesn't reproduce with a cross to 64-bit > SPARC. > > The problematic types are: > > (gdb) p debug_tree(t1) > align 8 symtab 0 alias set -1 canonical type fb4ccae0 >index 0 level 1 orig_level 1 > chain > > > (gdb) p debug_tree(t2) > align 8 symtab 0 alias set -1 canonical type fb4cd0e0 >index 0 level 1 orig_level 1 > chain > > > and they compare equal according to structural_comptypes but have distinct > TYPE_CANONICAL (themselves actually). IIUC that's the bug: being equivalent as per structural_comptypes, they really should have the same TYPE_CANONICAL. The problem then comes from: /* Make a "constrained auto" type-specifier. This is an auto type with constraints that must be associated after deduction. The constraint is formed from the given CONC and its optional sequence of arguments, which are non-null if written as partial-concept-id. */ tree make_constrained_auto (tree con, tree args) { tree type = make_auto(); /* Build the constraint. */ tree tmpl = DECL_TI_TEMPLATE (con); tree expr; if (VAR_P (con)) expr = build_concept_check (tmpl, type, args); else expr = build_concept_check (build_overload (tmpl, NULL_TREE), type, args); tree constr = make_predicate_constraint (expr); PLACEHOLDER_TYPE_CONSTRAINTS (type) = constr; /* Attach the constraint to the type declaration. */ tree decl = TYPE_NAME (type); return decl; } The call to make_auto (make_auto_1) creates them with their TYPE_CANONICAL set by means of canonical_type_parameter. Now canonical_type_parameter calls structural_comptypes, which calls equivalent_placeholder_constraints, which looks at the PLACEHOLDER_TYPE_CONSTRAINTS... which are not yet set above. IOW, the first call to structural_comptypes on them returns false so the TYPE_CANONICAL of the second one is not set to the first one, then the PLACEHOLDER_TYPE_CONSTRAINTS of the second one is set so the second call to structural_comptypes on them returns true, leading to the checking failure.
[Bug c++/68290] g++.dg/concepts/auto1.C FAILs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68290 Eric Botcazou changed: What|Removed |Added Depends on||68434 --- Comment #4 from Eric Botcazou --- This might be related to PR c++/68434. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68434 [Bug 68434] [concepts] ICE: same canonical type node for different types
[Bug c++/68290] g++.dg/concepts/auto1.C FAILs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68290 --- Comment #3 from Eric Botcazou --- This issue is host-dependent, it doesn't reproduce with a cross to 64-bit SPARC. The problematic types are: (gdb) p debug_tree(t1) > (gdb) p debug_tree(t2) > and they compare equal according to structural_comptypes but have distinct TYPE_CANONICAL (themselves actually). I think that the dependence on the host comes from: inline hashval_t auto_hash::hash (tree t) { if (tree c = PLACEHOLDER_TYPE_CONSTRAINTS (t)) /* Matching constrained-type-specifiers denote the same template parameter, so hash the constraint. */ return hash_placeholder_constraint (c); else /* But unconstrained autos are all separate, so just hash the pointer. */ return iterative_hash_object (t, 0); } and that we have a hash collision on the SPARC machine. The problem seems to come from comp_template_parms_position: /* In C++14 we can end up comparing 'auto' to a normal template parameter. Don't confuse them. */ if (cxx_dialect >= cxx14 && (is_auto (t1) || is_auto (t2))) return TYPE_IDENTIFIER (t1) == TYPE_IDENTIFIER (t2); IIUC we should compare t1 and t2 directly here if both are 'auto's.
[Bug c++/68290] g++.dg/concepts/auto1.C FAILs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68290 Eric Botcazou changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |ebotcazou at gcc dot gnu.org --- Comment #2 from Eric Botcazou --- Investigating.
[Bug c++/68290] g++.dg/concepts/auto1.C FAILs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68290 Eric Botcazou changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2015-11-12 CC||ebotcazou at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Eric Botcazou --- I have it too.
[Bug c++/68290] g++.dg/concepts/auto1.C FAILs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68290 Rainer Orth changed: What|Removed |Added Target Milestone|--- |6.0