http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54089
--- Comment #5 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-08-09 23:17:54
UTC ---
OK, I checking out the preprocessed file reveals the following relevant pieces:
typedef struct page {
struct list_head list;
struct address_space *mapping;
unsigned long index;
struct page *next_hash;
atomic_t count;
unsigned long flags; // <<<<
struct list_head lru;
struct page **pprev_hash;
struct buffer_head * buffers;
} mem_map_t;
static inline zone_t *page_zone(struct page *page)
{
return zone_table[page->flags >> (64 - 8)]; // = page->flags >> 56
}
Depending on whether SHIFT_COUNT_TRUNCATED evals to 1 or 0, the function above
returns either zone_table[0] (dyn shifts) or zone_table[page->flags >> 24] (no
dyn shifts). Both should be OK to do, since that's undefined behavior.
In this case maybe fixing SHIFT_COUNT_TRUNCATED to '0' would be better, since
that would produce faster undefined behavior code ;)