This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: memcpy


On Wed, Feb 19, 2003 at 06:32:02PM -0800, Nathan Myers wrote:
> Cool!  But why would the optimizer *care* whether s is const, but
> not x and y?

The optimizers don't care; we've lost before we get that far.

The inliner is dumb though, and won't substitute constants
unless the parameter is const.  This is because it does no
data flow.  However if the parameter is const, it gets this
info for free.

The builtin expander cares whether or not s is constant
because it is unwilling to expand code inline to handle
arbitrary sizes.  Which is reasonable.  At present, however,
the builtin expander is run before the optimizers so we don't
get a chance to do normal constant propagation.

> But it seems to me the compiler would be freer the other way,
> allowed to clobber the registers that x, y, and s are (were) in.

We're way before even thinking about registers.  We're not
constraining the register allocator one whit.


r~


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