aboutsummaryrefslogtreecommitdiff
path: root/editors/awk.c
diff options
context:
space:
mode:
Diffstat (limited to 'editors/awk.c')
-rw-r--r--editors/awk.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/editors/awk.c b/editors/awk.c
index bac580497..3f8368c8f 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -389,8 +389,12 @@ static const uint16_t PRIMES[] ALIGN2 = { 251, 1021, 4093, 16381, 65521 };
389 389
390 390
391/* Globals. Split in two parts so that first one is addressed 391/* Globals. Split in two parts so that first one is addressed
392 * with (mostly short) negative offsets */ 392 * with (mostly short) negative offsets.
393 * NB: it's unsafe to put members of type "double"
394 * into globals2 (gcc may fail to align them).
395 */
393struct globals { 396struct globals {
397 double t_double;
394 chain beginseq, mainseq, endseq; 398 chain beginseq, mainseq, endseq;
395 chain *seq; 399 chain *seq;
396 node *break_ptr, *continue_ptr; 400 node *break_ptr, *continue_ptr;
@@ -439,16 +443,16 @@ struct globals2 {
439 tsplitter exec_builtin__tspl; 443 tsplitter exec_builtin__tspl;
440 444
441 /* biggest and least used members go last */ 445 /* biggest and least used members go last */
442 double t_double;
443 tsplitter fsplitter, rsplitter; 446 tsplitter fsplitter, rsplitter;
444}; 447};
445#define G1 (ptr_to_globals[-1]) 448#define G1 (ptr_to_globals[-1])
446#define G (*(struct globals2 *)ptr_to_globals) 449#define G (*(struct globals2 *)ptr_to_globals)
447/* For debug. nm --size-sort awk.o | grep -vi ' [tr] ' */ 450/* For debug. nm --size-sort awk.o | grep -vi ' [tr] ' */
448/* char G1size[sizeof(G1)]; - 0x6c */ 451/*char G1size[sizeof(G1)]; - 0x74 */
449/* char Gsize[sizeof(G)]; - 0x1cc */ 452/*char Gsize[sizeof(G)]; - 0x1c4 */
450/* Trying to keep most of members accessible with short offsets: */ 453/* Trying to keep most of members accessible with short offsets: */
451/* char Gofs_seed[offsetof(struct globals2, evaluate__seed)]; - 0x90 */ 454/*char Gofs_seed[offsetof(struct globals2, evaluate__seed)]; - 0x90 */
455#define t_double (G1.t_double )
452#define beginseq (G1.beginseq ) 456#define beginseq (G1.beginseq )
453#define mainseq (G1.mainseq ) 457#define mainseq (G1.mainseq )
454#define endseq (G1.endseq ) 458#define endseq (G1.endseq )
@@ -476,7 +480,6 @@ struct globals2 {
476#define t_info (G.t_info ) 480#define t_info (G.t_info )
477#define t_tclass (G.t_tclass ) 481#define t_tclass (G.t_tclass )
478#define t_string (G.t_string ) 482#define t_string (G.t_string )
479#define t_double (G.t_double )
480#define t_lineno (G.t_lineno ) 483#define t_lineno (G.t_lineno )
481#define t_rollback (G.t_rollback ) 484#define t_rollback (G.t_rollback )
482#define intvar (G.intvar ) 485#define intvar (G.intvar )