From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,8cfb38ca39016d16 X-Google-Attributes: gidfee84,public X-Google-Thread: 1164f8,8cfb38ca39016d16 X-Google-Attributes: gid1164f8,public From: ron@topaz.sensor.com (Ron Natalie) Subject: Re: Possible BUG on Alpha C compiler? Date: 1995/11/27 Message-ID: <49d2qr$mhf@topaz.sensor.com>#1/1 X-Deja-AN: 120310966 references: <49b0ad$d1i@no-names.nerdc.ufl.edu> followup-to: comp.unix.osf.osf1,comp.sys.dec organization: Sensor Systems newsgroups: comp.unix.osf.osf1,comp.sys.dec Christos Siopis (siopis) wrote: : I have a bizzare (for my modest experience, at least) problem with a : C program I am trying to run on a DEC Alpha running OSF/1. : The program has compiled and runs successfully on a SUN SPARCstation 2 : using the gcc compiler, on an IBM RISC/6000 using its native cc compiler : as well as a DECstation 3100 using either gcc or its own cc compiler. : The program compiles without problem on a DEC Alpha OSF/1, but when : I run it, I get a ``floating exception'' error. I have pinpointed the : error to the following rather inconspicuous statement: : delta = c[j] - q; : Right before the statement is executed, j=0, c[j]=1.221301, q=0.000000 : and delta=533.333333. delta, q and c[1] are double variables and j is : integer. I get the same error with gcc and cc, so it looks more like a : linker error? But then I do not use any function call... Any help is : greatly appreciated, this is an important part of my thesis project : and it *has* to run on the Alpha, or it will take substantially more : time to finish... The major difference on the Alpha, is that even accessing a memory location with an invalid floating point value as floating point causes an exception (nearly every other CPU actually requires you to do some calculation with the number to trigger the exception). I would suspect that you q or c[0] is actually uninitialized data and gdb or whatever is inhibitting (or ignoring) the exception when you try to debug it. Purify (unfortunately not available on the alpha) or CodeCenter (which unfortunately rolls over and dies on any decent sized application) will help find these. -Ron