c/4611: Internal compiler error in change_address, at emit-rtl.c:1635 (Solaris 2.5.1)

Lyall.Pearce@EDS.com Lyall.Pearce@EDS.com
Thu Oct 18 16:06:00 GMT 2001


>Number:         4611
>Category:       c
>Synopsis:       Internal compiler error in change_address, at emit-rtl.c:1635 (Solaris 2.5.1)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 18 16:06:02 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Lyall.Pearce@EDS.com
>Release:        3.0.1
>Organization:
>Environment:
SunOS dev00011 5.5.1 Generic_103640-32 sun4u sparc SUNW,Ultra-4
>Description:
AnalyseStats.c:314: Internal compiler error in change_address, at emit-rtl.c:1635


> gcc --version
3.0.1
> uname -a
SunOS dev00011 5.5.1 Generic_103640-32 sun4u sparc SUNW,Ultra-4
> gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/specs
Configured with: ../gcc-3.0.1/configure  : (reconfigured) ../gcc-3.0.1/configure 
Thread model: posix
gcc version 3.0.1

>How-To-Repeat:
> gcc -O2 -c -o AnalyseStats.o AnalyseStats.c -save-temps
>Fix:
Take out the -O2 parameter and the program will compile.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="AnalyseStats.i"
Content-Disposition: inline; filename="AnalyseStats.i"

# 13 "AnalyseStats.c"
# 1 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/stdio.h" 1 3
# 14 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/stdio.h" 3
# 1 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/stdarg.h" 1 3
# 43 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/stdarg.h" 3
typedef __builtin_va_list __gnuc_va_list;
# 15 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/stdio.h" 2 3
# 29 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/stdio.h" 3
#pragma ident "@(#)stdio.h	1.39	95/12/04 SMI"

# 1 "/usr/include/sys/feature_tests.h" 1 3
# 11 "/usr/include/sys/feature_tests.h" 3
#pragma ident "@(#)feature_tests.h	1.7	94/12/06 SMI"
# 32 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/stdio.h" 2 3
# 1 "/usr/include/sys/va_list.h" 1 3
# 9 "/usr/include/sys/va_list.h" 3
#pragma ident "@(#)va_list.h	1.6	96/01/26 SMI"
# 44 "/usr/include/sys/va_list.h" 3
typedef void *__va_list;
# 33 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/stdio.h" 2 3







typedef unsigned int size_t;


typedef long fpos_t;
# 142 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/stdio.h" 3
typedef struct
{




        int _cnt;
        unsigned char *_ptr;

        unsigned char *_base;
        unsigned char _flag;
        unsigned char _file;
} FILE;


extern FILE __iob[20];



extern FILE *_lastbuf;
extern unsigned char *_bufendtab[];

extern unsigned char _sibuf[], _sobuf[];




extern int remove(const char *);
extern int rename(const char *, const char *);
extern FILE *tmpfile(void);
extern char *tmpnam(char *);



extern int fclose(FILE *);
extern int fflush(FILE *);
extern FILE *fopen(const char *, const char *);
extern FILE *freopen(const char *, const char *, FILE *);
extern void setbuf(FILE *, char *);
extern int setvbuf(FILE *, char *, int, size_t);

extern int fprintf(FILE *, const char *, ...);

extern int fscanf(FILE *, const char *, ...);

extern int printf(const char *, ...);

extern int scanf(const char *, ...);

extern int sprintf(char *, const char *, ...);

extern int sscanf(const char *, const char *, ...);
extern int vfprintf(FILE *, const char *, __gnuc_va_list);
extern int vprintf(const char *, __gnuc_va_list);
extern int vsprintf(char *, const char *, __gnuc_va_list);
extern int fgetc(FILE *);
extern char *fgets(char *, int, FILE *);
extern int fputc(int, FILE *);
extern int fputs(const char *, FILE *);
extern int getc(FILE *);
extern int getchar(void);
extern char *gets(char *);
extern int putc(int, FILE *);
extern int putchar(int);
extern int puts(const char *);
extern int ungetc(int, FILE *);
extern size_t fread(void *, size_t, size_t, FILE *);
extern size_t fwrite(const void *, size_t, size_t, FILE *);
extern int fgetpos(FILE *, fpos_t *);
extern int fseek(FILE *, long, int);
extern int fsetpos(FILE *, const fpos_t *);
extern long ftell(FILE *);
extern void rewind(FILE *);
extern void clearerr(FILE *);
extern int feof(FILE *);
extern int ferror(FILE *);
extern void perror(const char *);

