This is the mail archive of the gcc@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: Comment mismatch in tree-cfg.c:verify_gimple_expr


On Fri, 31 Aug 2007, Richard Guenther wrote:

> On Fri, 31 Aug 2007, Diego Novillo wrote:
> 
> > 
> > Richard, this comment does not match the code.  The code allows type
> > conversions between two integral types and between arbitrary types that
> > happen to *not* be integral.  Which semantics did you mean here?
> > 
> >         /* Allow conversions between integral types.  */
> >         if (INTEGRAL_TYPE_P (type) == INTEGRAL_TYPE_P (TREE_TYPE (op)))
> >           return false;
> > 
> > I'm thinking this should be && not ==.
> 
> Whoops.  Indeed.  Now - no guarantee that this won't "break" anything
> of course... (I'll check on the mainline)

I'm checking the following.

Richard.

2007-08-31  Richard Guenther  <rguenther@suse.de>

	* tree-cfg.c (verify_gimple_expr): Fix check for conversions
	between integral types.  Also allow conversions between
	pointer types.

Index: tree-cfg.c
===================================================================
*** tree-cfg.c	(revision 127968)
--- tree-cfg.c	(working copy)
*************** verify_gimple_expr (tree expr)
*** 3574,3581 ****
  	    return true;
  	  }
  
! 	/* Allow conversions between integral types.  */
!         if (INTEGRAL_TYPE_P (type) == INTEGRAL_TYPE_P (TREE_TYPE (op)))
  	  return false;
  
  	/* Allow conversions between integral types and pointers only if
--- 3574,3583 ----
  	    return true;
  	  }
  
! 	/* Allow conversions between integral types and between
! 	   pointer types.  */
!         if ((INTEGRAL_TYPE_P (type) && INTEGRAL_TYPE_P (TREE_TYPE (op)))
! 	    || (POINTER_TYPE_P (type) && POINTER_TYPE_P (TREE_TYPE (op))))
  	  return false;
  
  	/* Allow conversions between integral types and pointers only if


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