On 2022/05/27 12:00, Takayuki 'January June' Suwa via Gcc-patches wrote:
On 2022/05/27 1:57, Max Filippov wrote:
is that something that can be addressed in this patch?

seems hard to resolve, because the RTL-generation pass passes only 68 bytes in that case:

the culprit is here, but i don't know whether it is known regression or not.

diff --git a/gcc/expr.cc b/gcc/expr.cc
index 7197996cec7..be100dd9946 100644
--- a/gcc/expr.cc
+++ b/gcc/expr.cc
@@ -6043,13 +6043,19 @@ store_expr (tree exp, rtx target, int call_param_p,
       if (!can_store_by_pieces (str_copy_len, string_cst_read_str,
                                (void *) str, MEM_ALIGN (target), false))
        goto normal_expr;
-
- dest_mem = store_by_pieces (target, str_copy_len, string_cst_read_str,
-                                 (void *) str, MEM_ALIGN (target), false,
-                                 RETURN_END);
-      clear_storage (adjust_address_1 (dest_mem, BLKmode, 0, 1, 1, 0,
-                                      exp_len - str_copy_len),
-                    GEN_INT (exp_len - str_copy_len), BLOCK_OP_NORMAL);
+      if (TREE_STRING_LENGTH (str) == 1 && *TREE_STRING_POINTER (str) == 0)
+       clear_storage (adjust_address_1 (target, BLKmode, 0, 1, 1, 0,
+                                        exp_len),
+                      GEN_INT (exp_len), BLOCK_OP_NORMAL);
+      else
+       {
+         dest_mem = store_by_pieces (target, str_copy_len, string_cst_read_str,
+                                     (void *) str, MEM_ALIGN (target), false,
+                                     RETURN_END);
+         clear_storage (adjust_address_1 (dest_mem, BLKmode, 0, 1, 1, 0,
+                                          exp_len - str_copy_len),
+                        GEN_INT (exp_len - str_copy_len), BLOCK_OP_NORMAL);
+       }
       return NULL_RTX;
     }
   else

Reply via email to