public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/101928] New: Incorrect argument list for varardic functions
@ 2021-08-16  5:02 liyd2021 at gmail dot com
  2021-08-16  9:23 ` [Bug ipa/101928] " rguenth at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: liyd2021 at gmail dot com @ 2021-08-16  5:02 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101928
           Summary: Incorrect argument list for varardic functions
           Product: gcc
           Version: 11.1.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.1.0 with gdb (Ubuntu 20.04.2)

(terminal) $ cat simple.c && gcc -g -O2 simple.c
static void varargs(int q0, int q1, ...) {
  va_list ap;
  va_start(ap, q1);
}
int main() {
  varargs(0, 1, 2);
}

--------------------

(terminal) $ cat run.gdb
b varargs
r
ptype varargs
q

(terminal) $ gdb -x run.gdb a.out
Breakpoint 1, varargs (q0=0, q1=1, q1=1, q0=0) at simple.c:2
2       static void varargs(int q0, int q1, ...) {
type = void (int, int, int, int)  <-- BUG, duplicated arguments

--------------------

Compile with O0/Og will not trigger this behavior. The static for `varargs` is
also required. LLDB rejected this debug info:

(terminal) $ lldb a.out
(lldb) b varargs 
error: simple {0x0000000c}: DIE has DW_AT_ranges(0xc) attribute, but range
extraction failed (missing or invalid range list table), please file a bug and
attach the file at the start of this error message

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

end of thread, other threads:[~2021-08-16  9:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-16  5:02 [Bug debug/101928] New: Incorrect argument list for varardic functions liyd2021 at gmail dot com
2021-08-16  9:23 ` [Bug ipa/101928] " 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).