Commit graph

14 commits

Author SHA1 Message Date
George Koehler 17bc9cdef7 More void, fewer clang warnings in util/ego
Most warnings are for functions implicitly returning int.  Change most
of these functions to return void.  (Traditional K&R C had no void
type, but C89 has it.)

Add prototypes to most function declarations in headers.  This is
easy, because ego declares most of its extern functions, and the
comments listed most parameters.  There were a few outdated or missing
declarations, and a few .c files that failed to include an .h with the
declarations.

Add prototypes to a few function definitions in .c files.  Most
functions still have traditional K&R definitions.  Most STATIC
functions still don't have prototypes, because they have no earlier
declaration where I would have added the prototype.

Change some prototypes in util/ego/share/alloc.h.  Functions newmap()
and oldmap() handle an array of pointers to something; change the
array's type from `short **` to `void **`.  Callers use casts to go
between `void **` and the correct type, like `line_p *`.  Function
oldtable() takes a `short *`, not a `short **`; I added the wrong type
in 5bbbaf4.

Make a few other changes to silence warnings.  There are a few places
where clang wants extra parentheses in the code.

Edit util/ego/ra/build.lua to add the missing dependency on ra*.h; I
needed this to prevent crashes from ra.
2019-11-01 15:27:16 -04:00
George Koehler a20b87ca01 In ego, put both words and double-words in reg_float.
The size of a reg_float isn't in the descr file, so ego doesn't know.
PowerPC and SPARC are the only arches with floating-point registers in
their descr files.  PowerPC and SPARC registers can hold both 4-byte
and 8-byte floats, so I want ego to do both sizes.

This might break our SPARC code expander because ego doesn't know that
8-byte values take 2 registers in SPARC.  (So ego might allocate too
many registers and deallocate too much stack space.)  We don't build
the SPARC code expander, and its descr file is already wrong: its list
of register save costs is too short, so ego will read past the end of
the array.

This commit doesn't fix the problem with ego and PowerPC ncg.  Right
now, ncg refuses to put 4-byte floats in registers, but ego expects
them to get registers and deallocates their stack space.  So ncg emits
programs that use the deallocated space, and the values of 4-byte
floats become corrupt.
2017-02-16 19:55:52 -05:00
ceriel 5c83e7dbb5 Header --> Id 1994-06-24 11:31:16 +00:00
ceriel af5ad235c9 Small change in register allocation criteria 1992-09-01 11:13:42 +00:00
ceriel 27d53b0d33 Changed #include's 1991-03-05 12:44:05 +00:00
ceriel 335377da7a changed lint flags, use ms_ego, changed allocation strategy for loops 1990-12-18 11:14:34 +00:00
ceriel eb50492a1f #ifdeffed strange test 1990-08-01 14:34:53 +00:00
ceriel 23f2646704 use general as pointer flag added 1989-03-07 10:24:32 +00:00
ceriel 4fd846804a Seemed to prefer reg_any registers, which caused addresses of procedures
to end up in data registers on the m68020. This is temporarily fixed,
but actually, the descriptor files could be somewhat more general.
1987-04-03 15:38:52 +00:00
ceriel 6eaf182cee Added Rcs Id 1987-03-10 11:49:39 +00:00
ceriel 815166e421 Added copyright notice 1987-03-09 19:15:41 +00:00
ceriel 17ddf81681 replaced some %D's 1987-02-09 17:28:22 +00:00
bal 8db2c12881 regsave_cost() returns void instead of short. 1984-12-04 13:03:49 +00:00
bal 1833451151 Initial revision 1984-11-26 14:35:32 +00:00