public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110175] New: [GCC][Crash] GCC Crash on valid code
@ 2023-06-08 14:28 yronglin777 at gmail dot com
2023-06-08 18:05 ` [Bug c++/110175] " mpolacek at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: yronglin777 at gmail dot com @ 2023-06-08 14:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110175
Bug ID: 110175
Summary: [GCC][Crash] GCC Crash on valid code
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: yronglin777 at gmail dot com
Target Milestone: ---
https://godbolt.org/z/Wf7M89v8x
```
template<class T> auto f(T t) -> decltype(++t) { return t; }
void f(...) {}
void g() { f(true); }
```
```
internal compiler error: error reporting routines re-entered.
0x23b8691 warning_at(unsigned int, int, char const*, ...)
???:0
0xd39208 cp_build_unary_op(tree_code, tree_node*, bool, int)
???:0
0xacd484 build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node*, tree_node**, int)
???:0
0xd370e3 build_x_unary_op(unsigned int, tree_code, cp_expr, tree_node*, int)
???:0
0xcb685f tsubst(tree_node*, tree_node*, int, tree_node*)
???:0
0x23d8a2c pp_format(pretty_printer*, text_info*)
???:0
0x23d9c3d pp_format_verbatim(pretty_printer*, text_info*)
???:0
0x23d9d25 pp_verbatim(pretty_printer*, char const*, ...)
???:0
0x23b7895 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
???:0
0x23b8691 warning_at(unsigned int, int, char const*, ...)
???:0
0xd45bf1 check_return_expr(tree_node*, bool*)
???:0
0xcef6a3 finish_return_stmt(tree_node*)
???:0
0xcaf2f8 instantiate_decl(tree_node*, bool, bool)
???:0
0xcda84b instantiate_pending_templates(int)
???:0
0xb8e905 c_parse_final_cleanups()
???:0
0xdbe998 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
```
If remove the function body of 2 `f` functions, GCC will works well.
```
template<class T> auto f(T t) -> decltype(++t);
void f(...);
void g() { f(true); }
```
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/110175] [GCC][Crash] GCC Crash on valid code
2023-06-08 14:28 [Bug c++/110175] New: [GCC][Crash] GCC Crash on valid code yronglin777 at gmail dot com
@ 2023-06-08 18:05 ` mpolacek at gcc dot gnu.org
2023-06-09 4:13 ` yronglin777 at gmail dot com
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2023-06-08 18:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110175
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2023-06-08
CC| |mpolacek at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.
--- a/gcc/cp/typeck.cc
+++ b/gcc/cp/typeck.cc
@@ -7561,7 +7561,8 @@ cp_build_unary_op (enum tree_code code, tree xarg, bool
noconvert,
/* [depr.volatile.type] "Postfix ++ and -- expressions and
prefix ++ and -- expressions of volatile-qualified arithmetic
and pointer types are deprecated." */
- if (TREE_THIS_VOLATILE (arg) || CP_TYPE_VOLATILE_P (TREE_TYPE (arg)))
+ if ((TREE_THIS_VOLATILE (arg) || CP_TYPE_VOLATILE_P (TREE_TYPE (arg)))
+ && (complain & tf_warning))
warning_at (location, OPT_Wvolatile,
"%qs expression of %<volatile%>-qualified type is "
"deprecated",
@@ -7592,7 +7593,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, bool
noconvert,
return error_mark_node;
}
/* Otherwise, [depr.incr.bool] says this is deprecated. */
- else
+ else if (complain & tf_warning)
warning_at (location, OPT_Wdeprecated,
"use of an operand of type %qT "
"in %<operator++%> is deprecated",
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/110175] [GCC][Crash] GCC Crash on valid code
2023-06-08 14:28 [Bug c++/110175] New: [GCC][Crash] GCC Crash on valid code yronglin777 at gmail dot com
2023-06-08 18:05 ` [Bug c++/110175] " mpolacek at gcc dot gnu.org
@ 2023-06-09 4:13 ` yronglin777 at gmail dot com
2023-06-28 15:52 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: yronglin777 at gmail dot com @ 2023-06-09 4:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110175
--- Comment #2 from Yrong <yronglin777 at gmail dot com> ---
Thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/110175] [GCC][Crash] GCC Crash on valid code
2023-06-08 14:28 [Bug c++/110175] New: [GCC][Crash] GCC Crash on valid code yronglin777 at gmail dot com
2023-06-08 18:05 ` [Bug c++/110175] " mpolacek at gcc dot gnu.org
2023-06-09 4:13 ` yronglin777 at gmail dot com
@ 2023-06-28 15:52 ` cvs-commit at gcc dot gnu.org
2023-06-28 15:52 ` mpolacek at gcc dot gnu.org
2023-06-28 18:52 ` ppalka at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-06-28 15:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110175
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:4de22e25918f6fe40184c444ba6d81b19b806e26
commit r14-2167-g4de22e25918f6fe40184c444ba6d81b19b806e26
Author: Marek Polacek <polacek@redhat.com>
Date: Thu Jun 8 14:07:44 2023 -0400
c++: fix error reporting routines re-entered ICE [PR110175]
Here we get the "error reporting routines re-entered" ICE because
of an unguarded use of warning_at. While at it, I added a check
for a warning_at just above it.
PR c++/110175
gcc/cp/ChangeLog:
* typeck.cc (cp_build_unary_op): Check tf_warning before warning.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/decltype-110175.C: New test.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/110175] [GCC][Crash] GCC Crash on valid code
2023-06-08 14:28 [Bug c++/110175] New: [GCC][Crash] GCC Crash on valid code yronglin777 at gmail dot com
` (2 preceding siblings ...)
2023-06-28 15:52 ` cvs-commit at gcc dot gnu.org
@ 2023-06-28 15:52 ` mpolacek at gcc dot gnu.org
2023-06-28 18:52 ` ppalka at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2023-06-28 15:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110175
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed in GCC 14.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/110175] [GCC][Crash] GCC Crash on valid code
2023-06-08 14:28 [Bug c++/110175] New: [GCC][Crash] GCC Crash on valid code yronglin777 at gmail dot com
` (3 preceding siblings ...)
2023-06-28 15:52 ` mpolacek at gcc dot gnu.org
@ 2023-06-28 18:52 ` ppalka at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-06-28 18:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110175
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |14.0
Keywords|c++-lambda |
CC| |ppalka at gcc dot gnu.org
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-06-28 18:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-08 14:28 [Bug c++/110175] New: [GCC][Crash] GCC Crash on valid code yronglin777 at gmail dot com
2023-06-08 18:05 ` [Bug c++/110175] " mpolacek at gcc dot gnu.org
2023-06-09 4:13 ` yronglin777 at gmail dot com
2023-06-28 15:52 ` cvs-commit at gcc dot gnu.org
2023-06-28 15:52 ` mpolacek at gcc dot gnu.org
2023-06-28 18:52 ` ppalka at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).