This is the mail archive of the gcc-patches@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: PATCH commited to dataflow branch.


I've not been following this discussion in all its technical detail, but
there's an issue here that I think is worth highlighting in case it's
been overlooked.

Register elimination can sometimes eliminate a 'frame' register into a
use of the stack pointer.  While it is normally perfectly acceptable to
auto-modify a frame register (it's just a pointer into the stack), this
is not generally true of the stack pointer.  While it is a pointer into
the stack it is also much more than that: it indicates the extent of the
stack allocated, so an auto-modify memory access not only loads/stores a
value, but it also allocates, or frees some stack space.  In some
operating environments the run-time system may use any unallocated part
of the stack for its own nefarious purposes.  So for example:

(set x (mem:si (post_inc(sp)))

(nop)

(set y (mem:SI (pre_dec(sp)))

does not necessarily set y to the same value as x.  Yet the above
sequence would be perfectly safe if we substitute FP for SP.

R.


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