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

            Bug ID: 91002
           Summary: ICE in make_ssa_name_fn, at tree-ssanames.c:271
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ignat.loskutov at gmail dot com
  Target Milestone: ---

The following piece of code leads to ICE in make_ssa_name_fn, at
tree-ssanames.c:271 when trying to compile with `g++ -O3` (all versions from
7.1 to trunk seem to be affected, the error message applies to 9.1):

namespace my {

int foo() { return 1; }

struct s {

  void bar(int i) {
    auto *objects = reinterpret_cast<char(*)[foo()]>(storage);
    void *ptr = &objects[i];
  }

  void baz();

  char *storage;
};

void s::baz() {
  bar(0);
}

} // namespace my


Compiler Explorer link reproducing the issue:
https://godbolt.org/z/srALGm

Reply via email to