Subject: gcc assembler issues
To: None <port-pmax@netbsd.org>
From: Collin Baillie <sanac@optushome.com.au>
List: port-pmax
Date: 06/29/2002 15:03:33
Hi guys,

A couple of months ago, you may recall I wrote here about problems I am
experiencing compiling some code for a MUD. I was runnign out of virtual
memory during the compile (of a ~20,000 line file).

I fixed this by using the unlimit command in csh (bash ulimit seemed to be
useless). Then when it got to the assembling stage, it failed with lots of "
Error: Branch out of range" being printed to the console.

Anyway, I decided to check out the .s file, and see what I could find.

The first error message is:

/tmp/ccWjcZC2.s: Assembler messages:
/tmp/ccWjcZC2.s:28764: Error: Branch out of range

Ok, so I've compled with the -S (instead of -c) option. And interpret.s
works out the same. Line 28764 says this:

    j       $L3655

From my limited knowledge this is "jump" and it's jumping to some code which
is labelled as $L3655. So I do a search for this, and there are lots of
other lines which also jump there. Eventually on line 111521 (!!) I find the
label.

So it seems these jump calls are appearing before the actual label. (Also,
there's no code following the label, it just goes to another label.)

Unfortunately, before I started writing this email, I had a different .s
file (Don't ask me how?) that had the same problem (but on different lines
and using different labels) but there was code. I moved the code so it was
above the calls, and a 'make' issued a bunch of new "branch out of range"
errors.

i don't know what to do now, as there's no actual code in the $L3655 to say
to return or anything. :( I *was* going to ask if moving this code so it
appeared above the calling lines was all I needed to do, but now I'm lost. I
wonder if a newer GCC has this issue fixed. I'm running NetBSD 1.4.2 pmax on
a DECstation 5000/240 with 80MB physical RAM and 256MB swap. Generic kernel.
everything is stock standard. I've not upgraded anything.

Cheers,

Collin