public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ibhagat at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-114186-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114186

            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 
int a[5][9][3];
$ gcc -O0 -gctf -dA -S array.c

Excerpt from array.s:

...        
        .long   0x17    # ctv_name
        .long   0x5     # ctv_typeidx

=> a variable of type id = 5

        .long   0x1     # ctt_name
        .long   0x6000000       # ctt_info
        .long   0x4     # ctt_size or ctt_type
        .long   0x1000020       # ctf_encoding_data

=> type id = 1, type = int

        .long   0x5     # ctt_name
        .long   0x6000000       # ctt_info
        .long   0x8     # ctt_size or ctt_type
        .long   0x40    # ctf_encoding_data

=> type id = 2, type = 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

=> type id = 3, nelems = 5, array contents (cta_contents) of type with type id
= 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

=> type id = 4, nelems = 9, array contents (cta_contents) of type with type id
= 3 

        .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

=> type id = 5, nelems = 3, array contents (cta_contents) of type with type id
= 4

In other words, the data type of the variable is being emitted as if it were
int a[3][9][5]

             reply	other threads:[~2024-03-01  6:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01  6:34 ibhagat at gcc dot gnu.org [this message]
2024-03-01 18:29 ` [Bug debug/114186] " ibhagat at gcc dot gnu.org
2024-03-02  0:26 ` ibhagat at gcc dot gnu.org
2024-03-05 23:40 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-114186-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).