Commit 3ba9663
committed
[X86] Better handling of impossibly large stack frames
If you try to create a stack frame of 4 GiB or larger with a 32-bit
stack pointer, we currently emit invalid instructions like `mov eax,
5000000000` (unless you specify `-fstack-clash-protection`, in which
case we emit a trap instead).
The trap seems nicer, so let's do that in all cases. This avoids
emitting invalid instructions, and also fixes the "can't have 32-bit
16GB stack frame" assertion in `X86FrameLowering::emitSPUpdate()`
(which used to be triggerable by user code, but is now correct).
This was originally part of llvm#124041.1 parent 2a51a0d commit 3ba9663
File tree
3 files changed
+14
-33
lines changed- llvm
- lib/Target/X86
- test/CodeGen/X86
3 files changed
+14
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
237 | 245 | | |
238 | 246 | | |
239 | 247 | | |
| |||
829 | 837 | | |
830 | 838 | | |
831 | 839 | | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
| 840 | + | |
836 | 841 | | |
837 | 842 | | |
838 | 843 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
18 | 17 | | |
19 | | - | |
20 | | - | |
| 18 | + | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
| |||
46 | 44 | | |
47 | 45 | | |
48 | 46 | | |
49 | | - | |
| 47 | + | |
50 | 48 | | |
51 | 49 | | |
52 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 33 | | |
44 | 34 | | |
45 | 35 | | |
46 | 36 | | |
47 | | - | |
48 | | - | |
| 37 | + | |
49 | 38 | | |
50 | 39 | | |
51 | 40 | | |
52 | 41 | | |
53 | 42 | | |
54 | 43 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | 44 | | |
66 | 45 | | |
67 | 46 | | |
68 | 47 | | |
69 | | - | |
70 | | - | |
| 48 | + | |
71 | 49 | | |
72 | 50 | | |
73 | 51 | | |
| |||
0 commit comments