Discussion:
[Bug symtab/15223] New: reversed order of inlined function parameters
jan.kratochvil at redhat dot com
2013-03-04 14:13:55 UTC
Permalink
http://sourceware.org/bugzilla/show_bug.cgi?id=15223

Bug #: 15223
Summary: reversed order of inlined function parameters
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: symtab
AssignedTo: ***@sourceware.org
ReportedBy: ***@redhat.com
Classification: Unclassified
Target: x86_64-unknown-linux-gnu


--------------------------------------------------------------------------------
int v;
__attribute__((always_inline)) static void
f (int a, int b, int c)
{
v = a + b + c;
}
int
main (void)
{
f (1, 2, 3);
return 0;
}
--------------------------------------------------------------------------------
gcc -Wall -g
(it occurs also with -O2 and without explicit always_inline)
--------------------------------------------------------------------------------
OK:
<1><2d>: Abbrev Number: 2 (DW_TAG_subprogram)7
<2e> DW_AT_name : f
<2><38>: Abbrev Number: 3 (DW_TAG_formal_parameter)
<39> DW_AT_name : a
<2><41>: Abbrev Number: 3 (DW_TAG_formal_parameter)
<42> DW_AT_name : b
but the instance has them in reversed order:
<2><81>: Abbrev Number: 6 (DW_TAG_inlined_subroutine)
<82> DW_AT_abstract_origin: <0x2d>
<86> DW_AT_low_pc : 0x40046d
<8e> DW_AT_high_pc : 0x40047e
<3><a0>: Abbrev Number: 7 (DW_TAG_formal_parameter)
<a1> DW_AT_abstract_origin: <0x41>
<a5> DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24)
<3><a8>: Abbrev Number: 7 (DW_TAG_formal_parameter)
<a9> DW_AT_abstract_origin: <0x38>
<ad> DW_AT_location : 2 byte block: 91 6c (DW_OP_fbreg: -20)
--------------------------------------------------------------------------------
GDB output is reversed then:
f (c=3, b=2, a=1) at 16.c:5


It was rejected as a GCC PR:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49828
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
xunxun1982 at gmail dot com
2013-03-21 03:36:12 UTC
Permalink
http://sourceware.org/bugzilla/show_bug.cgi?id=15223

xunxun <xunxun1982 at gmail dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |xunxun1982 at gmail dot com
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
nils at redhat dot com
2013-04-17 08:46:18 UTC
Permalink
http://sourceware.org/bugzilla/show_bug.cgi?id=15223

Nils Philippsen <nils at redhat dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |nils at redhat dot com
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
jan.kratochvil at redhat dot com
2013-05-28 05:51:06 UTC
Permalink
http://sourceware.org/bugzilla/show_bug.cgi?id=15223

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |dje at google dot com

--- Comment #1 from Jan Kratochvil <jan.kratochvil at redhat dot com> ---
*** Bug 15541 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are on the CC list for the bug.
naesten at gmail dot com
2013-12-09 05:38:38 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=15223

Samuel Bronson <naesten at gmail dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |naesten at gmail dot com
--
You are receiving this mail because:
You are on the CC list for the bug.
kurt at roeckx dot be
2016-11-20 08:55:22 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=15223

Kurt Roeckx <kurt at roeckx dot be> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |kurt at roeckx dot be

--- Comment #2 from Kurt Roeckx <kurt at roeckx dot be> ---
I just saw this when debugging OpenSSL:
#2 0x00000000007f3d62 in ecp_nistz256_bignum_to_field_elem (in=0x0,
out=<optimized out>) at crypto/ec/ecp_nistz256.c:591

Where the function is:
static int ecp_nistz256_bignum_to_field_elem(BN_ULONG out[P256_LIMBS],
const BIGNUM *in)
{
return bn_copy_words(out, in, P256_LIMBS);
}

The first parameter seems to be optimized out, and then placed last.
--
You are receiving this mail because:
You are on the CC list for the bug.
jan.kratochvil at redhat dot com
2018-05-03 09:24:15 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=15223

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |jan.kratochvil at redhat dot com

--- Comment #3 from Jan Kratochvil <jan.kratochvil at redhat dot com> ---
Still valid: gdb-8.1-14.fc29.x86_64
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...