https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65997
Bug ID: 65997 Summary: -mregparm=3 causes bad DWARF debug info Product: gcc Version: 5.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: hjl.tools at gmail dot com Target Milestone: --- Target: x86 On Linux/x86, I got [hjl@gnu-6 gcc]$ cat /tmp/x.c typedef unsigned int size_t; void bzero(void *b , size_t length) { char *ptr = (char *)b; while (length--) *ptr++ = 0; } [hjl@gnu-6 gcc]$ /usr/gcc-5.1.1/bin/gcc -m32 -O2 -g /tmp/x.i -c -o /tmp/x.o -mregparm=3 [hjl@gnu-6 gcc]$ readelf -w /tmp/x.o >! /dev/null readelf: Warning: There are 44 unused bytes at the end of section .zdebug_loc readelf: Error: '/dev/null' is not an ordinary file [hjl@gnu-6 gcc]$ /usr/gcc-5.1.1/bin/gcc -m32 -O2 -g /tmp/x.i -c -o /tmp/x.o [hjl@gnu-6 gcc]$ readelf -w /tmp/x.o >! /dev/null readelf: Error: '/dev/null' is not an ordinary file [hjl@gnu-6 gcc]$