public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/35288]  New: Expression reassociation problem
@ 2008-02-22  6:36 xinliangli at gmail dot com
  2008-02-22 10:56 ` [Bug middle-end/35288] " rguenth at gcc dot gnu dot org
  0 siblings, 1 reply; 3+ messages in thread
From: xinliangli at gmail dot com @ 2008-02-22  6:36 UTC (permalink / raw)
  To: gcc-bugs

The second instance of a1+a2 is not PREed due to missing expression
reassociation.

int foo(int a1, int a2, int a3)
{
   int b1,b2;
   b1 = a3 + a2 + a1;
   b2 = a1  + a2;
   return b1 + b2;
}


-- 
           Summary: Expression reassociation problem
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: xinliangli at gmail dot com


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


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

* [Bug middle-end/35288] Expression reassociation problem
  2008-02-22  6:36 [Bug middle-end/35288] New: Expression reassociation problem xinliangli at gmail dot com
@ 2008-02-22 10:56 ` rguenth at gcc dot gnu dot org
  0 siblings, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-02-22 10:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2008-02-22 10:55 -------
Confirmed.  Re-association generates

  D.1548_3 = a1_4(D) + a1_4(D);
  b1_5 = D.1548_3 + a2_2(D);
  b2_6 = b1_5 + a2_2(D);
  D.1549_7 = b2_6 + a3_1(D);

but that does not expose SSA_NAMEs with the same value.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-02-22 10:55:53
               date|                            |


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


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

* [Bug middle-end/35288] Expression reassociation problem
       [not found] <bug-35288-4@http.gcc.gnu.org/bugzilla/>
@ 2010-11-02 23:40 ` xinliangli at gmail dot com
  0 siblings, 0 replies; 3+ messages in thread
From: xinliangli at gmail dot com @ 2010-11-02 23:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from davidxl <xinliangli at gmail dot com> 2010-11-02 23:40:15 UTC ---
LLVM got it right:


    addl    %esi, %edi
    leal    (%rdx,%rdi,2), %eax

vs gcc:


    addl    %esi, %edx
    leal    (%rsi,%rdi,2), %edi
    leal    (%rdi,%rdx), %eax

vs open64:


    leal 0(%rdi,%rsi,1), %eax         # [0] 
    addl %esi,%edx                    # [0] 
    addl %edx,%edi                    # [1] 
    addl %edi,%eax                    # [2] 

David


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

end of thread, other threads:[~2010-11-02 23:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-22  6:36 [Bug middle-end/35288] New: Expression reassociation problem xinliangli at gmail dot com
2008-02-22 10:56 ` [Bug middle-end/35288] " rguenth at gcc dot gnu dot org
     [not found] <bug-35288-4@http.gcc.gnu.org/bugzilla/>
2010-11-02 23:40 ` xinliangli 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).