scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 1220f2d67439a31cff760ae7d97818a8f84fec87
parent 020554b30192131ab687d5bfb6b89b3518173085
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri, 13 Mar 2015 09:39:33 +0000

Improve optcasts

Copy type only when it is needed, not always (for example when
they are the same)

Diffstat:
cc2/optm.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cc2/optm.c b/cc2/optm.c @@ -27,7 +27,9 @@ repeat: tp = &np->type; break; default: - np->type = *tp; + if (np->type.size > tp->size) + np->type = *tp; + break; } np->left = optcasts(np->left, tp);