This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: function arguments offset computation with -fomit-frame-pointer


On Wed, 2003-07-09 at 08:16, Peter Barada wrote:
> http://gcc.gnu.org/ml/gcc/2002-04/msg00009.html
> for the root of the discussion thread.

I looked through this thread.  Richard Henderson points out that the arm
explicitly disallows the same register in the source and in a dest
pre-dec address, so this patch would apparently break the arm.

It does make a bit of sense though.  On the m68k, a pre_dec in the dest
is computed after the source.  This is apparently also true on the i386,
since the manual says pushl esp pushes the original value of esp. 
However, we would need to need make this target dependent, and it isn't
clear that we gain much from this.

I was wondering why x86 doesn't have the same problem, and I noticed
that its push patterns explicitly disallow eliminable registers to avoid
the problem.  This results in one extra instruction for your example,
but allows the register elimination to succeed, so the result may still
be better.  It also avoids the need for a reload patch.  And we can
probably get rid of the extra instruction by making the check for
eliminable registers depend on !reload_completed, so that a post-reload
optimization pass can eliminate the extra instruction.

See for instance the pushsi pattern in i386.md, and the
general_no_elim_operand predicate that it uses.

Jim



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]