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]

RFA: Fix gimple type checking for fixed-point types


The new(ish) gimple type-checking code rejects shifts of fixed-point
values, and shifts of vectors of fixed-point values, both of which are
meant to be allowed.  This causes failures in gcc.dg/fixed-point/allop.c
and gcc.dg/fixed-point/binary.c.

Tested on mips64el-linux-gnu, where it fixes the above tests.
OK to install?

Richard


gcc/
	* tree-cfg.c (verify_gimple_assign_binary): Allow shifts of
	fixed-point types, and vectors of the same.

Index: gcc/tree-cfg.c
===================================================================
--- gcc/tree-cfg.c	2009-01-02 11:41:02.000000000 +0000
+++ gcc/tree-cfg.c	2009-01-02 11:47:23.000000000 +0000
@@ -3477,7 +3477,7 @@ verify_gimple_assign_binary (gimple stmt
     case LROTATE_EXPR:
     case RROTATE_EXPR:
       {
-	if (!INTEGRAL_TYPE_P (rhs1_type)
+	if (!(INTEGRAL_TYPE_P (rhs1_type) || FIXED_POINT_TYPE_P (rhs1_type))
 	    || !INTEGRAL_TYPE_P (rhs2_type)
 	    || !useless_type_conversion_p (lhs_type, rhs1_type))
 	  {
@@ -3495,7 +3495,8 @@ verify_gimple_assign_binary (gimple stmt
     case VEC_RSHIFT_EXPR:
       {
 	if (TREE_CODE (rhs1_type) != VECTOR_TYPE
-	    || !INTEGRAL_TYPE_P (TREE_TYPE (rhs1_type))
+	    || !(INTEGRAL_TYPE_P (TREE_TYPE (rhs1_type))
+		 || FIXED_POINT_TYPE_P (TREE_TYPE (rhs1_type)))
 	    || (!INTEGRAL_TYPE_P (rhs2_type)
 		&& (TREE_CODE (rhs2_type) != VECTOR_TYPE
 		    || !INTEGRAL_TYPE_P (TREE_TYPE (rhs2_type))))


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