Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!wuarchive!brutus.cs.uiuc.edu!apple!sun-barr!ccut!wnoc-tyo-news!scslwide!wsgw!wsserva!naga2!nagamatu From: nagamatu@sm.sony.co.jp (Tatsuo Nagamatu) Newsgroups: comp.sys.mips Subject: Re: mips cc bug Message-ID: Date: 29 May 90 05:51:28 GMT References: <1990May28.152151.5506@maytag.waterloo.edu> Sender: news@sm.sony.co.jp Organization: Sony Workstation Div. Lines: 43 In-reply-to: gamiddon@maytag.waterloo.edu's message of 28 May 90 15:21:51 GMT In article <1990May28.152151.5506@maytag.waterloo.edu> gamiddon@maytag.waterloo.edu (Guy Middleton) writes: >This code works everywhere except on my MIPS machine: I simplyfy the posted source code as follows: % cat a.c main () { int x; switch (x) { case ((unsigned)0x10 << 2): printf ("blah\n"); break; } } Ccom can produce the debug message of building tree structure like this: % /usr/lib/cmplrs/cc/ccom -Xb a.c In the debug message, we can see the followings. 2001031760) CAST, unsigned, 16, 14 2001031600) NAME, 0, -1, unsigned, 16, 14 2001032050) SCONV, unsigned, 0, 14 2001031670) ICON, 16, 16384, int, 0, 4 With this message, MIPS C compiler can't pre-calculation of the constant casting. SCONV for constant is not nessesary. 2001031760) CAST, unsigned, 16, 14 2001031600) NAME, 0, -1, unsigned, 16, 14 2001031670) ICON, 16, 16384, unsigned, 0, 4 ~~~~~~~~ Is this bug is included in version 2.1? -- $@%=%K!<(J($@3t(J)$@%9!<%Q!<%^%$%/%m;v6HK\It%o!<%/%9%F!<%7%g%s;v6HIt(J $@1J>>(J $@N5IW(J nagamatu@sm.sony.co.jp