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

-fno-omit-frame-pointer with -O2 causes an ICE in gcc 14.1.0 #20861

Closed
3 of 7 tasks
20k opened this issue May 10, 2024 · 4 comments · Fixed by #20884
Closed
3 of 7 tasks

-fno-omit-frame-pointer with -O2 causes an ICE in gcc 14.1.0 #20861

20k opened this issue May 10, 2024 · 4 comments · Fixed by #20884

Comments

@20k
Copy link
Contributor

20k commented May 10, 2024

Description / Steps to reproduce the issue

Repro is attached. Download and extract, then compile it as such from the mingw64 terminal:

gcc -std=c++23 -fext-numeric-literals -fno-omit-frame-pointer -O2 repro.cpp

This produces the following output

during RTL pass: final
./deps/imgui/imgui.cpp: In function 'void ScaleWindow(ImGuiWindow*, float)':
./deps/imgui/imgui.cpp:3775:1: internal compiler error: in seh_cfa_offset, at config/i386/winnt.cc:1
137
 3775 | }
      | ^
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See <https://github.com/msys2/MINGW-packages/issues> for instructions.

Compiling with -O1, or removing -fno-omit-frame-pointer fixes this crash. Unfortunately I was unable to get -freport-bug to work here!

repro.zip

Expected behavior

The compiler not ICEing

Actual behavior

The compiler ICEs when compiling most files

Verification

Windows Version

MINGW64_NT-10.0-19045

MINGW environments affected

  • MINGW64
  • MINGW32
  • UCRT64
  • CLANG64
  • CLANG32
  • CLANGARM64

Are you willing to submit a PR?

no idea where i'd even start

@20k 20k added the bug label May 10, 2024
@lazka
Copy link
Member

lazka commented May 10, 2024

Thanks, c-reduced to:

// gcc -c -fno-omit-frame-pointer -O2 repro.cpp
template <typename a> void b(a, a);
template <typename a> void c(a, a, float);
float d;
void e() {
  float f;
  c(f, f, d);
  b(0.0f, f);
}

@lazka
Copy link
Member

lazka commented May 10, 2024

I've filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115038

@lazka
Copy link
Member

lazka commented May 12, 2024

There is a temporary workaround now by passing -fno-fold-mem-offsets

@lazka
Copy link
Member

lazka commented May 22, 2024

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

Successfully merging a pull request may close this issue.

3 participants