Well, it is definitely a G77 error/bug- it is using the STW syntax for the STWX instruction.
A few questions:
What does this program do? Just calculation?
1A) Try using an optimization flag, such as “-O3” (that’s the letter O). Same exact problem?
Those two STWX instructions - did they appear right after each other in the .S file, or were they separated by other instructions? EDIT: I see in your original post that there was one instruction between them, what was it?
If you replace the offending routine with a very simple one that just returns a constant, or does the absolute minimum necessary for your program to run (not necessarily run correctly), does the error go away (and does the program perform as expected)?
If you move the routine into it’s own file, and compile it like so: g77 -c separate-file.f, do you get any errors?
Damn, ran out the edit window and lost my beautiful prose.
Is it absolutely necessary that this run on this old PowerPC? What version of g77 are you using, the one that came with the 10.4 developer tools? I would not be hugely surprised if Apple did not pay close attention to checking compatibility between the versions of g77, binutils, etc. that they installed. Can you try the code on another machine (preferably an Intel?)
I have a number of Linux VMWare instances set up, that should have g77 installed. If you want to send it to me to try it out, I’d be happy to.
Aha! It works now! Well, actually, doing that revealed a new error, but one trivially easy to fix-- I typoed a subroutine name in a couple of spots. Thank you very much!
But in the interest of future generations who might find this thread, answers to the rest of your questions:
1: Yes, just number-crunching. Well, I suppose that ultimately that’s all any program does, but I assume you mean no graphics, no interfacing with device drivers, etc.
2: In context:
L532:
li r2,0
li r3,0
stwx r2,32760(r30)
la r30,4(r30)
stwx r3,32760(r30)
la r30,-4(r30)
3: I have not tried this, and probably won’t now that I’ve gotten it to work.
4: Yes, I get the same errors (though with lower line numbers, of course).
Prose question 1: Not absolutely necessary, but this is the machine sitting on my desk, and it’s more convenient to edit and compile on the same machine.
Prose question 2: I don’t recall exactly, but I think I had to download something (probably from Sourceforge) to get g77. gcc would be the default 10.4 devtools one, though.
Prose question 3: The problem does not show up on an x86 running Linux.
Again, thank you all very much! I just may graduate yet!