From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 97F753858C53; Fri, 1 Mar 2024 06:34:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 97F753858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709274854; bh=B2Nmx/Y0MtXYv83smnipRr9twWec1PoTkDaYo9x9BEA=; h=From:To:Subject:Date:From; b=mqv0Ul/kcdeiQ1wTpgCJdBVn2HaeSHRpI8eKMDSiVtasLZnYhe+K0Ws8Oq6qvg4aO bJ3cuwLvPmUr1XcrujmmyNbcDPXrhlX/D1hUEWgLcUUYzZi3UQ/wplUyguk3P+zxVx MI0Rdx+56X2ypYq5W+XGE+ZT1f56atufaG+lHcFA= From: "ibhagat at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/114186] New: Incorrect CTF generated for multidimensional array Date: Fri, 01 Mar 2024 06:34:14 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ibhagat at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.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://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114186 Bug ID: 114186 Summary: Incorrect CTF generated for multidimensional array Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: ibhagat at gcc dot gnu.org Target Milestone: --- $ cat array.c=20 int a[5][9][3]; $ gcc -O0 -gctf -dA -S array.c Excerpt from array.s: ...=20=20=20=20=20=20=20=20 .long 0x17 # ctv_name .long 0x5 # ctv_typeidx =3D> a variable of type id =3D 5 .long 0x1 # ctt_name .long 0x6000000 # ctt_info .long 0x4 # ctt_size or ctt_type .long 0x1000020 # ctf_encoding_data =3D> type id =3D 1, type =3D int .long 0x5 # ctt_name .long 0x6000000 # ctt_info .long 0x8 # ctt_size or ctt_type .long 0x40 # ctf_encoding_data =3D> type id =3D 2, type =3D long unsigned int .long 0 # ctt_name .long 0x12000000 # ctt_info .long 0 # ctt_size or ctt_type .long 0x1 # cta_contents .long 0x2 # cta_index .long 0x5 # cta_nelems =3D> type id =3D 3, nelems =3D 5, array contents (cta_contents) of type wit= h type id =3D 1 .long 0 # ctt_name .long 0x12000000 # ctt_info .long 0 # ctt_size or ctt_type .long 0x3 # cta_contents .long 0x2 # cta_index .long 0x9 # cta_nelems =3D> type id =3D 4, nelems =3D 9, array contents (cta_contents) of type wit= h type id =3D 3=20 .long 0 # ctt_name .long 0x12000000 # ctt_info .long 0 # ctt_size or ctt_type .long 0x4 # cta_contents .long 0x2 # cta_index .long 0x3 # cta_nelems =3D> type id =3D 5, nelems =3D 3, array contents (cta_contents) of type wit= h type id =3D 4 In other words, the data type of the variable is being emitted as if it were int a[3][9][5]=