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

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to H.J. Lu from comment #12)
> ix86_find_max_used_stack_alignment fails to detect that
> 
> (insn 281 152 282 34 (set (mem/c:V16QI (reg/f:DI 2 cx [144]) [0 MEM
> <char[1:32]> [(void *)_109]+0 S16 A128])
>         (reg:V16QI 21 xmm1 [orig:156 MEM <char[1:32]> [(void *)_109] ]
> [156])) "x.c":53:12 1824 {movv16qi_internal}
>      (nil))
> 
> requires 16-byte aligned stack.

I guess it raises 3 questions:
1) why hasn't combine or cse etc. merged the
(insn 153 152 154 38 (parallel [
            (set (reg:DI 135)
                (plus:DI (reg/f:DI 19 frame)
                    (const_int -32 [0xffffffffffffffe0])))
            (clobber (reg:CC 17 flags))
        ]) "pr109093-8.c":59:12 247 {*adddi_1}
     (nil))
into the stores?  Seems cprop2 hoists it before the loop instead, but that
doesn't seem to be a win when it is something that can refer to the stack
directly
2) ix86_find_max_used_stack_alignment only goes after MEMs which mention
sp/frame, so isn't able to discover the cases where lea sp + offset is stored
into some register and later used in some MEM; shall it take into account also
MEMs which have local automatic vars in MEM_EXPR regardless of whether they
requires_stack_frame_p or not, and regardless of whether they mention sp/frame
or not?  Or say use cselib to see through VALUEs (though I'm afraid even that
wouldn't catch reliably everything).

Reply via email to