extern int __filbuf(FILE *);
extern int __flsbuf(int, FILE *);







extern FILE *fdopen(int, const char *);
extern char *ctermid(char *);
extern int fileno(FILE *);
# 255 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/stdio.h" 3
extern FILE *popen(const char *, const char *);
extern char *cuserid(char *);
extern char *tempnam(const char *, const char *);
extern int getopt(int, char *const *, const char *);

extern int getsubopt(char **, char *const *, char **);

extern char *optarg;
extern int optind, opterr, optopt;
extern int getw(FILE *);
extern int putw(int, FILE *);
extern int pclose(FILE *);
# 14 "AnalyseStats.c" 2
# 1 "/usr/include/time.h" 1 3
# 14 "/usr/include/time.h" 3
#pragma ident "@(#)time.h	1.23	95/08/28 SMI"

# 1 "/usr/include/sys/feature_tests.h" 1 3
# 17 "/usr/include/time.h" 2 3
# 32 "/usr/include/time.h" 3
typedef long clock_t;



typedef long time_t;



typedef int clockid_t;



typedef int timer_t;




struct tm {
        int tm_sec;
        int tm_min;
        int tm_hour;
        int tm_mday;
        int tm_mon;
        int tm_year;
        int tm_wday;
        int tm_yday;
        int tm_isdst;
};



extern clock_t clock(void);
extern double difftime(time_t, time_t);
extern time_t mktime(struct tm *);
extern time_t time(time_t *);
extern char *asctime(const struct tm *);
extern char *ctime(const time_t *);
extern struct tm *gmtime(const time_t *);
extern struct tm *localtime(const time_t *);
extern size_t strftime(char *, size_t, const char *, const struct tm *);
# 82 "/usr/include/time.h" 3
extern char *strptime(const char *, const char *, struct tm *);






# 1 "/usr/include/sys/time.h" 1 3
# 22 "/usr/include/sys/time.h" 3
#pragma ident "@(#)time.h	2.47	95/08/24 SMI"

# 1 "/usr/include/sys/feature_tests.h" 1 3
# 25 "/usr/include/sys/time.h" 2 3
# 39 "/usr/include/sys/time.h" 3
struct timeval {
        long tv_sec;
        long tv_usec;
};

struct timezone {
        int tz_minuteswest;
        int tz_dsttime;
};
# 61 "/usr/include/sys/time.h" 3
# 1 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/types.h" 1 3
# 20 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/types.h" 3
#pragma ident "@(#)types.h	1.38	95/11/14 SMI"

# 1 "/usr/include/sys/feature_tests.h" 1 3
# 23 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/types.h" 2 3
# 1 "/usr/include/sys/isa_defs.h" 1 3







#pragma ident "@(#)isa_defs.h	1.7	94/10/26 SMI"
# 24 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/types.h" 2 3




# 1 "/usr/include/sys/machtypes.h" 1 3
# 11 "/usr/include/sys/machtypes.h" 3
#pragma ident "@(#)machtypes.h	1.9	94/11/05 SMI"

# 1 "/usr/include/sys/feature_tests.h" 1 3
# 14 "/usr/include/sys/machtypes.h" 2 3
# 28 "/usr/include/sys/machtypes.h" 3
typedef struct _physadr_t { int r[1]; } *physadr_t;

typedef struct _label_t { int val[2]; } label_t;



typedef unsigned char lock_t;
# 29 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/types.h" 2 3







typedef unsigned char uchar_t;
typedef unsigned short ushort_t;
typedef unsigned int uint_t;
typedef unsigned long ulong_t;

typedef char * caddr_t;
typedef long daddr_t;
typedef long off_t;
typedef short cnt_t;

typedef ulong_t paddr_t;
typedef uchar_t use_t;
typedef short sysid_t;
typedef short index_t;




