From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell King - ARM Linux Subject: Re: [PATCH 2/4] msm: scm: Fix improper register assignment Date: Sat, 26 Feb 2011 08:47:36 +0000 Message-ID: <20110226084736.GB3640@n2100.arm.linux.org.uk> References: <1298573085-23217-1-git-send-email-sboyd@codeaurora.org> <1298573085-23217-3-git-send-email-sboyd@codeaurora.org> <1298640219.958.74.camel@e102144-lin.cambridge.arm.com> <4D688AF1.1090607@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from caramon.arm.linux.org.uk ([78.32.30.218]:54528 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751584Ab1BZIsD (ORCPT ); Sat, 26 Feb 2011 03:48:03 -0500 Content-Disposition: inline In-Reply-To: <4D688AF1.1090607@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Saravana Kannan Cc: Will Deacon , linux-arm-msm@vger.kernel.org, David Brown , Stephen Boyd , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org On Fri, Feb 25, 2011 at 09:09:05PM -0800, Saravana Kannan wrote: > Yeah, Stephen and I spent quite a bit of time discussing this and > experimenting to figure out what the heck GCC was doing. But it kept > optimizing the fake code we put in trying to force GCC to use a specific > register. One way to look at it is that if you specify a value for r0, assign it, and then call a function, how do you expect the r0 value to be preserved? r0 will be corrupted by the called function as its used to pass arg0 and the return value. I'm surprised the compiler didn't spit out an error.