public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/16913] New: [3.5] Regression in alias analysis
@ 2004-08-07 11:42 martin at mpa-garching dot mpg dot de
  2004-08-07 11:44 ` [Bug tree-optimization/16913] " martin at mpa-garching dot mpg dot de
                   ` (10 more replies)
  0 siblings, 11 replies; 14+ messages in thread
From: martin at mpa-garching dot mpg dot de @ 2004-08-07 11:42 UTC (permalink / raw)
  To: gcc-bugs

for the following C code the current mainline produces worse code than
the current 3.4 branch. Mainline doesn't seem to recognize that the pointers
a and b may not alias.

#define N 200

void foo ( float * restrict a, float * restrict b, int n, int j)
  {
  int i;
  for( i=0; i<n; ++i )
    a[i] = (b[j+N/4] + b[j-N/4]) * 0.5f;
  }

Compiling with mainline using -O3 -fstrict-alilasing -std=c99 -S produces
the following assembler for the loop:

.L4:
	flds	(%eax)
	fadds	(%ecx)
	fmul	%st(1), %st
	fstps	(%esi,%edx,4)
	incl	%edx
	cmpl	%edx, %ebx
	jg	.L4


The current 3.4 version produces: 
.L5:
	fsts	(%ecx,%eax,4)
	incl	%eax
	cmpl	%edx, %eax
	jl	.L5

In this case, all floating point computations are hoisted out of the loop.

-- 
           Summary: [3.5] Regression in alias analysis
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: martin at mpa-garching dot mpg dot de
                CC: gcc-bugs at gcc dot gnu dot org,martin at mpa-garching
                    dot mpg dot de
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 14+ messages in thread
[parent not found: <bug-16913-2736@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2005-10-30 22:47 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-07 11:42 [Bug tree-optimization/16913] New: [3.5] Regression in alias analysis martin at mpa-garching dot mpg dot de
2004-08-07 11:44 ` [Bug tree-optimization/16913] " martin at mpa-garching dot mpg dot de
2004-08-07 22:18 ` [Bug tree-optimization/16913] [3.5 Regression] restrict does not make a different pinskia at gcc dot gnu dot org
2004-08-18  3:33 ` zhangjie at magima dot com dot cn
2004-08-18  8:22 ` martin at mpa-garching dot mpg dot de
2004-08-19  3:12 ` zhangjie at magima dot com dot cn
2004-11-22  7:12 ` [Bug tree-optimization/16913] [4.0 " pinskia at gcc dot gnu dot org
2005-02-10 17:23 ` [Bug tree-optimization/16913] [4.0 Regression] restrict does not make a difference steven at gcc dot gnu dot org
2005-02-10 17:34 ` steven at gcc dot gnu dot org
2005-04-21  5:02 ` [Bug tree-optimization/16913] [4.0/4.1 " mmitchel at gcc dot gnu dot org
2005-07-08  1:41 ` mmitchel at gcc dot gnu dot org
2005-09-27 16:11 ` mmitchel at gcc dot gnu dot org
     [not found] <bug-16913-2736@http.gcc.gnu.org/bugzilla/>
2005-10-22  3:13 ` pinskia at gcc dot gnu dot org
2005-10-30 22:47 ` mmitchel at gcc dot gnu dot 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).