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
57975797 } else if (c < 0) {
57985798 /* needed to avoid having different registers saved in
57995799 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);
58135800 save_regs(1);
58145801 gv_dup();
58155802 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