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] Fix PR32586, restore combining of conversions in SCCVN


On Fri, 7 Sep 2007, Richard Guenther wrote:

> On Fri, 7 Sep 2007, Eric Botcazou wrote:
> 
> > > I declare it bad memory in the machine I tested on.  I cannot reproduce
> > > it on two others and thus have re-applied the SCCVN patch.
> > 
> > The aliasing issue in raise-gcc.c comes from a glitch on our side.  But
> >    http://gcc.gnu.org/ml/gcc/2007-09/msg00094.html
> 
> On the "bad" machine I can reproduce the miscompare the difference is

[...]

The difference first appears with the 050t.apply_inline dump with
differing UIDs.  One thing that is different (though only after the
gimplifier, and reportedly this doesn't fix it) is that the type
verifier is enabled for stage1 and it might create not seen pointer-types.
The following makes 100% sure this doesn't happen.

I'm currently checking if this fixes the UID differences and will
apply it even if it doesn't (but bootstraps ok on the machine not
showing the bootstrap error).

Richard.

2007-09-07  Richard Guenther  <rguenther@suse.de>

	* tree-cfg.c (verify_gimple_expr): Avoid building new
	pointer types, use TYPE_POINTER_TO if available instead.

Index: tree-cfg.c
===================================================================
*** tree-cfg.c	(revision 128251)
--- tree-cfg.c	(working copy)
*************** verify_gimple_expr (tree expr)
*** 3770,3791 ****
      case ADDR_EXPR:
        {
  	tree op = TREE_OPERAND (expr, 0);
- 	tree ptr_type;
  	if (!is_gimple_addressable (op))
  	  {
  	    error ("invalid operand in unary expression");
  	    return true;
  	  }
! 	ptr_type = build_pointer_type (TREE_TYPE (op));
! 	if (!useless_type_conversion_p (type, ptr_type)
  	    /* FIXME: a longstanding wart, &a == &a[0].  */
  	    && (TREE_CODE (TREE_TYPE (op)) != ARRAY_TYPE
! 		|| !useless_type_conversion_p (type,
! 			build_pointer_type (TREE_TYPE (TREE_TYPE (op))))))
  	  {
  	    error ("type mismatch in address expression");
  	    debug_generic_stmt (TREE_TYPE (expr));
! 	    debug_generic_stmt (ptr_type);
  	    return true;
  	  }
  
--- 3770,3792 ----
      case ADDR_EXPR:
        {
  	tree op = TREE_OPERAND (expr, 0);
  	if (!is_gimple_addressable (op))
  	  {
  	    error ("invalid operand in unary expression");
  	    return true;
  	  }
! 	if (TYPE_POINTER_TO (TREE_TYPE (op))
! 	    && !useless_type_conversion_p (type,
! 					   TYPE_POINTER_TO (TREE_TYPE (op)))
  	    /* FIXME: a longstanding wart, &a == &a[0].  */
  	    && (TREE_CODE (TREE_TYPE (op)) != ARRAY_TYPE
! 		|| (TYPE_POINTER_TO (TREE_TYPE (TREE_TYPE (op)))
! 		    && !useless_type_conversion_p (type,
! 			  TYPE_POINTER_TO (TREE_TYPE (TREE_TYPE (op)))))))
  	  {
  	    error ("type mismatch in address expression");
  	    debug_generic_stmt (TREE_TYPE (expr));
! 	    debug_generic_stmt (TYPE_POINTER_TO (TREE_TYPE (op)));
  	    return true;
  	  }
  


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