public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/46647] New: Can't inline memset with -1
@ 2010-11-24 20:57 hjl.tools at gmail dot com
  2010-11-24 21:01 ` [Bug target/46647] " hjl.tools at gmail dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2010-11-24 20:57 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Can't inline memset with -1
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hjl.tools@gmail.com
                CC: ubizjak@gmail.com


[hjl@gnu-16 gcc]$ cat /tmp/x.i 
char a[4];
int
func1 (void)
{
  __builtin_memset (a,-1,sizeof (a));
  return 0;
}

int
func2 (void)
{
  __builtin_memset (a,123,sizeof (a));
  return 0;
}
[hjl@gnu-16 gcc]$ ./xgcc -B./ -S /tmp/x.i -O2 -m32
[hjl@gnu-16 gcc]$ cat x.s
    .file    "x.i"
    .text
    .p2align 4,,15
    .globl    func1
    .type    func1, @function
func1:
.LFB0:
    .cfi_startproc
    subl    $28, %esp
    .cfi_def_cfa_offset 32
    movl    $4, 8(%esp)
    movl    $-1, 4(%esp)
    movl    $a, (%esp)
    call    memset
    xorl    %eax, %eax
    addl    $28, %esp
    .cfi_def_cfa_offset 4
    ret
    .cfi_endproc
.LFE0:
    .size    func1, .-func1
    .p2align 4,,15
    .globl    func2
    .type    func2, @function
func2:
.LFB1:
    .cfi_startproc
    movl    $2071690107, a
    xorl    %eax, %eax
    ret
    .cfi_endproc
.LFE1:
    .size    func2, .-func2
    .comm    a,4,1
    .ident    "GCC: (GNU) 4.6.0 20101124 (experimental) [trunk revision
167121]"
    .section    .note.GNU-stack,"",@progbits
[hjl@gnu-16 gcc]$ 

Why can't we inline  __builtin_memset (a,123,sizeof (a))?


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

end of thread, other threads:[~2010-11-28 14:33 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-24 20:57 [Bug target/46647] New: Can't inline memset with -1 hjl.tools at gmail dot com
2010-11-24 21:01 ` [Bug target/46647] " hjl.tools at gmail dot com
2010-11-24 21:01 ` [Bug middle-end/46647] " hjl.tools at gmail dot com
2010-11-24 21:43 ` hjl.tools at gmail dot com
2010-11-24 21:53 ` jakub at gcc dot gnu.org
2010-11-24 22:00 ` hjl.tools at gmail dot com
2010-11-24 22:06 ` hjl.tools at gmail dot com
2010-11-24 22:10 ` hjl.tools at gmail dot com
2010-11-24 22:11 ` jakub at gcc dot gnu.org
2010-11-24 22:22 ` hjl.tools at gmail dot com
2010-11-24 23:04 ` hjl.tools at gmail dot com
2010-11-25 14:40 ` hjl at gcc dot gnu.org
2010-11-26  9:51 ` jakub at gcc dot gnu.org
2010-11-28 14:37 ` hjl.tools at gmail dot com

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).