Xref: utzoo unix-pc.bugs:54 comp.sys.att:4424 Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!uwvax!umn-d-ub!nic.MR.NET!shamash!nis!ems!bungia!zeno!gene From: gene@zeno.MN.ORG (Gene H. Olson) Newsgroups: unix-pc.bugs,comp.sys.att Subject: Suddenly a *Large* Binary Message-ID: <134@zeno.MN.ORG> Date: 7 Oct 88 03:20:15 GMT Organization: Smartware Consulting, Minneapolis, MN Lines: 35 While debugging, I noticed that one of my unix-pc program binaries was inappropriately *large*. It contained something like the following program: main() { int x ; x <<= 1000000 ; } This program (prog.c) is 38 bytes long, and its assembly output file (prog.s) is 259 bytes (Release 3.51). However its object file (prog.o) is 250330 bytes. The reason? One of the instructions generated by the compiler was: lsl.l &1000000,%d0 Which looks strange, but not outrageous. Problem is the 68010 can shift at most 8 bits with an immediate shift count. The assembler generates as many shift instructions as necessary to fulfil the count. There is apparently no sanity check, so in my program the assembler silently generates 125,000 left shifts by 8. Of course there is no evidence of this in the (prog.s) assembly file, and the assember cannot produce a tell-tale listing. The evidence must be found with a debugger. Gene H. Olson Smartware Consulting gene@zeno.mn.org amdahl!bungia!zeno!gene