From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9D5F13809BE9; Thu, 6 Jun 2024 14:56:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D5F13809BE9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1717685809; bh=AixDLdOfI2MoEfLVQsILc4qTUCDrcmf1yUdyDZOwQsA=; h=From:To:Subject:Date:From; b=YKrkB9DFixtjQ5UpQH0ptWVkYk49TGN4/W/Nti+ZU2BXVts8p16qLoAqAE+hDXgP7 G4c0yxvzWIk98v4XEBCugNLQunmi4uQj9DFFRPyOkemPcfHH8MqsR1Tf5DEYyNPwbT DkcistPk53S3VmMBSBPeSGJw83GU5dtXHpvKDyKo= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/31852] New: [gdb/symtab, 1-byte complex float] gdbtypes.c:244: internal-error: new_type: Assertion `(bit % TARGET_CHAR_BIT) == 0' failed Date: Thu, 06 Jun 2024 14:56:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31852 Bug ID: 31852 Summary: [gdb/symtab, 1-byte complex float] gdbtypes.c:244: internal-error: new_type: Assertion `(bit % TARGET_CHAR_BIT) =3D=3D 0' failed Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: symtab Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- FTR, I wrote the following dwarf assembly test-case: ... load_lib dwarf.exp # This test can only be run on targets which support DWARF-2 and use gas. require dwarf2_support standard_testfile main.c -debug.S # Create the DWARF. set asm_file [standard_output_file $srcfile2] Dwarf::assemble $asm_file { declare_labels unspecified_type_label cu { version 2 } { compile_unit {} { declare_labels int_type int_type: DW_TAG_base_type { {DW_AT_byte_size 4 DW_FORM_sdata} {DW_AT_encoding @DW_ATE_signed} {DW_AT_name int} } DW_TAG_subprogram { {MACRO_AT_func {main}} {type :$int_type} } DW_TAG_base_type { {DW_AT_byte_size 1 DW_FORM_sdata} {DW_AT_encoding @DW_ATE_complex_float} {DW_AT_name "complex long double"} } } } } if [prepare_for_testing "failed to prepare" $testfile \ "${asm_file} ${srcfile}" {}] { return -1 } if ![runto_main] { return -1 } gdb_test "ptype complex long double" ... which produces: ... <1><39>: Abbrev Number: 4 (DW_TAG_base_type) <3a> DW_AT_byte_size : 1 <3b> DW_AT_encoding : 3 (complex float) <3c> DW_AT_name : complex long double ... We run into: ... (gdb) break -qualified main^M /data/vries/gdb/src/gdb/gdbtypes.c:244: internal-error: new_type: Assertion `(bit % TARGET_CHAR_BIT) =3D=3D 0' failed.^M A problem internal to GDB has been detected,^M ... Could be fixed by: ... diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20 index f39fe3de6a4..1216b69d67a 100644=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20 --- a/gdb/gdbtypes.c=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 +++ b/gdb/gdbtypes.c=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 @@ -241,6 +241,8 @@ type_allocator::new_type (enum type_code code, int bit, const char *name)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20 {=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20 struct type *type =3D new_type ();=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20 set_type_code (type, code);=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20 + if (code =3D=3D TYPE_CODE_ERROR && bit % TARGET_CHAR_BIT !=3D 0)=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + bit =3D 0;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 gdb_assert ((bit % TARGET_CHAR_BIT) =3D=3D 0);=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20 type->set_length (bit / TARGET_CHAR_BIT);=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20 ... --=20 You are receiving this mail because: You are on the CC list for the bug.=