mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-25 13:11:00 +00:00
[qfcc] Force @return to be live
The change to not split basic blocks on function calls resulted in the @return def not being live and thus getting dropped when optimizing. Marking the def as not local forces flow and dags to treat it as global and thus forced it to be live.
This commit is contained in:
parent
e7930305cc
commit
4daa84ed2a
1 changed files with 5 additions and 1 deletions
|
@ -1505,7 +1505,11 @@ statement_return (sblock_t *sblock, const expr_t *e)
|
|||
// FIXME hard-coded reg, and assumes 3 is free
|
||||
#define REG 3
|
||||
const expr_t *with = new_with_expr (11, REG, new_short_expr (0));
|
||||
def_t *ret_ptr = new_def (0, 0, 0, sc_local);
|
||||
def_t *ret_ptr = new_def ("@return", 0, 0, sc_local);
|
||||
// @return is neither global nor local, but making it not
|
||||
// local causes flow (and dags) to treat it as global and thus
|
||||
// it is live.
|
||||
ret_ptr->local = 0;
|
||||
operand_t *ret_op = def_operand (ret_ptr, &type_void, e);
|
||||
ret_ptr->reg = REG;
|
||||
sblock = statement_single (sblock, with);
|
||||
|
|
Loading…
Reference in a new issue