Long Branches

Raman Renu ram at nucsrl.UUCP
Mon Jan 19 19:16:58 AEST 1987


   I have a problem in using the C compiler and VAX assembler in our local
4.3BSD(VAX) site.  I have a program which has a huge(>900lines) switch
statement.

       /*   Whoever said that programmers(pro) don't use case/switch */

The assembler chokes on (>32K long) long branches.  Apparently
there is a flag "-J" for such purposes (in the assembler)
which does not seem to work.

The man page for "as" lists under Bugs
---------------
BUGS
     -J should be eliminated; the assembler should automatically
     choose among byte, word and long branches.
_______________

That does not seem to work either.

The ouput of the C compiler was 
___________________________
Assembler:
"/tmp/ctm088343", line 2565: brw: Branch too far(50148b): try -J flag
"/tmp/ctm088343", line 2823: brw: Branch too far(48806b): try -J flag
"/tmp/ctm088343", line 2922: brw: Branch too far(48313b): try -J flag
"/tmp/ctm088343", line 12658: Case will branch too far
"/tmp/ctm088343", line 12659: Case will branch too far
"/tmp/ctm088343", line 12664: Case will branch too far
__________________________

and the ouput of a seperate assembly had the same error message(predictably). 

Assembler:
"prolog.s", line 13337: Case will branch too far
"prolog.s", line 13338: Case will branch too far
"prolog.s", line 13339: Case will branch too far
"prolog.s", line 13340: Case will branch too far


         This piece of code did compile in a Gould machine but not on the 
Vax (Code is portable).  Could somebody explain and help me solve this 
problem.



                                             Renu Raman
                                           ...ihnp4!nucsrl!ram
                                          Northwestern Univ. Comp. Sci. Lab.
                                          Evanston  IL  60201



More information about the Comp.lang.c mailing list