Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions llvm/test/CodeGen/X86/large-displacements.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

define i32 @main() #0 {
; ERR-i686: error: <unknown>:0:0: 64-bit offset calculated but target is 32-bit
; ERR-i686: warning: <unknown>:0:0: stack frame size (4294967324) exceeds limit (4294967295) in function 'main'
;
; x86_64-LABEL: main:
; x86_64: # %bb.0: # %entry
Expand Down Expand Up @@ -44,6 +45,7 @@ entry:
; Same test as above but for an anonymous function.
define i32 @0() #0 {
; ERR-i686: error: <unknown>:0:0: 64-bit offset calculated but target is 32-bit
; ERR-i686: warning: <unknown>:0:0: stack frame size (4294967324) exceeds limit (4294967295) in function '@0'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this emitting both an error and a warning

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The warning was always there and was probably missed by @wesleywiser? It is coming from llvm/lib/CodeGen/PrologEpilogInserter.cpp:L315

https://godbolt.org/z/G4W48jcb6

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please can you confirm that this works with builds with EXPENSIVE_CHECKS enabled and disabled

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked with a debug build and EXPENSIVE_CHECKS on and it was still failing with a fatal_error in MachineVerifier. I've used --verify-machineinstrs=0 to fix this for now, but probably we need to check the return code in PEIImpl::replaceFrameIndices to stop codegen after the error?

      // If this instruction has a FrameIndex operand, we need to
      // use that target machine register info object to eliminate
      // it.
      TRI.eliminateFrameIndex(MI, SPAdj, i, RS);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry but it looks like we need to revert #123872 and address the problem properly (and when we recommit the tests will need -verify-machineinstr set)

;
; x86_64-LABEL: __unnamed_1:
; x86_64: # %bb.0: # %entry
Expand Down