From b6f456abe8bee38541a9809f9a2ae3cca301b133 Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Fri, 9 Jan 1987 23:20:40 -0800 Subject: [PATCH] leave SCONV nodes in unless they don't change object's size SCCS-vsn: old/pcc/ccom.tahoe/local.c 1.5 --- usr/src/old/pcc/ccom.tahoe/local.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/usr/src/old/pcc/ccom.tahoe/local.c b/usr/src/old/pcc/ccom.tahoe/local.c index 03e7203914..41d1bbbe28 100644 --- a/usr/src/old/pcc/ccom.tahoe/local.c +++ b/usr/src/old/pcc/ccom.tahoe/local.c @@ -1,5 +1,5 @@ #ifndef lint -static char sccsid[] = "@(#)local.c 1.4 (Berkeley) %G%"; +static char sccsid[] = "@(#)local.c 1.5 (Berkeley) %G%"; #endif # include "pass1.h" @@ -117,7 +117,7 @@ clocal(p) register NODE *p; { } /* now, look for conversions downwards */ - if( p->in.left->in.op == ICON ){ /* simulate the conversion here */ + if( p->in.left->in.op == ICON ){ /* simulate the conversion here */ CONSZ val; val = p->in.left->tn.lval; switch( m ){ @@ -141,22 +141,14 @@ clocal(p) register NODE *p; { break; } p->in.left->in.type = m; - } - else { - /* meaningful ones are conversion of int to char, int to short, - and short to char, and unsigned versions thereof */ - if( m==CHAR || m==UCHAR ){ - if( ml!=CHAR && ml!= UCHAR ) break; - } - else if( m==SHORT || m==USHORT ){ - if( ml!=CHAR && ml!=UCHAR && ml!=SHORT && ml!=USHORT ) break; - } - } - + } else if (tlen(p) == tlen(p->in.left)) + goto inherit; + else + break; /* clobber conversion */ - if( tlen(p) == tlen(p->in.left) ) goto inherit; p->in.op = FREE; return( p->in.left ); /* conversion gets clobbered */ + break; case QUEST: /* the right side should be COLON */ if((r = p->in.right)->in.op == SCONV) { -- 2.20.1