public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105786] New: ICE in compute_distributive_range, at tree-data-ref.cc:593
@ 2022-05-31  8:10 gcc at olupton dot com
  2022-05-31 15:37 ` [Bug tree-optimization/105786] " acoplan at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gcc at olupton dot com @ 2022-05-31  8:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105786

            Bug ID: 105786
           Summary: ICE in compute_distributive_range, at
                    tree-data-ref.cc:593
           Product: gcc
           Version: 12.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc at olupton dot com
  Target Milestone: ---

The following example:

```
void sink(const char*);
static const char *a;
int main() {
  const char *b = a;
  for (int i = 0; i < 2; ++i)
    while (*b++)
      ;
  sink(b);
  return 0;
}
```

produces an ICE at -O2 and above with 12.1:

```
during GIMPLE pass: pcom
<source>: In function 'int main()':
<source>:3:5: internal compiler error: in compute_distributive_range, at
tree-data-ref.cc:593
    3 | int main() {
      |     ^~~~
```

this is reproducible on Compiler Explorer (https://godbolt.org/z/z1zrqrrEs) and
also using 12.1.1 installed via `dnf` in a `fedora:latest` Docker container.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102853 reports a similar error
message, but it says the issue is resolved so opening this new issue seems
justified.

Note that adding
```
void set_a(const char* x) {
    a = x;
}
```
so that `a` can be non-null avoids the ICE.

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

end of thread, other threads:[~2022-06-02  9:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-31  8:10 [Bug c++/105786] New: ICE in compute_distributive_range, at tree-data-ref.cc:593 gcc at olupton dot com
2022-05-31 15:37 ` [Bug tree-optimization/105786] " acoplan at gcc dot gnu.org
2022-06-01  9:22 ` [Bug tree-optimization/105786] ICE in compute_distributive_range, at tree-data-ref.cc:593 since r12-4283-g6f966f06146be7689af471d152e18ff50c609d99 acoplan at gcc dot gnu.org
2022-06-01  9:30 ` [Bug tree-optimization/105786] [12/13 Regression] " acoplan at gcc dot gnu.org
2022-06-01 12:01 ` rguenth at gcc dot gnu.org
2022-06-01 13:18 ` cvs-commit at gcc dot gnu.org
2022-06-02  9:40 ` [Bug tree-optimization/105786] [12 " cvs-commit at gcc dot gnu.org
2022-06-02  9:44 ` rguenth 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).