Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I'm getting internal compiler errors and -freport-bug does not work! #23403

Open
2 of 6 tasks
FlightControl-User opened this issue Feb 15, 2025 · 5 comments
Open
2 of 6 tasks

Comments

@FlightControl-User
Copy link

FlightControl-User commented Feb 15, 2025

Description / Steps to reproduce the issue

PS C:\msys64\ucrt64\bin> ./g++ --version
g++.exe (Rev2, Built by MSYS2 project) 14.2.0

Compile a source code using G++ with -freport-bug enabled in the C++23 standard mode.
When the compilation fails with an internal error (which is the case in my compilation), it should normally produce a full compilation error report that could be attached in a message like the one i'm writing now.

Unfortunately, such is not the case. The file is not created due to an error!

Note; the reason of the internal error is probably due to an other unidentified reason, but this is NOT what this report is about!
Please consider investigating how to fix the report production in case the compilation ends in an internal error.
I cannot find a simple case to end the compilation ending in an internal compiler error. Maybe the team has test cases to regression test such scenario and can quickly find the reason.

Expected behavior

A report file should be created with C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/cc1plus.exe.

Actual behavior

This is what I get:

[8/45] Generating CXX dyndep file CMakeFiles/KickC.dir/CXX.dd
[9/14] Building CXX object CMakeFiles/KickC.dir/src/main/kickc/parse/CParser.ixx.obj
FAILED: CMakeFiles/KickC.dir/src/main/kickc/parse/CParser.ixx.obj CMakeFiles/KickC.dir/CParser.gcm
C:\msys64\ucrt64\bin\g++.exe -DANTLR4CPP_STATIC -IC:/Users/svenv/CLionProjects/KickC/antlr4_runtime/src/antlr4_runtime/runtime/Cpp/runtime/src -IC:/Users/svenv/CLionProjects/KickC -IC:/Users/svenv/CLionProjects/KickC/libs -IC:/Users/svenv/CLionProjects/KickC/src/main/include -IC:/Users/svenv/CLionProjects/KickC/src/main/kickc -IC:/Users/svenv/CLionProjects/KickC/src/main/modules -IC:/Users/svenv/CLionProjects/KickC/cmake-build-debug-mingw-msys2/antlr4cpp_generated_src/KickCLexer -IC:/Users/svenv/CLionProjects/KickC/cmake-build-debug-mingw-msys2/antlr4cpp_generated_src/KickCParser -isystem C:/Users/svenv/CLionProjects/KickC/cmake-build-debug-mingw-msys2/antlr4_runtime/src/antlr4_runtime/runtime/Cpp/runtime/src -Mmodules -freport-bug -g -std=gnu++23 -fdiagnostics-color=always -MD -MT CMakeFiles/KickC.dir/src/main/kickc/parse/CParser.ixx.obj -MF CMakeFiles\KickC.dir\src\main\kickc\parse\CParser.ixx.obj.d -fmodules-ts -fmodule-mapper=CMakeFiles\KickC.dir\src\main\kickc\parse\CParser.ixx.obj.modmap -MD -fdeps-format=p1689r5 -x c++ -o CMakeFiles/KickC.dir/src/main/kickc/parse/CParser.ixx.obj -c C:/Users/svenv/CLionProjects/KickC/src/main/kickc/parse/CParser.ixx
In module imported at C:/Users/svenv/CLionProjects/KickC/src/main/kickc/cpu/Cpu65xx.ixx:14:1,
of module Cpu65xx, imported at C:/Users/svenv/CLionProjects/KickC/src/main/kickc/cpu/CpuHuc6280.h:10,
included from C:/Users/svenv/CLionProjects/KickC/src/main/kickc/model/TargetCpu.h:21,
from C:/Users/svenv/CLionProjects/KickC/src/main/kickc/model/TargetPlatform.h:13,
from C:/Users/svenv/CLionProjects/KickC/src/main/kickc/model/Program.h:12,
from C:/Users/svenv/CLionProjects/KickC/src/main/kickc/parse/CParser.ixx:13:
CpuAddressingMode: note: unable to represent further imported source locations
C:/Users/svenv/CLionProjects/KickC/src/main/kickc/parse/CParser.ixx:21:8: internal compiler error: in write_location, at cp/module.cc:16271
21 | export module CParser;
| ^
Please submit a full bug report, with preprocessed source.
See https://github.com/msys2/MINGW-packages/issues for instructions.
g++.exe: fatal error: cannot execute 'C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/cc1plus.exe': open temporary output file: No such file or directory
compilation terminated.
ninja: build stopped: subcommand failed.

Verification

Windows Version

MSYS_NT-10.0-26100

MINGW environments affected

  • MINGW64
  • MINGW32
  • UCRT64
  • CLANG64
  • CLANGARM64

Are you willing to submit a PR?

YES!

@Biswa96
Copy link
Member

Biswa96 commented Feb 15, 2025

I am not sure if we can do anything about this internal compiler error. You could report it in gcc bugzilla or try to use clang instead.

@Biswa96 Biswa96 added the GCC label Feb 15, 2025
@FlightControl-User
Copy link
Author

There is a fix for this documented somewhere in the issues related to this one.
It's not the internal compiler error that is the issue i'm reporting. It's the behaviour of -freport-bug flag that is not correctly working! Let me try to find that fix ...

@FlightControl-User
Copy link
Author

Found it: #20894 (comment)

@FlightControl-User
Copy link
Author

Is there a guide here how to contribute and go for a fix?

@Biswa96
Copy link
Member

Biswa96 commented Feb 15, 2025

The patch should be discussed in upstream gcc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants