From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeffrey A Law To: Sumner Reuben Cc: egcs@cygnus.com Subject: Re: egcs 1.0.2 success and problem Date: Sat, 31 Oct 1998 05:02:00 -0000 Message-id: <9012.909826854@hurl.cygnus.com> References: <199804052121.AAA00146@hadar.wisdom.weizmann.ac.il> X-SW-Source: 1998-10/msg01313.html In message <199804052121.AAA00146@hadar.wisdom.weizmann.ac.il>you write: > I successfully compiled egcs 1.0.2 on RedHat 5.0 (no surprise I'm sure) > I haven't included config.guess if you want it just ask. > > I noticed an optimization problem with gcc 2.7.2 and it is still present > in egcs 1.0.2 (I specifically wanted to test this problem). I have pared > down the sources a fair bit, if I need to do more I will try. I believe if you try the current sources in the egcs CVS tree you'll find that the second (and more important) loop in your testcase is optimized noticably better now. Here's what you were getting: > .L11: > movl 8(%ebp),%edx > movl (%edx),%edx > movl %edx,%eax > xorl %edx,%edx > movl %eax,-16(%ebp) > movl %edx,-12(%ebp) > movl 8(%ebp),%edx > movl 4(%edx),%esi > movl 12(%edx),%ebx > movl 12(%ebp),%eax > movl (%ebx,%esi,4),%ecx > mull %ecx > movl %eax,-8(%ebp) > movl %edx,-4(%ebp) > pushl -12(%ebp) > pushl -16(%ebp) > pushl -4(%ebp) > pushl -8(%ebp) > call __umoddi3 > movl %eax,-16(%ebp) > movl %edx,-12(%ebp) > addl $16,%esp > movl -16(%ebp),%edx > movl 8(%ebp),%eax > incl %edi > movl %edx,(%ebx,%esi,4) > cmpl %edi,4(%eax) > ja .L11 Here's what I get with the current sources: .L11: movl -4(%ebp),%ebx movl 12(%ebp),%eax movl (%ebx,%edi,4),%ecx mull %ecx movl 8(%ebp),%ecx movl %eax,-12(%ebp) movl %edx,-8(%ebp) movl (%ecx),%eax xorl %edx,%edx pushl %edx pushl %eax movl -12(%ebp),%eax movl -8(%ebp),%edx pushl %edx pushl %eax call __umoddi3 movl 8(%ebp),%edx addl $16,%esp movl %eax,(%ebx,%edi,4) incl %esi movl 4(%edx),%eax movl %eax,%edi cmpl %edi,%esi jb .L11