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

            Bug ID: 68355
           Summary: Constant byte is passed on stack
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: ubizjak at gmail dot com
  Target Milestone: ---
            Target: x86-64

[hjl@gnu-tools-1 pr67239]$ cat foo.ii
template<typename _Tp, _Tp __v>
struct integral_constant
{
  static constexpr _Tp value = __v;
  typedef _Tp value_type;
  typedef integral_constant<_Tp, __v> type;
  constexpr operator value_type() const { return value; }
};

typedef integral_constant<bool, true> true_type;

extern void xxx (true_type c);
extern true_type y;

void
yyy ()
{
  xxx (y);
}
[hjl@gnu-tools-1 pr67239]$  gcc -S  -std=gnu++11 -S  -O2 foo.ii  
[hjl@gnu-tools-1 pr67239]$ cat foo.s
        .file   "foo.ii"
        .section        .text.unlikely,"ax",@progbits
.LCOLDB0:
        .text
.LHOTB0:
        .p2align 4,,15
        .globl  _Z3yyyv
        .type   _Z3yyyv, @function
_Z3yyyv:
.LFB1:
        .cfi_startproc
        subq    $16, %rsp
        .cfi_def_cfa_offset 24
        pushq   $0
        .cfi_def_cfa_offset 32
        call    _Z3xxx17integral_constantIbLb1EE
        addq    $24, %rsp
        .cfi_def_cfa_offset 8
        ret
        .cfi_endproc
.LFE1:
        .size   _Z3yyyv, .-_Z3yyyv
        .section        .text.unlikely
.LCOLDE0:
        .text
.LHOTE0:
        .ident  "GCC: (GNU) 5.2.1 20150929 (Red Hat 5.2.1-3)"
        .section        .note.GNU-stack,"",@progbits
[hjl@gnu-tools-1 pr67239]$ 

It causes PR 67329 due to DW_CFA_GNU_args_size generated by "push $0", which
is ignored by callee.

Reply via email to