On Mon, Aug 15, 2005 at 04:06:22PM +0300, Pekka J Enberg wrote:
> On Mon, 2005-08-15 at 15:17 +0300, Denis Vlasenko wrote:
> > > Seems like that optimization is not helping.
> > > Do you have better example?
>
> On Mon, 15 Aug 2005, Arjan van de Ven wrote:
> > you need gcc 4.1 (eg CVS) for the val
On Llu, 2005-08-15 at 16:06 +0300, Pekka J Enberg wrote:
> and I saw small reduction in kernel text with kcalloc() inlined. If GCC
> is, in fact, spreading the extra operations everywhere, shouldn't kernel
> text be bigger?
Only if the cost of the function call in lines of code is higher than
t
On Mon, 2005-08-15 at 15:17 +0300, Denis Vlasenko wrote:
> > Seems like that optimization is not helping.
> > Do you have better example?
On Mon, 15 Aug 2005, Arjan van de Ven wrote:
> you need gcc 4.1 (eg CVS) for the value range propagation stuff.
For Denis' example, it does not seem to help. I
On Mon, 2005-08-15 at 15:17 +0300, Denis Vlasenko wrote:
> Seems like that optimization is not helping.
> Do you have better example?
you need gcc 4.1 (eg CVS) for the value range propagation stuff.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a messa
On Monday 15 August 2005 12:41, Arjan van de Ven wrote:
> On Mon, 2005-08-15 at 12:33 +0300, Denis Vlasenko wrote:
>
> > gcc can optimize that away with non-const n?! I don't think so.
>
> due to the wonders of "value range propagation" it actually can, if the
> check is done sufficiently before.
On Mon, 2005-08-15 at 12:33 +0300, Denis Vlasenko wrote:
> gcc can optimize that away with non-const n?! I don't think so.
due to the wonders of "value range propagation" it actually can, if the
check is done sufficiently before...
gcc keeps track of the range a variable can have at each point,
> > static inline void *kcalloc(size_t n, size_t size, unsigned int __nocast
> > flags)
> > {
> > if (__builtin_constant_p(n)) {
> > if (n != 0 && size > INT_MAX / n)
> > return NULL;
> > return kzalloc(n * size, flags);
> > }
> > return kcal
On Mon, 15 Aug 2005, Denis Vlasenko wrote:
> Sure, I don't want to disable the check. I want that check to be
> in _non-inlined function_.
>
> static inline void *kcalloc(size_t n, size_t size, unsigned int __nocast
> flags)
> {
> if (__builtin_constant_p(n)) {
> if (n != 0 &&
On Monday 15 August 2005 11:14, Arjan van de Ven wrote:
> On Mon, 2005-08-15 at 11:06 +0300, Denis Vlasenko wrote:
>
> > > +static inline void *kcalloc(size_t n, size_t size, unsigned int __nocast
> > > flags)
> > > +{
> > > + if (n != 0 && size > INT_MAX / n)
> > > + return NULL;
> > > +
On Mon, 2005-08-15 at 11:06 +0300, Denis Vlasenko wrote:
> > +static inline void *kcalloc(size_t n, size_t size, unsigned int __nocast
> > flags)
> > +{
> > + if (n != 0 && size > INT_MAX / n)
> > + return NULL;
> > + return kzalloc(n * size, flags);
> > +}
> Can you conditionalize
On Tuesday 09 August 2005 01:38, Adrian Bunk wrote:
> kcalloc() doesn't do much more than calling kzalloc(), and gcc has
> better optimizing opportunities when it's inlined.
>
> The result of this patch with a fulll kernel compile (roughly equivalent
> to "make allyesconfig") shows a minimal siz
kcalloc() doesn't do much more than calling kzalloc(), and gcc has
better optimizing opportunities when it's inlined.
The result of this patch with a fulll kernel compile (roughly equivalent
to "make allyesconfig") shows a minimal size improvement:
text data bss dec
12 matches
Mail list logo