Path: utzoo!utgpu!watmath!att!chinet!pdg From: pdg@chinet.chi.il.us (Paul Guthrie) Newsgroups: comp.lang.c Subject: long conversion of short expression. Message-ID: <9092@chinet.chi.il.us> Date: 27 Jul 89 22:41:34 GMT Reply-To: pdg@chinet.chi.il.us (Paul Guthrie) Organization: The League of Crafty Hackers Lines: 27 Here is a case where 68000 compilers don't seem to agree. In the following code segment, the two shorts multiplied together exceed the size of a short, but the question is, is the result of the multiplication really a short to be converted to a long, or a long already? main() { short x=0x18,y=0x588; long z=0x100000; printf("%lx\n",z+(x*y)); } Should the compiler generate move -2(fp),d0 muls -4(fp),d0 extl d0 addl -8(fp),d0 or should the extl instruction be left out? muls has already generated a long result. Both the Sun and GNU compilers do not use the extl, but I have seen other compilers that would. -- Paul Guthrie chinet!nsacray!paul