https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109093

--- Comment #20 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to H.J. Lu from comment #19)
> .DEFERRED_INIT has
> 
> insn 259 261 297 4 (set (reg/f:DI 144) 
>         (plus:DI (reg/f:DI 19 frame)
>             (const_int -32 [0xffffffffffffffe0]))) 241 {*leadi}
>      (expr_list:REG_EQUAL (plus:DI (reg/f:DI 19 frame)
>             (const_int -32 [0xffffffffffffffe0]))
>         (nil)))
> 
> vs explicit __builtin_memset
> 
> insn 264 149 153 34 (set (reg/f:DI 144) 
>         (plus:DI (reg/f:DI 19 frame)
>             (const_int -32 [0xffffffffffffffe0]))) 241 {*leadi}
>      (expr_list:REG_EQUIV (plus:DI (reg/f:DI 19 frame)
>             (const_int -32 [0xffffffffffffffe0]))
>         (nil)))
> 
> LRA can eliminate (reg/f:DI 144) with REG_EQUIV, but not with REG_EQUAL.

Neither .DEFERRED_INIT nor explicit zero initialization fills those at all, try
-O2 -ftrivial-auto-var-init=zero:
void foo (char *);

void
bar (void)
{
  char a[48];
  char b[48] = {};
  foo (a);
  foo (b);
}

REG_EQUAL (in both cases) is added during cse1.

Reply via email to