Open iamanonymouscs opened 1 month ago
@llvm/issue-subscribers-backend-x86
Author: Anonymous (iamanonymouscs)
(shorter example that triggers the same error, for easier experimentation: https://godbolt.org/z/e75GP9Ezo)
This seems to be semi-intentional, X86TargetLowering::getRegisterByName
simply throws this error if it encounters a frame pointer register variable in a function without a frame pointer. Also note that this only happens on -O1
, not -O0
, presumably because every function gets a frame pointer on -O0
. I suppose the options for fixing this are:
-O0
, because the FP register is reserved by the compiler, but allowing it on -O1
, because there, it's not. Personally, I think this is the most sensible option: I don't really see a use-case for allowing the user to use that register, if its already in use by the compiler.This is the same as #62984 and #26474.
Personally, I think this is the most sensible option: I don't really see a use-case for allowing the user to use that register, if its already in use by the compiler.
@J-MR-T Sometimes users indeed want to use rbp
as it is a known frame pointer (embedded, some JIT tricks or custom unwinding etc.). I think we can't change such behavior easily.
Ah thanks for pointing out this is a duplicate. If using rbp to manipulate the frame pointer manually is a supported use-case, maybe my 2nd suggestion would make sense then. Or again an actual error message that recommends setting -fno-omit-frame-pointer
.
Description:
I encountered an internal compiler error (ICE) while compiling a C code snippet using Clang version 19.0.0 on Ubuntu Linux. Below are the details of the environment, code, and command lines used: Also ICE on trunk, compiler explorer:https:https://godbolt.org/z/rjba9xznv
OS and Platform:
Program:
Command Lines: