* [Bug c++/94907] ICE: Segmentation fault (in check_return_expr)
2020-05-01 18:08 [Bug c++/94907] New: ICE: Segmentation fault (in check_return_expr) asolokha at gmx dot com
@ 2020-05-01 18:30 ` mpolacek at gcc dot gnu.org
2020-05-04 5:42 ` [Bug c++/94907] ICE: Segmentation fault (in check_return_expr) since r10-8016-gbce54ed494fd0e61 marxin at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-05-01 18:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94907
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed| |2020-05-01
CC| |mpolacek at gcc dot gnu.org
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
We ICE here
9926 /* Remember that this function did return a value. */
9927 current_function_returns_value = 1;
because cfun is null.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/94907] ICE: Segmentation fault (in check_return_expr) since r10-8016-gbce54ed494fd0e61
2020-05-01 18:08 [Bug c++/94907] New: ICE: Segmentation fault (in check_return_expr) asolokha at gmx dot com
2020-05-01 18:30 ` [Bug c++/94907] " mpolacek at gcc dot gnu.org
@ 2020-05-04 5:42 ` marxin at gcc dot gnu.org
2020-05-04 6:27 ` [Bug c++/94907] [10/11 Regression] " rguenth at gcc dot gnu.org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-05-04 5:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94907
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org,
| |marxin at gcc dot gnu.org
Summary|ICE: Segmentation fault (in |ICE: Segmentation fault (in
|check_return_expr) |check_return_expr) since
| |r10-8016-gbce54ed494fd0e61
--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r10-8016-gbce54ed494fd0e61.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/94907] [10/11 Regression] ICE: Segmentation fault (in check_return_expr) since r10-8016-gbce54ed494fd0e61
2020-05-01 18:08 [Bug c++/94907] New: ICE: Segmentation fault (in check_return_expr) asolokha at gmx dot com
2020-05-01 18:30 ` [Bug c++/94907] " mpolacek at gcc dot gnu.org
2020-05-04 5:42 ` [Bug c++/94907] ICE: Segmentation fault (in check_return_expr) since r10-8016-gbce54ed494fd0e61 marxin at gcc dot gnu.org
@ 2020-05-04 6:27 ` rguenth at gcc dot gnu.org
2020-05-04 13:44 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-04 6:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94907
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |10.0
Summary|ICE: Segmentation fault (in |[10/11 Regression] ICE:
|check_return_expr) since |Segmentation fault (in
|r10-8016-gbce54ed494fd0e61 |check_return_expr) since
| |r10-8016-gbce54ed494fd0e61
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/94907] [10/11 Regression] ICE: Segmentation fault (in check_return_expr) since r10-8016-gbce54ed494fd0e61
2020-05-01 18:08 [Bug c++/94907] New: ICE: Segmentation fault (in check_return_expr) asolokha at gmx dot com
` (2 preceding siblings ...)
2020-05-04 6:27 ` [Bug c++/94907] [10/11 Regression] " rguenth at gcc dot gnu.org
@ 2020-05-04 13:44 ` jakub at gcc dot gnu.org
2020-05-06 21:37 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-05-04 13:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94907
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 48442
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48442&action=edit
gcc11-pr94907.patch
It seems wrong to call synthesize_method again on a decl on which it has been
called already.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/94907] [10/11 Regression] ICE: Segmentation fault (in check_return_expr) since r10-8016-gbce54ed494fd0e61
2020-05-01 18:08 [Bug c++/94907] New: ICE: Segmentation fault (in check_return_expr) asolokha at gmx dot com
` (3 preceding siblings ...)
2020-05-04 13:44 ` jakub at gcc dot gnu.org
@ 2020-05-06 21:37 ` cvs-commit at gcc dot gnu.org
2020-05-07 11:56 ` jakub at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-05-06 21:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94907
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:25ee2155ead87a5ea1c152a29341ee1e3275d706
commit r11-152-g25ee2155ead87a5ea1c152a29341ee1e3275d706
Author: Jakub Jelinek <jakub@redhat.com>
Date: Wed May 6 23:36:31 2020 +0200
c++: Don't synthesize sfk_comparison method multiple times [PR94907]
On the following testcase we ICE, because synthesize_method is called twice
on the same sfk_comparison method fndecl, the first time it works fine
because start_preparsed_function in that case sets both
current_function_decl and cfun, but second time it is called it only sets
the former and keeps cfun NULL, so we ICE when trying to store
current_function_returns_value.
I think it is just wrong to call synthesize_method multiple times, and most
synthesize_method callers avoid that by not calling it if DECL_INITIAL is
already set, so this patch does that too.
2020-05-06 Jakub Jelinek <jakub@redhat.com>
PR c++/94907
* method.c (defaulted_late_check): Don't call synthesize_method
on constexpr sfk_comparison if it has been called on it already.
* g++.dg/cpp2a/spaceship-synth8.C: New test.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/94907] [10/11 Regression] ICE: Segmentation fault (in check_return_expr) since r10-8016-gbce54ed494fd0e61
2020-05-01 18:08 [Bug c++/94907] New: ICE: Segmentation fault (in check_return_expr) asolokha at gmx dot com
` (4 preceding siblings ...)
2020-05-06 21:37 ` cvs-commit at gcc dot gnu.org
@ 2020-05-07 11:56 ` jakub at gcc dot gnu.org
2020-05-07 13:28 ` cvs-commit at gcc dot gnu.org
2020-05-07 13:35 ` jakub at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-05-07 11:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94907
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|10.0 |10.2
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.1 has been released.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/94907] [10/11 Regression] ICE: Segmentation fault (in check_return_expr) since r10-8016-gbce54ed494fd0e61
2020-05-01 18:08 [Bug c++/94907] New: ICE: Segmentation fault (in check_return_expr) asolokha at gmx dot com
` (5 preceding siblings ...)
2020-05-07 11:56 ` jakub at gcc dot gnu.org
@ 2020-05-07 13:28 ` cvs-commit at gcc dot gnu.org
2020-05-07 13:35 ` jakub at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-05-07 13:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94907
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:3d4c7e05de438fb0672f376e628c18812eea8982
commit r10-8114-g3d4c7e05de438fb0672f376e628c18812eea8982
Author: Jakub Jelinek <jakub@redhat.com>
Date: Wed May 6 23:36:31 2020 +0200
c++: Don't synthesize sfk_comparison method multiple times [PR94907]
On the following testcase we ICE, because synthesize_method is called twice
on the same sfk_comparison method fndecl, the first time it works fine
because start_preparsed_function in that case sets both
current_function_decl and cfun, but second time it is called it only sets
the former and keeps cfun NULL, so we ICE when trying to store
current_function_returns_value.
I think it is just wrong to call synthesize_method multiple times, and most
synthesize_method callers avoid that by not calling it if DECL_INITIAL is
already set, so this patch does that too.
2020-05-06 Jakub Jelinek <jakub@redhat.com>
PR c++/94907
* method.c (defaulted_late_check): Don't call synthesize_method
on constexpr sfk_comparison if it has been called on it already.
* g++.dg/cpp2a/spaceship-synth8.C: New test.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/94907] [10/11 Regression] ICE: Segmentation fault (in check_return_expr) since r10-8016-gbce54ed494fd0e61
2020-05-01 18:08 [Bug c++/94907] New: ICE: Segmentation fault (in check_return_expr) asolokha at gmx dot com
` (6 preceding siblings ...)
2020-05-07 13:28 ` cvs-commit at gcc dot gnu.org
@ 2020-05-07 13:35 ` jakub at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-05-07 13:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94907
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 10.2+ and 11+.
^ permalink raw reply [flat|nested] 9+ messages in thread