Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754771Ab0KHLsJ (ORCPT ); Mon, 8 Nov 2010 06:48:09 -0500 Received: from ausc60ps301.us.dell.com ([143.166.148.206]:60643 "EHLO ausc60ps301.us.dell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754497Ab0KHLsI convert rfc822-to-8bit (ORCPT ); Mon, 8 Nov 2010 06:48:08 -0500 X-Loopcount0: from 10.152.240.141 Subject: Re: gcc 4.5.1 / as 2.20.51.0.11 miscompiling drivers/char/i8k.c ? Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Paul Koning In-Reply-To: Date: Mon, 8 Nov 2010 06:47:59 -0500 Cc: Andi Kleen , Andreas Schwab , Jim , Linux Kernel Mailing List , gcc@gcc.gnu.org Content-Transfer-Encoding: 8BIT Message-Id: References: <4CD538CA.8010901@xs4all.nl> <87wroostw3.fsf@basil.nowhere.org> <87k4kospnd.fsf@basil.nowhere.org> <877hgorrj1.fsf@basil.nowhere.org> To: Richard Guenther X-Mailer: Apple Mail (2.1081) X-OriginalArrivalTime: 08 Nov 2010 11:48:00.0695 (UTC) FILETIME=[CB5DE470:01CB7F3A] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1289 Lines: 35 On Nov 8, 2010, at 6:20 AM, Richard Guenther wrote: > On Mon, Nov 8, 2010 at 12:20 PM, Andi Kleen wrote: >> Richard Guenther writes: >> >>> On Mon, Nov 8, 2010 at 12:03 AM, Andi Kleen wrote: >>>> Andreas Schwab writes: >>>>> >>>>> The asm fails to mention that it modifies *regs. >>>> >>>> It has a memory clobber, that should be enough, no? >>> >>> No. A memory clobber does not cover automatic storage. >> >> That's a separate problem. >> >>> Btw, I can't see a testcase anywhere so I just assume Andreas got >>> it right as usual. >> >> An asm with live inputs and outputs should never be optimized >> way. If 4.5.1 started doing that it's seriously broken. > > Please provide a testcase, such asms can be optimized if the > outputs are dead. I don't know about 4.5, but I noticed that with 4.6 (trunk), testcasese like gcc.c-torture/compile/20000804-1.c optimize away the asm and all the operand generation except for -O0. paul -- 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/