typedef enum { B_FALSE, B_TRUE } boolean_t;
# 63 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/types.h" 3
typedef long long longlong_t;
typedef unsigned long long u_longlong_t;
# 80 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/types.h" 3
typedef longlong_t offset_t;
typedef longlong_t diskaddr_t;
# 100 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/types.h" 3
typedef union {
        offset_t _f;
        struct {
                long _u;
                off_t _l;
        } _p;
} lloff_t;
# 120 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/types.h" 3
typedef union {
        diskaddr_t _f;
        struct {
                long _u;
                daddr_t _l;
        } _p;
} lldaddr_t;


typedef ulong_t k_fltset_t;
# 139 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/types.h" 3
typedef long id_t;
# 148 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/types.h" 3
typedef ulong_t major_t;
typedef ulong_t minor_t;




typedef short pri_t;
# 167 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/types.h" 3
typedef ushort_t o_mode_t;
typedef short o_dev_t;
typedef ushort_t o_uid_t;
typedef o_uid_t o_gid_t;
typedef short o_nlink_t;
typedef short o_pid_t;
typedef ushort_t o_ino_t;




typedef int key_t;
typedef ulong_t mode_t;



typedef long uid_t;


typedef uid_t gid_t;
typedef ulong_t nlink_t;
typedef ulong_t dev_t;
typedef ulong_t ino_t;
typedef long pid_t;
# 203 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/types.h" 3
typedef int ssize_t;
# 230 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/types.h" 3
typedef unsigned char unchar;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;
# 270 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/types.h" 3
typedef long hostid_t;
# 280 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/types.h" 3
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
typedef struct _quad { long val[2]; } quad;






# 1 "/usr/include/sys/select.h" 1 3
# 11 "/usr/include/sys/select.h" 3
#pragma ident "@(#)select.h	1.10	92/07/14 SMI"


# 1 "/usr/include/sys/time.h" 1 3
# 15 "/usr/include/sys/select.h" 2 3
# 35 "/usr/include/sys/select.h" 3
typedef long fd_mask;





typedef struct fd_set {
        fd_mask fds_bits[(((1024)+(((sizeof (fd_mask) * 8))-1))/((sizeof (fd_mask) * 8)))];
} fd_set;
# 62 "/usr/include/sys/select.h" 3
extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
# 292 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/types.h" 2 3
# 62 "/usr/include/sys/time.h" 2 3
# 108 "/usr/include/sys/time.h" 3
struct itimerval {
        struct timeval it_interval;
        struct timeval it_value;
};
# 157 "/usr/include/sys/time.h" 3
typedef struct timespec {
        time_t tv_sec;
        long tv_nsec;
} timespec_t;

typedef struct timespec timestruc_t;
# 189 "/usr/include/sys/time.h" 3
typedef struct itimerspec {
        struct timespec it_interval;
        struct timespec it_value;
} itimerspec_t;





typedef longlong_t hrtime_t;
# 241 "/usr/include/sys/time.h" 3
int adjtime(struct timeval *, struct timeval *);
int getitimer(int, struct itimerval *);
int setitimer(int, const struct itimerval *, struct itimerval *);
# 263 "/usr/include/sys/time.h" 3
int gettimeofday(struct timeval *, void *);
int settimeofday(struct timeval *, void *);


hrtime_t gethrtime(void);
hrtime_t gethrvtime(void);
# 280 "/usr/include/sys/time.h" 3
# 1 "/usr/include/time.h" 1 3
# 281 "/usr/include/sys/time.h" 2 3
# 90 "/usr/include/time.h" 2 3
# 1 "/usr/include/sys/siginfo.h" 1 3
# 14 "/usr/include/sys/siginfo.h" 3
#pragma ident "@(#)siginfo.h	1.36	95/08/24 SMI"

# 1 "/usr/include/sys/feature_tests.h" 1 3
# 17 "/usr/include/sys/siginfo.h" 2 3







union sigval {
        int sival_int;
        void *sival_ptr;
};

struct sigevent {
        int sigev_notify;
        union {
                int _sigev_signo;
                void (*_sigev_notify_function)(union sigval);
        } _sigev_un;
        union sigval sigev_value;
        int _sigev_pad1;
        void *_sigev_notify_attributes;
        int _sigev_pad2;
};
# 71 "/usr/include/sys/siginfo.h" 3
# 1 "/usr/include/sys/machsig.h" 1 3
# 11 "/usr/include/sys/machsig.h" 3
#pragma ident "@(#)machsig.h	1.10	94/11/05 SMI"


