This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/24419] ix86 prologue clobbers memory when it shouldn't
- From: "hjl at lucon dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Oct 2005 17:50:37 -0000
- Subject: [Bug target/24419] ix86 prologue clobbers memory when it shouldn't
- References: <bug-24419-682@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from hjl at lucon dot org 2005-10-18 17:50 -------
We only run into the problem with red zone enabled, which is x86-64. We have
2 issues:
1. When prologue uses mov, memory shouldn't be clobbered. But
ix86_expand_prologue calls pro_epilogue_adjust_stack which clobbers
memory.
2. We convert stack pointer subtractions to push even when memory isn't
clobbered with patterns like
;; Convert esp subtractions to push.
(define_peephole2
[(match_scratch:SI 0 "r")
(parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int
-4)))
(clobber (reg:CC FLAGS_REG))])]
"optimize_size || !TARGET_SUB_ESP_4"
[(clobber (match_dup 0))
(set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0))])
I don't think we can do that since push will clobber memory.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24419