public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/103047] New: Inconsist arguments ordering for inlined subroutine
@ 2021-11-02 14:13 liyd2021 at gmail dot com
  2024-01-26 14:07 ` [Bug debug/103047] Inconsistent " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: liyd2021 at gmail dot com @ 2021-11-02 14:13 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103047
           Summary: Inconsist arguments ordering for inlined subroutine
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: liyd2021 at gmail dot com
  Target Milestone: ---

Affected versions: gcc 11.2.0 with gdb (Ubuntu 20.04.2)

The `foo` function is inlined in O1 optimization, and gcc generates inconsist 
arguments ordering between `DW_TAG_inlined_subroutine` and `DW_TAG_subprogram`
in debug information.
This bug can also be reproduced in gcc 7, 8, 9.

(terminal) $ cat a.c && gcc -g -O1 a.c
int foo(int a0, double a1)
{
  return a0 != 0 || a1 != 1.0;
}

int v0 = 0;
double v1 = 1.0;

int main()
{
  return foo(v0, v1);
}
--------------------
(terminal) $ cat run.gdb
ptype foo
b foo
r
ptype foo
--------------------
(terminal) $ gdb -x run.gdb a.out
type = int (int, double)
Breakpoint 1 at 0x401169: foo. (2 locations)

Breakpoint 1, foo (a1=1, a0=0) at a.c:3
3         return a0 != 0 || a1 != 1.0;
type = int (double, int) <-- inconsist with previous print

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

end of thread, other threads:[~2024-01-29  7:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-02 14:13 [Bug debug/103047] New: Inconsist arguments ordering for inlined subroutine liyd2021 at gmail dot com
2024-01-26 14:07 ` [Bug debug/103047] Inconsistent " rguenth at gcc dot gnu.org
2024-01-29  7:47 ` cvs-commit at gcc dot gnu.org
2024-01-29  7:47 ` rguenth 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).