public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/114186] New: Incorrect CTF generated for multidimensional array
@ 2024-03-01  6:34 ibhagat at gcc dot gnu.org
  2024-03-01 18:29 ` [Bug debug/114186] " ibhagat at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ibhagat at gcc dot gnu.org @ 2024-03-01  6:34 UTC (permalink / raw)
  To: gcc-bugs

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]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-05 23:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-01  6:34 [Bug debug/114186] New: Incorrect CTF generated for multidimensional array ibhagat at gcc dot gnu.org
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

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).