Commit 4495449
committed
Localize -O0 to necessary functions
The load_regs assembly function uses its caller's frame pointer.
C/C++ compilers are allowed to make optimizations to their
representation of the stack, and frequently omit the frame pointer.
The functions _EEXIT in t_instructions.cpp and _SE3 in
u_instructions.cpp both call load_regs, and thus should be the only ones
that should be affected by deoptimization.
Even -O0 may omit the frame pointer (indeed we found this to be the case
when compiling with GCC 7.3.0), so this change also makes that requirement
explicit by by means of -fno-omit-frame-pointer.
The analogous attribute for -fno-omit-frame-pointer is not available in
clang, so the clang version of the LOAD_REGS_ATTRIBUTES is simply
[[clang:optnone]].
An added bonus of switching the -O0 flag over to an attribute in source
code is that alternate build tools are easier to port to :)
Signed-off-by: Dionna Glaze <[email protected]>1 parent abb0d35 commit 4495449
File tree
5 files changed
+14
-11
lines changed- sdk/simulation
- assembly
- tinst
- uinst
5 files changed
+14
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
43 | 52 | | |
44 | 53 | | |
45 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | 58 | | |
63 | 59 | | |
64 | 60 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| 289 | + | |
| 290 | + | |
289 | 291 | | |
290 | 292 | | |
291 | 293 | | |
| |||
323 | 325 | | |
324 | 326 | | |
325 | 327 | | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | 328 | | |
330 | 329 | | |
331 | 330 | | |
| |||
350 | 349 | | |
351 | 350 | | |
352 | 351 | | |
353 | | - | |
354 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
| 211 | + | |
| 212 | + | |
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
| |||
0 commit comments