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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
          Component|middle-end                  |target

--- Comment #12 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Jakub Jelinek from comment #11)
> (In reply to Uroš Bizjak from comment #10)
> > (In reply to Jakub Jelinek from comment #9)
> > Years ago, I defined HAVE_PRE_DEC, and I was told that it is intended for
> > targets that can increment pointer on *any* memory access, not just on stack
> > pointer. So, x86 uses PRE_DEC and POST_INC only to abstract push and pop
> > insn. Various parts of the compiler (modulo auto-inc-dec.c) mostly check for
> > PRE_DEC and POST_INC to skip further optimizations, which is non-issue for
> > push and pop.
> > 
> > But this generic part of the code assumes that any target can handle
> > PRE_MODIFY, and emits insn even for !HAVE_PRE_MODIFY_DISP. This is
> > conservatively incorrect, so conditionally disabling the part that blindly
> > emits PRE_MODIFY is IMO the way to go.
> 
> But isn't that the same?  Targets can only define HAVE_PRE_MODIFY_DISP, if
> they support PRE_MODIFY with arbitrary registers, but when they only support
> it with the stack pointer, they can't.

Yes, this makes sense. I have a patch.

Reply via email to