Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966253AbXEGS5k (ORCPT ); Mon, 7 May 2007 14:57:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S966239AbXEGS5d (ORCPT ); Mon, 7 May 2007 14:57:33 -0400 Received: from smtp1.linux-foundation.org ([65.172.181.25]:39594 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966224AbXEGS5a (ORCPT ); Mon, 7 May 2007 14:57:30 -0400 Date: Mon, 7 May 2007 11:55:15 -0700 (PDT) From: Linus Torvalds To: Johannes Stezenbach cc: Esben Nielsen , Ingo Molnar , Balbir Singh , linux-kernel@vger.kernel.org, Andrew Morton , Con Kolivas , Nick Piggin , Mike Galbraith , Arjan van de Ven , Peter Williams , Thomas Gleixner , caglar@pardus.org.tr, Willy Tarreau , Gene Heskett , Mark Lord , Zach Carter , buddabrod Subject: Re: [patch] CFS scheduler, -v8 In-Reply-To: <20070507183931.GB3472@linuxtv.org> Message-ID: References: <20070501212223.GA29867@elte.hu> <463854F3.3020403@linux.vnet.ibm.com> <20070502100545.GA6857@elte.hu> <46386F2B.9050307@linux.vnet.ibm.com> <20070502111742.GA18132@elte.hu> <20070507183931.GB3472@linuxtv.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1335 Lines: 36 On Mon, 7 May 2007, Johannes Stezenbach wrote: > > One baffling example where gcc rewrites code is when > conditionals depend on signed integer overflow: Yes. This is one of my favourite beefs with gcc. Some of the optimization decisions seem to make no sense. Your example is a good one, but my private beef has been in alias handling. Alias analysis is an important part of optimization, and there's two kinds: the static (and exact, aka "safe") kind that you can do regardless of any language definitions, because you *know* that you aren't actually changing behaviour, and the additional type-based heuristics that the C language allows. So which ones would you expect a compiler to consider more important? And which one do you think gcc will use? Right. You can have static analysis that *guarantees* that two objects alias, but if gcc determins that they have different types and thus might not alias, it decides to use the heuristic instead of the firm knowledge, and generate code that doesn't work. "Because the language definition allows it". Oh well. Linus - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/