]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
expr.c (store_expr): In condition for checking if value is generated in TARGET...
authorHans-Peter Nilsson <hp@bitrange.com>
Mon, 12 Aug 2002 00:57:55 +0000 (00:57 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Mon, 12 Aug 2002 00:57:55 +0000 (00:57 +0000)
* expr.c (store_expr): In condition for checking if value is
generated in TARGET, move call to expr_size last.

From-SVN: r56217

gcc/ChangeLog
gcc/expr.c

index 0282381902d70e78aac26de34d954198f1bf532d..00690e6614d020c3e03e6718cbee88cd1b7150fa 100644 (file)
@@ -1,3 +1,8 @@
+2002-08-12  Hans-Peter Nilsson  <hp@bitrange.com>
+
+       * expr.c (store_expr): In condition for checking if value is
+       generated in TARGET, move call to expr_size last.
+
 2002-08-11  Neil Booth  <neil@daikokuya.co.uk>
 
        * c-common.c (c_common_init): Call preprocess_file instead.
index 5ee1ef36752a55ded17507810e55b9d462c7bcb9..123398a901a6145f96ac422240947ecfe8ea449a 100644 (file)
@@ -4238,14 +4238,17 @@ store_expr (exp, target, want_value)
        || (temp != target && (side_effects_p (temp)
                              || side_effects_p (target))))
       && TREE_CODE (exp) != ERROR_MARK
-      /* If there's nothing to copy, don't bother.  */
-      && expr_size (exp) != const0_rtx
       && ! dont_store_target
         /* If store_expr stores a DECL whose DECL_RTL(exp) == TARGET,
            but TARGET is not valid memory reference, TEMP will differ
            from TARGET although it is really the same location.  */
       && (TREE_CODE_CLASS (TREE_CODE (exp)) != 'd'
-         || target != DECL_RTL_IF_SET (exp)))
+         || target != DECL_RTL_IF_SET (exp))
+      /* If there's nothing to copy, don't bother.  Don't call expr_size
+        unless necessary, because some front-ends (C++) expr_size-hook
+        aborts on objects that are not supposed to be bit-copied or
+        bit-initialized.  */
+      && expr_size (exp) != const0_rtx)
     {
       target = protect_from_queue (target, 1);
       if (GET_MODE (temp) != GET_MODE (target)