Saved 48 bytes (56 before padding) by moving a variable declaration.

gcc always generates large code for accesses to globals.  For locals
it only generates large code if there are more than 128 bytes of
locals.  It sorts scalar locals after array locals to pessimize for
space in the usual case when there are more (static) references to
scalars than to arrays.

Saved another 16 bytes (13 before padding) by adding a `continue'.

Fall-through tests normally save space, but here one of them made
gcc do space-unoptimal register allocation (it allocates ch in %bl
because preserving this register across function calls is "free",
but comparisions with %bl take one byte fewer than comparsions with
%bl).
This commit is contained in:
Bruce Evans 1996-09-07 20:18:04 +00:00
parent 88b80c81a9
commit ae6e81ef56
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18118

View file

@ -24,7 +24,7 @@
* the rights to redistribute these changes.
*
* from: Mach, [92/04/03 16:51:14 rvb]
* $Id: boot.c,v 1.55 1996/08/28 18:29:51 ache Exp $
* $Id: boot.c,v 1.57 1996/09/05 21:12:06 julian Exp $
*/
@ -65,7 +65,6 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
char *dflt_name;
#endif
char namebuf[NAMEBUF_LEN];
struct exec head;
struct bootinfo bootinfo;
int loadflags;
@ -169,6 +168,7 @@ boot(int drive)
static void
loadprog(void)
{
struct exec head;
long int startaddr;
long int addr; /* physical address.. not directly useable */
long int bootdev;
@ -331,6 +331,7 @@ getbootdev(char *ptr, int *howto)
*howto ^= RB_SERIAL;
if (*howto & RB_SERIAL)
init_serial();
continue;
}
if (c == 'g')
*howto |= RB_GDB;