* [Bug c++/95192] [11 Regression] ICE: tree check: expected tree_list, have error_mark in handle_assume_aligned_attribute, at c-family/c-attribs.c:2996
2020-05-18 19:57 [Bug c++/95192] New: [11 Regression] ICE: tree check: expected tree_list, have error_mark in handle_assume_aligned_attribute, at c-family/c-attribs.c:2996 asolokha at gmx dot com
@ 2020-05-18 20:03 ` mpolacek at gcc dot gnu.org
2020-05-19 6:41 ` rguenth at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-05-18 20:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95192
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
Status|UNCONFIRMED |NEW
Last reconfirmed| |2020-05-18
Ever confirmed|0 |1
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed. Started with r11-423-gcda6396a1b6e6bba2a3b0847931567c3458f2184
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/95192] [11 Regression] ICE: tree check: expected tree_list, have error_mark in handle_assume_aligned_attribute, at c-family/c-attribs.c:2996
2020-05-18 19:57 [Bug c++/95192] New: [11 Regression] ICE: tree check: expected tree_list, have error_mark in handle_assume_aligned_attribute, at c-family/c-attribs.c:2996 asolokha at gmx dot com
2020-05-18 20:03 ` [Bug c++/95192] " mpolacek at gcc dot gnu.org
@ 2020-05-19 6:41 ` rguenth at gcc dot gnu.org
2020-10-16 11:45 ` rguenth at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-19 6:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95192
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |11.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/95192] [11 Regression] ICE: tree check: expected tree_list, have error_mark in handle_assume_aligned_attribute, at c-family/c-attribs.c:2996
2020-05-18 19:57 [Bug c++/95192] New: [11 Regression] ICE: tree check: expected tree_list, have error_mark in handle_assume_aligned_attribute, at c-family/c-attribs.c:2996 asolokha at gmx dot com
2020-05-18 20:03 ` [Bug c++/95192] " mpolacek at gcc dot gnu.org
2020-05-19 6:41 ` rguenth at gcc dot gnu.org
@ 2020-10-16 11:45 ` rguenth at gcc dot gnu.org
2020-11-18 14:59 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-10-16 11:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95192
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/95192] [11 Regression] ICE: tree check: expected tree_list, have error_mark in handle_assume_aligned_attribute, at c-family/c-attribs.c:2996
2020-05-18 19:57 [Bug c++/95192] New: [11 Regression] ICE: tree check: expected tree_list, have error_mark in handle_assume_aligned_attribute, at c-family/c-attribs.c:2996 asolokha at gmx dot com
` (2 preceding siblings ...)
2020-10-16 11:45 ` rguenth at gcc dot gnu.org
@ 2020-11-18 14:59 ` jakub at gcc dot gnu.org
2020-12-04 14:17 ` marxin at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-11-18 14:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95192
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
In cp/parser.c, we have code that avoids building attributes with
error_mark_node values (instead just use error_mark_node as the attributes).
So, I wonder if we shouldn't do that in tsubst_attributes too, like:
--- gcc/cp/pt.c.jj 2020-11-18 09:40:09.618663053 +0100
+++ gcc/cp/pt.c 2020-11-18 15:47:26.584181671 +0100
@@ -11502,6 +11502,8 @@ tsubst_attribute (tree t, tree *decl_p,
tree chain
= tsubst_expr (TREE_CHAIN (val), args, complain, in_decl,
/*integral_constant_expression_p=*/false);
+ if (chain == error_mark_node)
+ return error_mark_node;
if (chain != TREE_CHAIN (val))
val = tree_cons (NULL_TREE, TREE_VALUE (val), chain);
}
@@ -11524,8 +11526,12 @@ tsubst_attribute (tree t, tree *decl_p,
return list;
}
else
- val = tsubst_expr (val, args, complain, in_decl,
- /*integral_constant_expression_p=*/false);
+ {
+ val = tsubst_expr (val, args, complain, in_decl,
+ /*integral_constant_expression_p=*/false);
+ if (val == error_mark_node)
+ return val;
+ }
if (val != TREE_VALUE (t))
return build_tree_list (TREE_PURPOSE (t), val);
Except that we accept the testcase then rather than reject - the unification is
done with complain == 0...
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/95192] [11 Regression] ICE: tree check: expected tree_list, have error_mark in handle_assume_aligned_attribute, at c-family/c-attribs.c:2996
2020-05-18 19:57 [Bug c++/95192] New: [11 Regression] ICE: tree check: expected tree_list, have error_mark in handle_assume_aligned_attribute, at c-family/c-attribs.c:2996 asolokha at gmx dot com
` (3 preceding siblings ...)
2020-11-18 14:59 ` jakub at gcc dot gnu.org
@ 2020-12-04 14:17 ` marxin at gcc dot gnu.org
2020-12-04 14:20 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-04 14:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95192
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |marxin at gcc dot gnu.org
--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #2)
> In cp/parser.c, we have code that avoids building attributes with
> error_mark_node values (instead just use error_mark_node as the attributes).
>
> So, I wonder if we shouldn't do that in tsubst_attributes too, like:
> --- gcc/cp/pt.c.jj 2020-11-18 09:40:09.618663053 +0100
> +++ gcc/cp/pt.c 2020-11-18 15:47:26.584181671 +0100
> @@ -11502,6 +11502,8 @@ tsubst_attribute (tree t, tree *decl_p,
> tree chain
> = tsubst_expr (TREE_CHAIN (val), args, complain, in_decl,
> /*integral_constant_expression_p=*/false);
> + if (chain == error_mark_node)
> + return error_mark_node;
> if (chain != TREE_CHAIN (val))
> val = tree_cons (NULL_TREE, TREE_VALUE (val), chain);
> }
> @@ -11524,8 +11526,12 @@ tsubst_attribute (tree t, tree *decl_p,
> return list;
> }
> else
> - val = tsubst_expr (val, args, complain, in_decl,
> - /*integral_constant_expression_p=*/false);
> + {
> + val = tsubst_expr (val, args, complain, in_decl,
> + /*integral_constant_expression_p=*/false);
> + if (val == error_mark_node)
> + return val;
> + }
>
> if (val != TREE_VALUE (t))
> return build_tree_list (TREE_PURPOSE (t), val);
>
> Except that we accept the testcase then rather than reject - the unification
> is done with complain == 0...
Are you planning Jakub to send the patch candidate to the mailing list?
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/95192] [11 Regression] ICE: tree check: expected tree_list, have error_mark in handle_assume_aligned_attribute, at c-family/c-attribs.c:2996
2020-05-18 19:57 [Bug c++/95192] New: [11 Regression] ICE: tree check: expected tree_list, have error_mark in handle_assume_aligned_attribute, at c-family/c-attribs.c:2996 asolokha at gmx dot com
` (4 preceding siblings ...)
2020-12-04 14:17 ` marxin at gcc dot gnu.org
@ 2020-12-04 14:20 ` jakub at gcc dot gnu.org
2021-02-01 21:46 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-12-04 14:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95192
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
No, because it isn't sufficient, I believe we need to reject it rather than
accept it.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/95192] [11 Regression] ICE: tree check: expected tree_list, have error_mark in handle_assume_aligned_attribute, at c-family/c-attribs.c:2996
2020-05-18 19:57 [Bug c++/95192] New: [11 Regression] ICE: tree check: expected tree_list, have error_mark in handle_assume_aligned_attribute, at c-family/c-attribs.c:2996 asolokha at gmx dot com
` (5 preceding siblings ...)
2020-12-04 14:20 ` jakub at gcc dot gnu.org
@ 2021-02-01 21:46 ` jason at gcc dot gnu.org
2021-02-04 2:38 ` cvs-commit at gcc dot gnu.org
2021-02-04 2:40 ` jason at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2021-02-01 21:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95192
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org
CC| |jason at gcc dot gnu.org
Status|NEW |ASSIGNED
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/95192] [11 Regression] ICE: tree check: expected tree_list, have error_mark in handle_assume_aligned_attribute, at c-family/c-attribs.c:2996
2020-05-18 19:57 [Bug c++/95192] New: [11 Regression] ICE: tree check: expected tree_list, have error_mark in handle_assume_aligned_attribute, at c-family/c-attribs.c:2996 asolokha at gmx dot com
` (6 preceding siblings ...)
2021-02-01 21:46 ` jason at gcc dot gnu.org
@ 2021-02-04 2:38 ` cvs-commit at gcc dot gnu.org
2021-02-04 2:40 ` jason at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-04 2:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95192
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:
https://gcc.gnu.org/g:7b258ac7afaaf7d8157df10ea35c6002d935d7d0
commit r11-7095-g7b258ac7afaaf7d8157df10ea35c6002d935d7d0
Author: Jason Merrill <jason@redhat.com>
Date: Mon Feb 1 17:24:05 2021 -0500
c++: subst failure in attribute argument [PR95192]
Another SFINAE issue: we weren't propagating substitution failure in
attributes back up. And tsubst_function_decl needs to check substitution
before register_specialization. I thought about moving the other error
returns up as well, but they aren't SFINAE cases, so they can stay where
they are.
This change caused pr84630.C to stop giving an error; this was because
partial instantiation of the lambda failed silently, and before the change
that meant error_mark_node passed to decl_attributes, which complained
about
there being an argument at all. With the change the partial instantiation
fails, but no error was ever given, because push_template_decl silently
failed if current_template_parms wasn't set. So let's set c_t_p
appropriately. lambda-uneval13.C is a valid testcase to exercise this.
gcc/cp/ChangeLog:
PR c++/95192
* pt.c (tsubst_attribute): Handle error.
(apply_late_template_attributes): Return false on error.
(tsubst_function_decl): Check its return value.
(tsubst_decl): Likewise.
(push_template_decl): Assert current_template_parms.
(tsubst_template_decl): Set current_template_parms.
gcc/testsuite/ChangeLog:
PR c++/95192
* g++.dg/cpp0x/pr84630.C: Call b().
* g++.dg/cpp2a/lambda-uneval13.C: New test.
* g++.dg/ext/attr-expr1.C: New test.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/95192] [11 Regression] ICE: tree check: expected tree_list, have error_mark in handle_assume_aligned_attribute, at c-family/c-attribs.c:2996
2020-05-18 19:57 [Bug c++/95192] New: [11 Regression] ICE: tree check: expected tree_list, have error_mark in handle_assume_aligned_attribute, at c-family/c-attribs.c:2996 asolokha at gmx dot com
` (7 preceding siblings ...)
2021-02-04 2:38 ` cvs-commit at gcc dot gnu.org
@ 2021-02-04 2:40 ` jason at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2021-02-04 2:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95192
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 10+ messages in thread