mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-19 05:30:07 +08:00
Optimize arithmetic with pointer to value on stack + constant
This commit is contained in:
parent
e263ee3cbf
commit
5a92536cea
5
tcc.c
5
tcc.c
@ -5596,8 +5596,9 @@ void gen_opic(int op)
|
|||||||
}
|
}
|
||||||
goto general_case;
|
goto general_case;
|
||||||
} else if (c2 && (op == '+' || op == '-') &&
|
} else if (c2 && (op == '+' || op == '-') &&
|
||||||
(vtop[-1].r & (VT_VALMASK | VT_LVAL | VT_SYM)) ==
|
((vtop[-1].r & (VT_VALMASK | VT_LVAL | VT_SYM)) ==
|
||||||
(VT_CONST | VT_SYM)) {
|
(VT_CONST | VT_SYM) ||
|
||||||
|
(vtop[-1].r & (VT_VALMASK | VT_LVAL)) == VT_LOCAL)) {
|
||||||
/* symbol + constant case */
|
/* symbol + constant case */
|
||||||
if (op == '-')
|
if (op == '-')
|
||||||
l2 = -l2;
|
l2 = -l2;
|
||||||
|
Loading…
Reference in New Issue
Block a user