Hi, This afects Cygwin badly, as it still uses stabs by default. I've seen this problem here, but thought it was caused by a few gcc changes I was making ... Pierre Muller wrote: > As I was unable to understand the current implementation of > the twos_complement_representation I can't really see how it was supposed to work either. Parsing 000000000 is broken currently. > I rewrote it almost completely. You are only counting the bits. This function should return the parsed number if it fits in a long: /* If TWOS_COMPLEMENT_BITS is set to a strictly positive value and if the number is represented in an octal representation, assume that it is represented in a 2's complement representation with a size of TWOS_COMPLEMENT_BITS. If the number fits in a long, set *BITS to 0 and return the value. If not, set *BITS to be the number of bits in the number and return 0. If encounter garbage, set *BITS to -1 and return 0. */ > The code now checks that the most significant > bit of the whole octal representation of the huge number > that is being parsed is exactly at the bit position given by > the twos_complement_bits parameter. > > The attached patch (against 6.6.90 source) > fixes the problem that I describe in the previous > email. I get no complaint for the 'unsigned long long' type > compiled with '-gstabs+' option. > Thanks for pointing in the right direction! (Forgive me for counter patching, but I had started on this here too yesterday :( ) What about the attached? Isn't it simpler? We get passed the max number of bits the number we're parsing can hold in TWOS_COMPLEMENT_BITS. Just parse the number as unsigned, if it overflows, it doesn't matter, we just account for the bits. If it doesn't overflow (host has a big long), and TWOS_COMPLEMENT_BITS < sizeof (long) * HOST_CHAR_BIT and number is signed according to TWOS_COMPLEMENT_BITS - 1 bit being set, sign extend the number into a long. Just tested that it also fixes the problem. I'll give it a testsuite spin for C/C++ on Cygwin tomorrow, but the testcase that suposedly tests this is in ADA, which I don't have a setup for... Cheers, Pedro Alves