# 1 "/usr/include/sys/feature_tests.h" 1 3
# 15 "/usr/include/sys/machsig.h" 2 3
# 72 "/usr/include/sys/siginfo.h" 2 3
# 124 "/usr/include/sys/siginfo.h" 3
# 1 "/usr/include/sys/time.h" 1 3
# 125 "/usr/include/sys/siginfo.h" 2 3

typedef struct


        siginfo

                        {

        int si_signo;
        int si_code;
        int si_errno;

        union {

                int _pad[((128 / sizeof (int)) - 3)];

                struct {
                        pid_t _pid;
                        union {
                                struct {
                                        uid_t _uid;
                                        union sigval _value;
                                } _kill;
                                struct {
                                        clock_t _utime;
                                        int _status;
                                        clock_t _stime;
                                } _cld;
                        } _pdata;
                } _proc;

                struct {
                        caddr_t _addr;
                        int _trapno;
                } _fault;

                struct {

                        int _fd;
                        long _band;
                } _file;

                struct {
                        caddr_t _faddr;
                        timestruc_t _tstamp;
                        short _syscall;
                        char _nsysarg;
                        char _fault;
                        long _sysarg[8];
                        long _mstate[17];
                } _prof;

        } _data;

} siginfo_t;
# 188 "/usr/include/sys/siginfo.h" 3
typedef struct k_siginfo {

        int si_signo;
        int si_code;
        int si_errno;

        union {
                struct {
                        pid_t _pid;
                        union {
                                struct {
                                        uid_t _uid;
                                        union sigval _value;
                                } _kill;
                                struct {
                                        clock_t _utime;
                                        int _status;
                                        clock_t _stime;
                                } _cld;
                        } _pdata;
                } _proc;

                struct {
                        caddr_t _addr;
                        int _trapno;
                } _fault;

                struct {

                        int _fd;
                        long _band;
                } _file;

                struct {
                        caddr_t _faddr;
                        timestruc_t _tstamp;
                        short _syscall;
                        char _nsysarg;
                        char _fault;



                } _prof;

        } _data;

} k_siginfo_t;

typedef struct sigqueue {
        struct sigqueue *sq_next;
        k_siginfo_t sq_info;
        void (*sq_func)(struct sigqueue *);
        void *sq_backptr;

} sigqueue_t;
# 91 "/usr/include/time.h" 2 3
extern int clock_getres(clockid_t, struct timespec *);
extern int clock_gettime(clockid_t, struct timespec *);
extern int clock_settime(clockid_t, const struct timespec *);

extern int timer_create(clockid_t, struct sigevent *, timer_t *);
extern int timer_delete(timer_t);
extern int timer_getoverrun(timer_t);
extern int timer_gettime(timer_t, struct itimerspec *);
extern int timer_settime(timer_t, int, const struct itimerspec *,
                struct itimerspec *);
extern int nanosleep(const struct timespec *, struct timespec *);





extern void tzset(void);

extern char *tzname[2];


extern long _sysconf(int);






extern long timezone;
extern int daylight;





extern int cftime(char *, char *, const time_t *);
extern int ascftime(char *, const char *, const struct tm *);
extern long altzone;
extern struct tm *getdate(const char *);






extern int getdate_err;
# 15 "AnalyseStats.c" 2
# 1 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/stdarg.h" 1 3
# 90 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/stdarg.h" 3
typedef __gnuc_va_list va_list;
# 16 "AnalyseStats.c" 2
# 1 "/usr/include/errno.h" 1 3
# 11 "/usr/include/errno.h" 3
#pragma ident "@(#)errno.h	1.13	95/09/10 SMI"





# 1 "/usr/include/sys/errno.h" 1 3
# 11 "/usr/include/sys/errno.h" 3
#pragma ident "@(#)errno.h	1.15	95/01/22 SMI"
# 18 "/usr/include/errno.h" 2 3
# 28 "/usr/include/errno.h" 3
extern int errno;
# 17 "AnalyseStats.c" 2
# 1 "/usr/include/string.h" 1 3
# 11 "/usr/include/string.h" 3
#pragma ident "@(#)string.h	1.17	95/08/28 SMI"

