http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49828

           Summary: reversed order of inlined function parameters
           Product: gcc
           Version: 4.4.7
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: debug
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: jan.kratoch...@redhat.com
            Target: x86_64-unknown-linux-gnu


FAIL: gcc (GCC) 4.4.7 20110724 (prerelease)
FAIL: gcc (GCC) 4.5.4 20110724 (prerelease)
FAIL: gcc (GCC) 4.6.2 20110724 (prerelease)
FAIL: gcc (GCC) 4.7.0 20110719 (experimental)
--------------------------------------------------------------------------------
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)
    <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

Reply via email to