Bug 41770

Summary: graphite miscompiles 434.zeusmp of the SPEC 2k6
Product: gcc Reporter: Sebastian Pop <spop>
Component: middle-endAssignee: Sebastian Pop <spop>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs
Priority: P3    
Version: 4.5.0   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2009-10-20 18:56:19

Description Sebastian Pop 2009-10-20 18:55:17 UTC
On the "test" data set, (not the "ref" data set) of 434.zeusmp
there is a miscompare when using -fgraphite-identity.
This failure appeared with my patch to handle reductions:

Rewrite reductions out of SSA.

2009-07-28  Sebastian Pop  <sebastian.pop@amd.com>
	* graphite-sese-to-poly.c (loop_entry_phi_arg): New.
	(remove_simple_copy_phi): New.
	(remove_invariant_phi): New.
	(simple_copy_phi_p): New.
	(reduction_phi_p): New.
	(gsi_for_ssa_name_def): New.
	(insert_out_of_ssa_copy): New.
	(insert_out_of_ssa_copy_on_edge): New.
	(create_zero_dim_array): New.
	(scalar_close_phi_node_p): New.
	(rewrite_close_phi_out_of_ssa): New.
	(rewrite_phi_out_of_ssa): New.
	(rewrite_reductions_out_of_ssa): New.
	(build_poly_scop): Call rewrite_reductions_out_of_ssa.

The kernel that is miscompiled looks like this:


      subroutine diverg ( isum, div, sumd )

      integer in, jn, kn
      parameter(in =           128+5
     &        , jn =           128+5
     &        , kn =           128+5)

      integer is, ie, js, je, ks, ke
      common /gridcomi/
     &   is, ie, js, je, ks, ke

       integer       i       , j       , k
       real*8  div     (  in,  jn,  kn)

       sumd = 0.0
       if (isum .eq. 1) then
         do 60 k=ks,ke
           do 50 j=js,je
             do 40 i=is,ie
               sumd = sumd + div(i,j,k)
40           continue
50         continue
60       continue
       endif
       return
       end
Comment 1 Sebastian Pop 2009-10-22 23:03:05 UTC
Fixed.