# 1 "/usr/include/sys/feature_tests.h" 1 3
# 14 "/usr/include/string.h" 2 3
# 30 "/usr/include/string.h" 3
extern void *memcpy(void *, const void *, size_t);
extern void *memmove(void *, const void *, size_t);
extern char *strcpy(char *, const char *);
extern char *strncpy(char *, const char *, size_t);

extern char *strcat(char *, const char *);
extern char *strncat(char *, const char *, size_t);

extern int memcmp(const void *, const void *, size_t);
extern int strcmp(const char *, const char *);
extern int strcoll(const char *, const char *);
extern int strncmp(const char *, const char *, size_t);
extern size_t strxfrm(char *, const char *, size_t);

extern void *memchr(const void *, int, size_t);
extern char *strchr(const char *, int);
extern size_t strcspn(const char *, const char *);
extern char *strpbrk(const char *, const char *);
extern char *strrchr(const char *, int);
extern size_t strspn(const char *, const char *);
extern char *strstr(const char *, const char *);
extern char *strtok(char *, const char *);




extern void *memset(void *, int, size_t);
extern char *strerror(int);
extern size_t strlen(const char *);




extern void *memccpy(void *, const void *, int, size_t);






extern char *strdup(const char *);
extern char *strsignal(int);
extern int ffs(const int);
extern int strcasecmp(const char *, const char *);
extern int strncasecmp(const char *, const char *, size_t);
# 18 "AnalyseStats.c" 2
# 1 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/limits.h" 1 3
# 11 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/limits.h" 3
# 1 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/syslimits.h" 1 3
# 20 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/syslimits.h" 3
#pragma ident "@(#)limits.h	1.29	96/01/11 SMI"

# 1 "/usr/include/sys/feature_tests.h" 1 3
# 23 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/syslimits.h" 2 3
# 1 "/usr/include/sys/isa_defs.h" 1 3
# 24 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/syslimits.h" 2 3
# 12 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/limits.h" 2 3
# 19 "AnalyseStats.c" 2
# 1 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/math.h" 1 3
# 27 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/math.h" 3
#pragma ident "@(#)math.h	2.5	95/02/07"
# 46 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/math.h" 3
typedef union _h_val {
        unsigned long _i[2];
        double _d;
} _h_val;


extern const _h_val __huge_val;
# 80 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/math.h" 3
extern int signgam;







enum version {libm_ieee = -1, c_issue_4, ansi_1, strict_ansi};


extern const enum version _lib_version;




struct exception {
        int type;
        char *name;
        double arg1;
        double arg2;
        double retval;
};
# 134 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/math.h" 3
extern double acos (double);
extern double asin (double);
extern double atan (double);
extern double atan2 (double, double);
extern double cos (double);
extern double sin (double);
extern double tan (double);

extern double cosh (double);
extern double sinh (double);
extern double tanh (double);

extern double exp (double);
extern double frexp (double, int *);
extern double ldexp (double, int);
extern double log (double);
extern double log10 (double);
extern double modf (double, double *);

extern double pow (double, double);
extern double sqrt (double);

extern double ceil (double);
extern double fabs (double);
extern double floor (double);
extern double fmod (double, double);






extern double erf (double);
extern double erfc (double);
extern double gamma (double);
extern double hypot (double, double);
extern int isnan (double);
extern double j0 (double);
extern double j1 (double);
extern double jn (int, double);
extern double lgamma (double);
extern double y0 (double);
extern double y1 (double);
extern double yn (int, double);






extern double acosh (double);
extern double asinh (double);
extern double atanh (double);
extern double cbrt (double);
extern double logb (double);
extern double nextafter (double, double);
extern double remainder (double, double);
extern double scalb (double, double);




extern double expm1 (double);
extern int ilogb (double);
extern double log1p (double);
extern double rint (double);






extern int matherr (struct exception *);




extern double significand (double);




extern double copysign (double, double);
extern double scalbn (double, int);
# 231 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/math.h" 3
extern float modff (float, float *);

