Long Branches
Tom Stockfisch
tps at sdchem.UUCP
Wed Jan 21 11:12:57 AEST 1987
In article <53900001 at umn-cs.UUCP> herndon at umn-cs.UUCP (Robert Herndon) writes:
>I've had this problem a few times. Try invoking the optimizer
>on your file. The optimizer gets the assembly code before the
>assembler does, recognizes that the branch is inappropriate
>(or something, anyway) and generates an appropriate branch.
Are you sure your optimizer isn't just optimizing away enough instructions
to make the switch no longer span >64K bytes? I had the optimizer on
a vax 4.2BSD system save me this way once.
By the way, I don't think a huge switch is necessarily indicative of
a poorly structured program. The switch could be the result of preprocessor
replacement or be generated by another program such as yacc. In the program
I wrote where I ran into this trouble my longest function consisted of
40 source code lines, and all the others were less than 20. The whole
source file was ~250 lines (including copious comments), yet "cc" generated
a ".s" file of 1.2 megabytes.
|| Tom Stockfisch, UCSD Chemistry tps%chem at sdcsvax.UCSD
More information about the Comp.lang.c
mailing list