public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95241] New: internal compiler error: tree check: expected integer_cst, have range_expr in to_wide, at tree.h:5900
@ 2020-05-20 17:13 tab.debugteam at gmail dot com
  2020-05-20 17:25 ` [Bug c++/95241] [10/11 Regression] " mpolacek at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: tab.debugteam at gmail dot com @ 2020-05-20 17:13 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-05-30  7:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-20 17:13 [Bug c++/95241] New: internal compiler error: tree check: expected integer_cst, have range_expr in to_wide, at tree.h:5900 tab.debugteam at gmail dot com
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

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).