Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262422AbTFORLB (ORCPT ); Sun, 15 Jun 2003 13:11:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262427AbTFORLA (ORCPT ); Sun, 15 Jun 2003 13:11:00 -0400 Received: from neon-gw-l3.transmeta.com ([63.209.4.196]:39684 "EHLO neon-gw.transmeta.com") by vger.kernel.org with ESMTP id S262422AbTFORKx (ORCPT ); Sun, 15 Jun 2003 13:10:53 -0400 Date: Sun, 15 Jun 2003 10:24:13 -0700 (PDT) From: Linus Torvalds To: Andi Kleen cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] Fix undefined/miscompiled construct in kernel parameters In-Reply-To: Message-ID: 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: 1039 Lines: 24 On Sun, 15 Jun 2003, Andi Kleen wrote: > > Because &arbitary_symbol_a - &arbitary_symbol_b is undefined in C and > the amd64 gcc 3.2 choses to miscompile it (it results in a very big > number because it converts the 56/40 division to an inversed multiplication > in a wrong way). I actually wrote a compiler bug report first, but the > compiler developers rightly pointed out that it is undefined. They are not arbitrary symbols. They are symbols in the same data structure, set up by the linker script. Gcc doesn't know that, but the fact that gcc doesn't know doesn't mean that gcc should be lazy and doesn't really excuse buggy code. The gcc developers you talked to are picking their legalistic noses, and it's sad that this isn't exactly the first time it has happened. 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/