jmberkley@watnext.waterloo.edu ("J. Michael Berkley") (01/09/89)
I think that I may have found a bug with gcc's optimizer. I'll keep this short (but hopefully complete) to save you some time. Mike Berkley, University of Waterloo ******************************************************* * jmberkley@watnext.uwaterloo.ca * * * * Bitnet: jmberkley@water.bitnet * * CSNet: jmberkley@watnext.waterloo.edu * * uucp: {utai,uunet}!watmath!watnext!jmberkley * ******************************************************* The bug ONLY occurs when I use the -O option. I am running version: --------------------------------------------------------------------------- [uw/server:37] gcc -v gcc version 1.30 --------------------------------------------------------------------------- This is the message from the compilation: --------------------------------------------------------------------------- cd /u/jmberkley/uw/server/ gcc -I../h -O -c uw_opt2.c gcc: Program cc1 got fatal signal 4. Compilation exited abnormally with code 1 at Sun Jan 8 22:08:20 --------------------------------------------------------------------------- The following is the output from "cc -E" (I couldn't use gcc -E). I've deleted the extra blank lines for your convenience. --------------------------------------------------------------------------- # 1 "uw_opt2.c" # 1 "/usr/include/sys/types.h" typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned int uint; typedef unsigned long u_long; typedef unsigned short ushort; typedef struct _physadr { int r[1]; } *physadr; typedef struct label_t { int val[14]; } label_t; typedef struct _quad { long val[2]; } quad; typedef long daddr_t; typedef char * caddr_t; typedef u_long ino_t; typedef u_long gno_t; typedef short cnt_t; typedef long swblk_t; typedef int size_t; typedef int time_t; typedef short dev_t; typedef int off_t; typedef long paddr_t; typedef long key_t; typedef struct fd_set { int fds_bits[1]; } fd_set; # 10 "uw_opt2.c" # 1 "../h/uw_opt.h" typedef unsigned int woptcmd_t; typedef unsigned int woption_t; typedef unsigned woptarg_t; typedef long woptbmask_t; struct woptdefn { woptbmask_t wod_pending; woptbmask_t wod_inquire; woptbmask_t wod_do; woptbmask_t wod_dont; woptbmask_t wod_askrpt; struct woptlst { woptarg_t *wol_argdefn; char *(*wol_get)(); void (*wol_set)(); void (*wol_ext)(); } wod_optlst[31 +1]; }; union optvalue { unsigned char ov_udata1; unsigned char ov_udata2; unsigned char ov_udata6; unsigned short ov_udata12; struct { unsigned short v,h; } ov_point; char ov_string[256]; }; struct netadj { short (*na_short)(); long (*na_long)(); unsigned short (*na_ushort)(); unsigned long (*na_ulong)(); }; # 12 "uw_opt2.c" int calloptscan; opt_new(wod, generic, unique) register struct woptdefn *wod, *generic, *unique; { register int n, mask; mask = (1<<(7 +1))-1; if (unique) { wod->wod_askrpt = unique->wod_askrpt & ~mask; wod->wod_pending = unique->wod_pending & ~mask; for (n=7 +1; n <= 31 ; n++) wod->wod_optlst[n] = unique->wod_optlst[n]; } else { wod->wod_askrpt = 0; wod->wod_pending = 0; for (n=7 +1; n <= 31 ; n++) wod->wod_optlst[n].wol_argdefn = (woptarg_t *)0; } if (generic) { wod->wod_askrpt |= generic->wod_askrpt & mask; wod->wod_pending |= generic->wod_pending & mask; for (n=1; n <= 7 ; n++) wod->wod_optlst[n] = generic->wod_optlst[n]; } else { for (n=1; n <= 7 ; n++) wod->wod_optlst[n].wol_argdefn = (woptarg_t *)0; } wod->wod_do = wod->wod_askrpt; wod->wod_dont = 0; wod->wod_inquire = 0; calloptscan = 1; }