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]

[tree-ssa] Fix handling of BIT_FIELD_REFs and VECTOR_TYPEs.


I found these while working on tree-level lowering of
vector operations, which exercise BIT_FIELD_REFs on
the first operand of MODIFY_EXPRs.  Also, they make
vectors use virtual operands, just like complex
numbers (which are the thing most similar to vectors
in the compiler).

While I have tested this on some testcases, I have no
time right now to bootstrap and regtest everything
with this patch only.  Ok if it bootstraps/regtests?

Paolo

2004-03-22 Paolo Bonzini  <bonzini@gnu.org>

	* tree-alias-common.c (find_func_aliases): Handle
	MODIFY_EXPRs where the first operand is a BIT_FIELD_REF.
	* tree-simple.c: Document that a BIT_FIELD_REF is a
	valid GIMPLE lvalue.
	(is_gimple_reg_type): A VECTOR_TYPE does not behave like
	a scalar.
	* tree-ssa-operands.c (get_expr_operands): Glob references
	made through BIT_FIELD_REF.
	* tree-ssa.c (set_is_used): Go through BIT_FIELD_REFs.

Index: gcc/tree-alias-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-alias-common.c,v
retrieving revision 1.1.2.53
diff -u -r1.1.2.53 tree-alias-common.c
--- gcc/tree-alias-common.c	12 Mar 2004 17:49:52 -0000	1.1.2.53
+++ gcc/tree-alias-common.c	22 Mar 2004 14:49:34 -0000
@@ -629,7 +629,8 @@
       else
 	{
 	  /* x.f = y  or x->f = y */
-	  if (TREE_CODE (op0) == COMPONENT_REF 
+	  if ((TREE_CODE (op0) == COMPONENT_REF 
+	       || TREE_CODE (op0) == BIT_FIELD_REF)
 	      && is_gimple_variable (op1))
 	    {
 	      if (rhsAV != NULL)
Index: gcc/tree-simple.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-simple.c,v
retrieving revision 1.1.4.74
diff -u -r1.1.4.74 tree-simple.c
--- gcc/tree-simple.c	12 Mar 2004 04:19:06 -0000	1.1.4.74
+++ gcc/tree-simple.c	22 Mar 2004 14:49:35 -0000
@@ -113,8 +113,13 @@
      op1 -> arglist
 
    addr-expr-arg : compref | ID
-   lhs: addr-expr-arg | '*' ID
+   lhs: addr-expr-arg | '*' ID | bitfieldref
    min-lval: ID | '*' ID
+   bitfieldref :
+     BIT_FIELD_REF
+       op0 -> compref | min-lval
+       op1 -> CONST
+       op2 -> CONST
    compref :
      COMPONENT_REF
        op0 -> compref | min-lval
@@ -413,6 +418,7 @@
 is_gimple_reg_type (tree type)
 {
   return (!AGGREGATE_TYPE_P (type)
+          && TREE_CODE (type) != VECTOR_TYPE
           && TREE_CODE (type) != COMPLEX_TYPE);
 }
 
Index: gcc/tree-ssa-operands.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-operands.c,v
retrieving revision 1.1.2.17
diff -u -r1.1.2.17 tree-ssa-operands.c
--- gcc/tree-ssa-operands.c	16 Mar 2004 22:31:56 -0000	1.1.2.17
+++ gcc/tree-ssa-operands.c	22 Mar 2004 14:49:36 -0000
@@ -1012,7 +1012,8 @@
 	   will not be constant propagated because the two partial
 	   definitions to 'a' will kill each other.  Note that SRA may be
 	   able to fix this problem if 'a' can be scalarized.  */
-  if (code == IMAGPART_EXPR || code == REALPART_EXPR || code == COMPONENT_REF)
+  if (code == IMAGPART_EXPR || code == REALPART_EXPR || code == COMPONENT_REF
+      || code == BIT_FIELD_REF)
     {
       /* If the LHS of the compound reference is not a regular variable,
 	 recurse to keep looking for more operands in the subexpression.  */
Index: gcc/tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa.c,v
retrieving revision 1.1.4.216
diff -u -r1.1.4.216 tree-ssa.c
--- gcc/tree-ssa.c	19 Mar 2004 02:07:25 -0000	1.1.4.216
+++ gcc/tree-ssa.c	22 Mar 2004 14:49:36 -0000
@@ -435,6 +435,7 @@
 	case COMPONENT_REF:
 	case REALPART_EXPR:
 	case IMAGPART_EXPR:
+	case BIT_FIELD_REF:
 	case INDIRECT_REF:
 	  t = TREE_OPERAND (t, 0);
 	  break;


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