Bug 29350 - Incorrect function name assigned
Summary: Incorrect function name assigned
Status: ASSIGNED
Alias: None
Product: binutils
Classification: Unclassified
Component: gprofng (show other bugs)
Version: unspecified
: P3 normal
Target Milestone: ---
Assignee: Vladimir Mezentsev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-11 03:46 UTC by Ruud van der Pas
Modified: 2022-07-22 13:53 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ruud van der Pas 2022-07-11 03:46:13 UTC
The gp-display-text tool assigns an incorrect name to a function. This is a snippet from the source listing as produced with the source command from gp-display-text:

 184. MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
 185.
      <Function: MEM_64bits>
 186. MEM_STATIC unsigned MEM_isLittleEndian(void)
 187. {
 188.     const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
 189.     return one.c[0];
 190. }

Note that function MEM_isLittleEndian is labeled as MEM_64bits.

In the output of the fsummary command, I see this. Note that I removed the path names:

MEM_64bits
        Exclusive Total CPU Time:  1.551 (  2.1%)
        Inclusive Total CPU Time:  1.551 (  2.1%)
                            Size:      6
                      PC Address: 12:0x00028b00
                     Source File: <path removed>
                     Object File: <path removed>
                     Load Object: <path removed>
                    Mangled Name:
                         Aliases: MEM_isLittleEndian

I'm not sure if this is indeed an alias for the same function though.

This code cannot be shared easily, but I can prepare a test case. Let me know if there is interest in this.

I observed this problem with various gcc releases by the way. I'm using an OCI instance with a Haswell processor, running Oracle Linux 8:

Linux <instance name> 5.4.17-2102.202.5.el8uek.x86_64 #2 SMP Sat May 22 16:16:03 PDT 2021 x86_64 x86_64 x86_64 GNU/Linux