# 1 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/floatingpoint.h" 1 3
# 24 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/floatingpoint.h" 3
#pragma ident "@(#)floatingpoint.h	2.4 94/06/09"
# 42 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/floatingpoint.h" 3
# 1 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/stdio.h" 1 3
# 43 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/floatingpoint.h" 2 3

# 1 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/ieeefp.h" 1 3
# 17 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/ieeefp.h" 3
#pragma ident "@(#)ieeefp.h	2.7 94/11/09"
# 27 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/ieeefp.h" 3
enum fp_direction_type {
        fp_nearest = 0,
        fp_tozero = 1,
        fp_positive = 2,
        fp_negative = 3
};

enum fp_precision_type {
        fp_extended = 0,
        fp_single = 1,
        fp_double = 2,
        fp_precision_3 = 3
};

enum fp_exception_type {
        fp_inexact = 0,
        fp_division = 1,
        fp_underflow = 2,
        fp_overflow = 3,
        fp_invalid = 4
};

enum fp_trap_enable_type {
        fp_trap_inexact = 0,
        fp_trap_division = 1,
        fp_trap_underflow = 2,
        fp_trap_overflow = 3,
        fp_trap_invalid = 4
};
# 133 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/sys/ieeefp.h" 3
enum fp_class_type {
        fp_zero = 0,
        fp_subnormal = 1,
        fp_normal = 2,
        fp_infinity = 3,
        fp_quiet = 4,
        fp_signaling = 5
};
# 45 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/floatingpoint.h" 2 3
# 58 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/floatingpoint.h" 3
typedef int sigfpe_code_type;

typedef void (*sigfpe_handler_type)();





extern sigfpe_handler_type sigfpe (sigfpe_code_type, sigfpe_handler_type);




typedef float single;



typedef unsigned extended[3];


typedef long double quadruple;

typedef unsigned fp_exception_field_type;
# 90 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/floatingpoint.h" 3
typedef char decimal_string[512];


typedef struct {
        enum fp_class_type fpclass;
        int sign;
        int exponent;
        decimal_string ds;


        int more;


        int ndigits;


} decimal_record;

enum decimal_form {
        fixed_form,


        floating_form

};

typedef struct {
        enum fp_direction_type rd;

        enum decimal_form df;

        int ndigits;
} decimal_mode;

enum decimal_string_form {
        invalid_form,
        whitespace_form,
        fixed_int_form,
        fixed_intdot_form,
        fixed_dotfrac_form,
        fixed_intdotfrac_form,
        floating_int_form,
        floating_intdot_form,
        floating_dotfrac_form,
        floating_intdotfrac_form,
        inf_form,
        infinity_form,
        nan_form,
        nanstring_form
};

extern void single_to_decimal (single *, decimal_mode *, decimal_record *, fp_exception_field_type *);

extern void double_to_decimal (double *, decimal_mode *, decimal_record *, fp_exception_field_type *);

extern void extended_to_decimal (extended *, decimal_mode *, decimal_record *, fp_exception_field_type *);

extern void quadruple_to_decimal (quadruple *, decimal_mode *, decimal_record *, fp_exception_field_type *);


extern void decimal_to_single (single *, decimal_mode *, decimal_record *, fp_exception_field_type *);

extern void decimal_to_double (double *, decimal_mode *, decimal_record *, fp_exception_field_type *);

extern void decimal_to_extended (extended *, decimal_mode *, decimal_record *, fp_exception_field_type *);

extern void decimal_to_quadruple (quadruple *, decimal_mode *, decimal_record *, fp_exception_field_type *);


extern void string_to_decimal (char **, int, int, decimal_record *, enum decimal_string_form *, char **);

extern void func_to_decimal (char **, int, int, decimal_record *, enum decimal_string_form *, char **, int (*)(void), int *, int (*)(int));


extern void file_to_decimal (char **, int, int, decimal_record *, enum decimal_string_form *, char **, FILE *, int *);



extern char *seconvert (single *, int, int *, int *, char *);
extern char *sfconvert (single *, int, int *, int *, char *);
extern char *sgconvert (single *, int, int, char *);
extern char *econvert (double, int, int *, int *, char *);
extern char *fconvert (double, int, int *, int *, char *);
extern char *gconvert (double, int, int, char *);
extern char *qeconvert (quadruple *, int, int *, int *, char *);
extern char *qfconvert (quadruple *, int, int *, int *, char *);
extern char *qgconvert (quadruple *, int, int, char *);

