[lkml]   [2005]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [-mm patch] make kcalloc() a static inline
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, so if
the check is done before, the "possible range" will be such that the
divide should be optimizable.

(Note: this is a relatively new feature in gcc though)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-08-15 11:44    [W:0.038 / U:2.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site