From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Lipe To: egcs-bugs@egcs.cygnus.com Cc: gas2@cygnus.com Subject: dwarf-1 egcs outputs bad .s / GAS allows it. Date: Fri, 26 Mar 1999 19:32:00 -0000 Message-id: <19990326213126.A3658@rjlhome.sco.com> X-SW-Source: 1999/msg00042.html Two groups copied. Decouple the respective alias from any conversation that doesn't impact that group. I'm not sure, but I think there are two bugs. The first bug is that EGCS emits this. The second is that GAS accepts it. :-) EGCS off the trunk from this morning. GAS is 990223. Both configured for Unixware 7 (i686-pc-sysv5). I have no real reason to believe this is target-specific other that dwarf-1 on x86 isn't a road well travelled. I just analyzed the testsuite failure on bf-pack-1.c. It takes all of '-O3 -fPIC -g' to trigger this bug on this case. /home3/negcs/gcc/xgcc --save-temps -dA -B/home3/negcs/gcc/ /play/egcs/gcc/testsuite/gcc.c-torture/execute/bf-pack-1.c -w -O3 -g -lm -fPIC .L_D8_e: .L_D9: .4byte .L_D9_e-.L_D9 .2byte 0xd / TAG_member .2byte 0x12 / AT_sibling .4byte .L_D10 .2byte 0x38 / AT_name .string "whole" .2byte 0x142 / AT_member .4byte .L_T83 .2byte 0x55 / AT_fund_type .2byte 0xc / FT_unsigned_long .2byte 0xb6 / AT_byte_size .4byte 0x4 .2byte 0xd6 / AT_bit_size .4byte 0x20 .2byte 0xc5 / AT_bit_offset HERE-> .2byte 0xfffffff0 .2byte 0x23 / AT_location .2byte .L_l9_e-.L_l9 .L_l9: .byte 0x4 / OP_CONST .4byte 0x0 This is coming from the end bit_offset_attribute() in dwarfout.c. It calls ASM_OUTPUT_DWARF_DATA2 but bit_offset is negative. ( I don't know why it's negative but when you subtract 0x30 from 0x20 you do indeed get a -0x10.) Should bit_offset be masked to fit in 16 bits? Should it be .4byte? Should this be an impossible combination anyway? Why does GAS allow this?