This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch][graphite] Rewrite of "out of graphite"


On Wed, 3 Dec 2008, Sebastian Pop wrote:

> Hi,
> 
> On Wed, Dec 3, 2008 at 4:22 AM, Richard Guenther <rguenther@suse.de> wrote:
> > The middle-end parts could have been splitted ;)  The middle-end parts
> > are ok, the graphite parts as well, but you may want to wait for more
> > comments from other graphite reviewers.
> >
> 
> Thanks for the review Richi.  Other Graphite reviewers, if you have
> time, please send me comments on the patches.  I plan to commit
> the previous patch to trunk on Friday or Monday to let you enough
> time to review.
> 
> Here is another patch fixing id-1.f90 that is a type conversion
> problem arising when expanding to RTL.  I committed this to the
> graphite branch.  Okay for trunk after regtest passes on amd64-linux?

The following (and similar cases) are clearly bogus:

            else if (r->n == 2)
              {
-               left = clast_to_gcc_expression (r->elts[0], params,
ivstack);
-               right = clast_to_gcc_expression (r->elts[1], params,
ivstack);
-               return fold_build2 (MIN_EXPR, type, left, right);
+               tree tl = clast_to_gcc_expression (r->elts[0], params,
ivstack);
+               tree tr = clast_to_gcc_expression (r->elts[1], params,
ivstack);
+               tree type = max_precision_type (tl, tr);
+               return fold_build2 (MIN_EXPR, type, tl, tr);
              }


you are inserting promotions (well, you are not - you miss
fold_converts to type for both arguments), but this is not your job
but the frontends.

Try the following patch to see if there are type issues with the
graphite.

Richard.

2008-09-11  Richard Guenther  <rguenther@suse.de>

	* tree-cfg.c (remove_useless_stmts): Verify stmts afterwards.
	(verify_stmts): Dispatch to gimple/type verification code.

Index: trunk/gcc/tree-cfg.c
===================================================================
*** trunk.orig/gcc/tree-cfg.c
--- trunk/gcc/tree-cfg.c
*************** remove_useless_stmts (void)
*** 2024,2029 ****
--- 2024,2034 ----
        remove_useless_stmts_1 (&gsi, &data);
      }
    while (data.repeat);
+ 
+ #ifdef ENABLE_TYPES_CHECKING
+   verify_types_in_gimple_seq (gimple_body (current_function_decl));
+ #endif
+ 
    return 0;
  }
  
*************** verify_stmts (void)
*** 4153,4158 ****
--- 4210,4221 ----
  		  err |= true;
  		}
  	    }
+ 
+ 	  if (verify_gimple_phi (phi))
+ 	    {
+ 	      debug_gimple_stmt (phi);
+ 	      err |= true;
+ 	    }
  	}
  
        for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); )
*************** verify_stmts (void)
*** 4189,4194 ****
--- 4252,4263 ----
  	    }
  
  	  err |= verify_stmt (&gsi);
+ 
+ 	  if (verify_types_in_gimple_stmt (gsi_stmt (gsi)))
+ 	    {
+ 	      debug_gimple_stmt (stmt);
+ 	      err |= true;
+ 	    }
  	  addr = walk_gimple_op (gsi_stmt (gsi), verify_node_sharing, &wi);
  	  if (addr)
  	    {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]