From 78a2f6c2bb7aff92dcf7bdd41a955dbed6ccabbf Mon Sep 17 00:00:00 2001
From: rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 26 Jan 2005 23:21:45 +0000
Subject: [PATCH] Revert last change.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94291 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog |  4 ++++
 gcc/c-decl.c  |  7 ++-----
 gcc/expmed.c  |  2 +-
 gcc/expr.c    | 16 +---------------
 4 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7b5f4dc2ca41..288527460ae8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2005-01-26  Richard Henderson  <rth@redhat.com>
+
+	* c-decl.c, expmed.c, expr.c: Revert last change.
+
 2005-01-26  Richard Henderson  <rth@redhat.com>
 
 	PR middle-end/18008
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 61521e861c7b..6673927eab60 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -5301,11 +5301,8 @@ finish_struct (tree t, tree fieldlist, tree attributes)
 	    = tree_low_cst (DECL_INITIAL (*fieldlistp), 1);
 	  tree type = TREE_TYPE (*fieldlistp);
 	  if (width != TYPE_PRECISION (type))
-	    {
-	      TREE_TYPE (*fieldlistp)
-	        = build_nonstandard_integer_type (width, TYPE_UNSIGNED (type));
-	      DECL_MODE (*fieldlistp) = TYPE_MODE (TREE_TYPE (*fieldlistp));
-	    }
+	    TREE_TYPE (*fieldlistp)
+	      = build_nonstandard_integer_type (width, TYPE_UNSIGNED (type));
 	  DECL_INITIAL (*fieldlistp) = 0;
 	}
       else
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 084a987fdc04..1091c454064a 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -878,7 +878,7 @@ store_fixed_bit_field (rtx op0, unsigned HOST_WIDE_INT offset,
       if (GET_MODE (value) != mode)
 	{
 	  if ((REG_P (value) || GET_CODE (value) == SUBREG)
-	      && GET_MODE_SIZE (GET_MODE (value)) <= bitsize)
+	      && GET_MODE_SIZE (mode) < GET_MODE_SIZE (GET_MODE (value)))
 	    value = gen_lowpart (mode, value);
 	  else
 	    value = convert_to_mode (mode, value, 1);
diff --git a/gcc/expr.c b/gcc/expr.c
index 1f82b1d98346..ed693a3166f6 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -5215,21 +5215,7 @@ store_field (rtx target, HOST_WIDE_INT bitsize, HOST_WIDE_INT bitpos,
 	  && TREE_CODE (TYPE_SIZE (TREE_TYPE (exp))) == INTEGER_CST
 	  && compare_tree_int (TYPE_SIZE (TREE_TYPE (exp)), bitsize) != 0))
     {
-      rtx temp;
-
-      /* If EXP is a NOP_EXPR of precision less than its mode, then that
-	 implies a mask operation.  If the precision is the same size as
-	 the field we're storing into, that mask is redundant.  This is
-	 particularly common with bit field assignments generated by the
-	 C front end.  */
-      if (TREE_CODE (exp) == NOP_EXPR
-	  && INTEGRAL_TYPE_P (TREE_TYPE (exp))
-	  && (TYPE_PRECISION (TREE_TYPE (exp))
-	      < GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (exp))))
-	  && bitsize == TYPE_PRECISION (TREE_TYPE (exp)))
-	exp = TREE_OPERAND (exp, 0);
-
-      temp = expand_expr (exp, NULL_RTX, VOIDmode, 0);
+      rtx temp = expand_expr (exp, NULL_RTX, VOIDmode, 0);
 
       /* If BITSIZE is narrower than the size of the type of EXP
 	 we will be narrowing TEMP.  Normally, what's wanted are the
-- 
GitLab