public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "tab.debugteam at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95241] New: internal compiler error: tree check: expected integer_cst, have range_expr in to_wide, at tree.h:5900 Date: Wed, 20 May 2020 17:13:59 +0000 [thread overview] Message-ID: <bug-95241-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95241 Bug ID: 95241 Summary: internal compiler error: tree check: expected integer_cst, have range_expr in to_wide, at tree.h:5900 Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tab.debugteam at gmail dot com Target Milestone: --- Following c++ code: ``` struct Fragment { int offset; int length; constexpr Fragment( int _offset, int _length) : offset(_offset), length(_length) { } constexpr Fragment() : Fragment(0, 1) { } }; struct Field { Fragment fragments[3]; constexpr Field(int offset, int length) : fragments{Fragment(offset, length)} { } }; int main() { auto field = Field(0, 1); return 0; } ``` fails to compile with gcc 10.1 (https://godbolt.org/z/tyPB6V) and later with error message: ``` <source>: In function 'int main()': <source>:28:28: in 'constexpr' expansion of 'Field(0, 1)' <source>:28:28: internal compiler error: tree check: expected integer_cst, have range_expr in to_wide, at tree.h:5900 28 | auto field = Field(0, 1); | ^ ``` First spotted on gcc 10.1: https://godbolt.org/z/tyPB6V, but it's also reproducible on latest gcc available on compiler explorer (version 11.0.0 20200511): https://godbolt.org/z/qWivJC. I'm unable to reproduce it on gcc 9.3: https://godbolt.org/z/C2QqxA.
next reply other threads:[~2020-05-20 17:13 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-20 17:13 tab.debugteam at gmail dot com [this message] 2020-05-20 17:25 ` [Bug c++/95241] [10/11 Regression] " mpolacek at gcc dot gnu.org 2020-05-20 18:14 ` ppalka at gcc dot gnu.org 2020-05-22 6:08 ` rguenth at gcc dot gnu.org 2020-05-29 13:44 ` cvs-commit at gcc dot gnu.org 2020-05-29 13:45 ` [Bug c++/95241] [10 " ppalka at gcc dot gnu.org 2020-05-30 4:20 ` cvs-commit at gcc dot gnu.org 2020-05-30 4:22 ` ppalka at gcc dot gnu.org 2020-05-30 7:30 ` tab.debugteam at gmail dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-95241-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).