Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!mips!daver!bungi.com!news From: ian@sibyl.eleceng.ua.oz.au Newsgroups: comp.sys.nsc.32k Subject: Re: strtol.c Message-ID: <9103221637.24185@munnari.oz.au> Date: 21 Mar 91 20:23:47 GMT References: <<9103191744.AA06048@hplwbc.hpl.hp.com>> Sender: news@daver.bungi.com Lines: 27 Approved: news@daver.bungi.com Bruce Culbertson writes: > >Has anyone found away to compile /usr/src/lib/ansi/strtol.c ?? > >ie.: > > as: line 124, value too large for displacement > > > > GCC has a predicate which answers the question: can a given expression > be calculated using an some addressing mode of the CPU? When the > answer is yes, GCC emits a single instruction; when it is no, GCC > emits instructions to simplify the expression and then calls the > predicate again. Actually, this is not the problem (it was where I looked first though). As far as I can tell, this predicate works fine. The problem is in the code for the add3si (?) pseudo instruction. I have supplied a patch to fix it and it ended up in the 1.38 distribution. Unfortunately, I had the idea right but had a case of brain fade when I actually typed it in. Basically, the ns32k can't do 3 operand addition in a single instruction except by using the addr instruction in which case one of the arguments has to be representable as a displacement and must be in the range [-2^29, 2^29 - 1], if not it should use two instructions. (Which it didn't do). The brain fade was to check for the wrong range [-2^30, 2^30 - 1]. I told RMS about my mistake and it may have been fixed for version 1.39 (which I haven't had time to examine). Ian