extern char *ecvt (double, int, int *, int *);
extern char *fcvt (double, int, int *, int *);
extern char *gcvt (double, int, char *);





extern double atof (const char *);
extern double strtod (const char *, char **);
# 234 "/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/3.0.1/include/math.h" 2 3
# 20 "AnalyseStats.c" 2
# 42 "AnalyseStats.c"
int main(int argc,
         char *argv[])
{
    char input_CA[32000] = "";
    char *fromFormat_CP = "%a %b %d %H:%M:%S %Z %Y";
    char *toFormat_CP = "m%d%HAnalyseStats.cS";
    int optionFound_I = 0;
    typedef struct
        {
            char facilityCode_CA[10];
            char timeFrame_CA[11];
            long numberOfTransactions_L;
            double totalDuration_D;
            double shortestDuration_D;
            double longestDuration_D;
    } facilityStats_TD;



    facilityStats_TD stats_SA[10*100] = {0};
    int numberOfStats_I = 0;
    int ix_I = 0;
    double dumpIfGreaterThan_D = 2147483647;
    int prefixDurationToOutput_I = 0;
    int numberLongTransactionsDumped_I = 0;

    while((optionFound_I = getopt(argc, argv, "pd:?")) != (-1))
    {
        extern char *optarg;
        extern int optind;
        switch (optionFound_I)
        {
            case 'd':
                dumpIfGreaterThan_D = atof(optarg);
                break;
            case 'p':
                prefixDurationToOutput_I = 1;
                break;
            case '?':
                fprintf((&__iob[2]), "Usage\n"
                        "%s [-p] [-d #.#]\n"
                        "\t-d #.#          Dump out transactions which take longer than #.# seconds\n"
                        "\t-p              Prefix above dumps with transaction duration\n"
                        ,
                        argv[0]);
                exit(1);
                break;
            default:
                continue;
        }
    }
# 106 "AnalyseStats.c"
    while(! (((&__iob[0]))->_flag & 0020))
    {
        long sempPid_L = 0;
        long pacePid_L = 0;
        long priority_L = 0;
        char facilityCode_CA[32] = {0};
        double timeStamps_DA[9] = {0.0};
        char yyyymmddhh_CA[11] = "";
        char fieldsParsed_I = 0;

        *input_CA = '\0';
        if(fgets(input_CA, sizeof(input_CA), (&__iob[0])) == (char *) 0)
        {
            continue;
        }






        if(*input_CA != 'D')
        {
            continue;
        }
        if((fieldsParsed_I = sscanf(input_CA, "%*c:%ld:%ld:%ld:%2c:%lg,%lg,%lg,%lg,%lg,%lg,%lg,%lg,%lg:",
                                    &sempPid_L,
                                    &pacePid_L,
                                    &priority_L,
                                    facilityCode_CA,
                                    &timeStamps_DA[0],
                                    &timeStamps_DA[1 ],
                                    &timeStamps_DA[2 ],
                                    &timeStamps_DA[3 ],
                                    &timeStamps_DA[4 ],
                                    &timeStamps_DA[5],
                                    &timeStamps_DA[6 ],
                                    &timeStamps_DA[7],
                                    &timeStamps_DA[8]
                                    )) != 13)
        {
            fprintf((&__iob[2]), "Discarded >%s< - invalid format (found %d fields)\n",
                    input_CA,
                    fieldsParsed_I);
            printf("semp=%d:pace=%d:priority=%d:facility=%s:timeStamps=%lf\n",
                   sempPid_L,
                   pacePid_L,
                   priority_L,
                   facilityCode_CA,
                   timeStamps_DA[0]);
            continue;
        }
# 175 "AnalyseStats.c"
        {
            time_t theTime_L = (long) timeStamps_DA[0];
            struct tm *theTime_SP = (struct tm *) 0;


            if((theTime_SP = localtime(&theTime_L)) == (struct tm *) 0)
            {
                fprintf((&__iob[2]), "localtime failure (%d:%s)\n",
                        errno, strerror(errno));
                exit(1);
            }
            sprintf(yyyymmddhh_CA, "%04d%02d%02d%02d",
                    theTime_SP->tm_year + 1900,
                    theTime_SP->tm_mon + 1,
                    theTime_SP->tm_mday,
                    theTime_SP->tm_hour);
        }







        for(ix_I = 0; ix_I < numberOfStats_I; ix_I++)
        {
            if(strcmp(stats_SA[ix_I].facilityCode_CA, facilityCode_CA) == 0)
            {
                if(strcmp(stats_SA[ix_I].timeFrame_CA, yyyymmddhh_CA) == 0)
                {







                    break;
                }
            }
        }


        if(ix_I >= numberOfStats_I)
        {
            if(ix_I < 10*100)
            {







                strcpy(stats_SA[ix_I].facilityCode_CA, facilityCode_CA);
                strcpy(stats_SA[ix_I].timeFrame_CA, yyyymmddhh_CA);
                stats_SA[ix_I].numberOfTransactions_L = 1;
                stats_SA[ix_I].totalDuration_D =
                    timeStamps_DA[8] - timeStamps_DA[0];
                stats_SA[ix_I].shortestDuration_D = stats_SA[ix_I].totalDuration_D;
                stats_SA[ix_I].longestDuration_D = stats_SA[ix_I].totalDuration_D;
                numberOfStats_I++;

                continue;
            }
            else
            {
                fprintf((&__iob[2]), "Too many hours of stats. Dropped >%s<\n",
                        input_CA);
                continue;
            }
        }
        else
        {
            double thisDuration_D = timeStamps_DA[8] - timeStamps_DA[0];


            stats_SA[ix_I].numberOfTransactions_L++;
            stats_SA[ix_I].totalDuration_D += thisDuration_D;






            if(thisDuration_D > (double) 0.0)
            {
                if(thisDuration_D < stats_SA[ix_I].shortestDuration_D)
                {
                    stats_SA[ix_I].shortestDuration_D = thisDuration_D;
                }
                if(thisDuration_D > stats_SA[ix_I].longestDuration_D)
                {
                    stats_SA[ix_I].longestDuration_D = thisDuration_D;
                }
            }





            if(thisDuration_D > dumpIfGreaterThan_D)
            {
                numberLongTransactionsDumped_I++;
                if(prefixDurationToOutput_I)
                {
                    fprintf((&__iob[2]), "%-15.6lf:%s", thisDuration_D, input_CA);
                }
                else
                {
                    fprintf((&__iob[2]), "%s", input_CA);
                }
            }
        }
    }

    printf("Statistics for DIMA/PACE Interface\n");
    if(numberLongTransactionsDumped_I > 0)
    {
        printf("%d transaction(s) exceeded required minimum of %-15.6lf seconds\n",
               numberLongTransactionsDumped_I,
               dumpIfGreaterThan_D);
    }
    printf("Number of lines = %d\n", numberOfStats_I);
    printf("%-10.10s %-10.10s %15.15s %15.15s %15.15s %15.15s\n", "Facility", "Timeframe", "Transactions", "Av. Duration", "Shortest", "Longest");
    printf("%-10.10s %-10.10s %-15.15s %-15.15s %-15.15s %-15.15s\n", "----------", "----------", "---------------", "---------------", "---------------", "---------------");
    for(ix_I = 0; ix_I < numberOfStats_I; ix_I++)
    {
        printf("%-10.10s %-10.10s %15.15ld %15.5lf %15.5lf %15.5lf\n",
               stats_SA[ix_I].facilityCode_CA,
               stats_SA[ix_I].timeFrame_CA,
               stats_SA[ix_I].numberOfTransactions_L,
               stats_SA[ix_I].totalDuration_D / (double) stats_SA[ix_I].numberOfTransactions_L,
               stats_SA[ix_I].shortestDuration_D,
               stats_SA[ix_I].longestDuration_D);
    }
    printf("%-10.10s %-10.10s %-15.15s %-15.15s %-15.15s %-15.15s\n", "----------", "----------", "---------------", "---------------", "---------------", "---------------");

    return(0);
}



More information about the Gcc-bugs mailing list