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

            Bug ID: 110893
           Summary: [modules] ICE Segmentation fault during GIMPLE pass
                    modref
           Product: gcc
           Version: 14.0
               URL: https://cpp2.godbolt.org/z/8q9c3P6vY
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: johelegp at gmail dot com
                CC: johelegp at gmail dot com
  Target Milestone: ---

Please, see <https://cpp2.godbolt.org/z/a73G8h4zP>.
It has the source files,
and in the output,
the compile commands along with the errors.

```
$ cat module.cpp 
module;
#include <string>
export module hello;
export auto hello() -> std::string { return "Hello";  }
$ cat main.cpp 
#include <iostream>
import hello;
auto main() -> int { std::cout << hello() << ", modules!\n";  }
```

```
[1/6] /opt/compiler-explorer/clang-16.0.0/bin/clang-scan-deps -format=p1689 --
/opt/compiler-explorer/gcc-snapshot/bin/g++   -O3 -std=c++2b -pedantic-errors
-Wall -Wextra -Wconversion -Werror=unused-result -isystem
/opt/compiler-explorer/gcc-snapshot/bin/../lib/gcc/x86_64-linux-gnu/14.0.0/include
-x c++ /app/module.cpp -c -o CMakeFiles/main.dir/module.cpp.o -MT
CMakeFiles/main.dir/module.cpp.o.ddi -MD -MF
CMakeFiles/main.dir/module.cpp.o.ddi.d > CMakeFiles/main.dir/module.cpp.o.ddi
[2/6] /opt/compiler-explorer/clang-16.0.0/bin/clang-scan-deps -format=p1689 --
/opt/compiler-explorer/gcc-snapshot/bin/g++   -O3 -std=c++2b -pedantic-errors
-Wall -Wextra -Wconversion -Werror=unused-result -isystem
/opt/compiler-explorer/gcc-snapshot/bin/../lib/gcc/x86_64-linux-gnu/14.0.0/include
-x c++ /app/main.cpp -c -o CMakeFiles/main.dir/main.cpp.o -MT
CMakeFiles/main.dir/main.cpp.o.ddi -MD -MF CMakeFiles/main.dir/main.cpp.o.ddi.d
> CMakeFiles/main.dir/main.cpp.o.ddi
[3/6] /opt/compiler-explorer/cmake-v3.26.1/bin/cmake -E cmake_ninja_dyndep
--tdi=CMakeFiles/main.dir/CXXDependInfo.json --lang=CXX --modmapfmt=gcc
--dd=CMakeFiles/main.dir/CXX.dd @CMakeFiles/main.dir/CXX.dd.rsp
[4/6] /opt/compiler-explorer/gcc-snapshot/bin/g++   -O3 -std=c++2b
-pedantic-errors -Wall -Wextra -Wconversion -Werror=unused-result -MD -MT
CMakeFiles/main.dir/module.cpp.o -MF CMakeFiles/main.dir/module.cpp.o.d
-fmodules-ts -Mno-modules
-fmodule-mapper=CMakeFiles/main.dir/module.cpp.o.modmap -x c++ -o
CMakeFiles/main.dir/module.cpp.o -c /app/module.cpp
[5/6] /opt/compiler-explorer/gcc-snapshot/bin/g++   -O3 -std=c++2b
-pedantic-errors -Wall -Wextra -Wconversion -Werror=unused-result -MD -MT
CMakeFiles/main.dir/main.cpp.o -MF CMakeFiles/main.dir/main.cpp.o.d
-fmodules-ts -Mno-modules -fmodule-mapper=CMakeFiles/main.dir/main.cpp.o.modmap
-x c++ -o CMakeFiles/main.dir/main.cpp.o -c /app/main.cpp
FAILED: CMakeFiles/main.dir/main.cpp.o 
/opt/compiler-explorer/gcc-snapshot/bin/g++   -O3 -std=c++2b -pedantic-errors
-Wall -Wextra -Wconversion -Werror=unused-result -MD -MT
CMakeFiles/main.dir/main.cpp.o -MF CMakeFiles/main.dir/main.cpp.o.d
-fmodules-ts -Mno-modules -fmodule-mapper=CMakeFiles/main.dir/main.cpp.o.modmap
-x c++ -o CMakeFiles/main.dir/main.cpp.o -c /app/main.cpp
during GIMPLE pass: modref
main.cpp: In destructor 'constexpr
std::__cxx11::basic_string<char>::_Alloc_hider::~_Alloc_hider()':
main.cpp:3:63: internal compiler error: Segmentation fault
    3 | auto main() -> int { std::cout << hello() << ", modules!\n";  }
      |                                                               ^
0x24732fe internal_error(char const*, ...)
        ???:0
0x1066600 walk_stmt_load_store_addr_ops(gimple*, void*, bool (*)(gimple*,
tree_node*, tree_node*, void*), bool (*)(gimple*, tree_node*, tree_node*,
void*), bool (*)(gimple*, tree_node*, tree_node*, void*))
        ???: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.
```

Reply via email to