History

Improve ?: expansion a little

there's no need to prematurely convert the condition into registers before emitting the test.

Michael Matz committed 7 years ago

Commit 9264f061 parent 91e297a1 file · +0 −13Browse files

Unified · Split

tccgen.c+0−13
@@ -5797,19 +5797,6 @@ static void expr_cond(void) · 5796 unmodified lines
5797 } else if (c < 0) {5797 } else if (c < 0) {
5798 /* needed to avoid having different registers saved in5798 /* needed to avoid having different registers saved in
5799 each branch */5799 each branch */
5800 rc = RC_INT;
5801 if (is_float(vtop->type.t)) {
5802 rc = RC_FLOAT;
5803#ifdef TCC_TARGET_X86_64
5804 if ((vtop->type.t & VT_BTYPE) == VT_LDOUBLE) {
5805 rc = RC_ST0;
5806 }
5807#elif defined TCC_TARGET_RISCV64
5808 if ((vtop->type.t & VT_BTYPE) == VT_LDOUBLE)
5809 rc = RC_INT;
5810#endif
5811 }
5812 gv(rc);
5813 save_regs(1);5800 save_regs(1);
5814 gv_dup();5801 gv_dup();
5815 tt = gvtst(0, 0);5802 tt = gvtst(0, 0);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t