public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/46236] New: Local aggregate not eliminated
@ 2010-10-30  0:38 davidxl at gcc dot gnu.org
  2010-10-30 18:20 ` [Bug tree-optimization/46236] " rguenth at gcc dot gnu.org
  2021-08-10 17:46 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: davidxl at gcc dot gnu.org @ 2010-10-30  0:38 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Local aggregate not eliminated
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: davidxl@gcc.gnu.org
                CC: xinliangli@gmail.com


Simple Test case:

struct A {
  int a[100];
};

const struct A aa = {1,1,1};

int foo(int i)
{
    int s = 0;
    struct A a; 

    a = aa;
    s = a.a[i];
    if (i > 5)
       s+=a.a[i];

   return s;
}

// Trunk gcc generates: (O2)

foo:
.LFB0:
    .cfi_startproc
    subq    $280, %rsp
    .cfi_def_cfa_offset 288
    movl    %edi, %edx
    xorl    %eax, %eax
    leaq    -120(%rsp), %rdi
    cmpl    $6, %edx
    movl    $50, %ecx
    rep stosq
    movl    $1, -120(%rsp)
    movl    $1, -116(%rsp)
    movl    $1, -112(%rsp)
    movslq    %edx, %rax
    movl    -120(%rsp,%rax,4), %eax
    leal    (%rax,%rax), %ecx
    cmovge    %ecx, %eax
    addq    $280, %rsp
    .cfi_def_cfa_offset 8
    ret


// Trunk LLVM generates: (O2)
foo:
.Leh_func_begin0:
    movslq    %edi, %rcx
    movl    aa(,%rcx,4), %eax
    cmpl    $6, %ecx
    jl    .LBB0_2
    addl    %eax, %eax
.LBB0_2:
    ret


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

* [Bug tree-optimization/46236] Local aggregate not eliminated
  2010-10-30  0:38 [Bug tree-optimization/46236] New: Local aggregate not eliminated davidxl at gcc dot gnu.org
@ 2010-10-30 18:20 ` rguenth at gcc dot gnu.org
  2021-08-10 17:46 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-10-30 18:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-10-30 18:20:48 UTC ---
This is a dup of the PR that says we don't do aggregate copyprop.


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

* [Bug tree-optimization/46236] Local aggregate not eliminated
  2010-10-30  0:38 [Bug tree-optimization/46236] New: Local aggregate not eliminated davidxl at gcc dot gnu.org
  2010-10-30 18:20 ` [Bug tree-optimization/46236] " rguenth at gcc dot gnu.org
@ 2021-08-10 17:46 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-10 17:46 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
   Last reconfirmed|2018-04-22 00:00:00         |2021-8-10

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

end of thread, other threads:[~2021-08-10 17:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-30  0:38 [Bug tree-optimization/46236] New: Local aggregate not eliminated davidxl at gcc dot gnu.org
2010-10-30 18:20 ` [Bug tree-optimization/46236] " rguenth at gcc dot gnu.org
2021-08-10 17:46 ` pinskia at gcc dot gnu.org

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