From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4052 invoked by alias); 2 Aug 2011 13:42:33 -0000 Received: (qmail 4042 invoked by uid 22791); 2 Aug 2011 13:42:32 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-gy0-f175.google.com (HELO mail-gy0-f175.google.com) (209.85.160.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Aug 2011 13:42:13 +0000 Received: by gyd12 with SMTP id 12so4766129gyd.20 for ; Tue, 02 Aug 2011 06:42:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.54.7 with SMTP id c7mr1725766yba.250.1312292532464; Tue, 02 Aug 2011 06:42:12 -0700 (PDT) Received: by 10.150.219.17 with HTTP; Tue, 2 Aug 2011 06:42:12 -0700 (PDT) In-Reply-To: References: <201108012230.29989.michael@walle.cc> <4E371AC5.5090509@redhat.com> <20023.47611.116809.875356@pilspetsen.it.uu.se> <4E37CAFB.5010401@gjlay.de> <27466ae6b9a714679fcba410cce130ba.squirrel@ssl.serverraum.org> <20023.59456.782598.31450@pilspetsen.it.uu.se> Date: Tue, 02 Aug 2011 13:42:00 -0000 Message-ID: Subject: Re: libgcc: strange optimization From: Richard Guenther To: Ian Lance Taylor Cc: Mikael Pettersson , Michael Walle , Georg-Johann Lay , Hans-Peter Nilsson , Richard Henderson , gcc@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-08/txt/msg00052.txt.bz2 On Tue, Aug 2, 2011 at 3:23 PM, Ian Lance Taylor wrote: > Richard Guenther writes: > >> Or go one step further and deprecate local register variables alltogether >> (they IMHO don't make much sense, and rather the targets should provide >> a way to properly constrain asm inputs and outputs). > > No, local register variables are documented as working and many programs > rely on them. =A0They are a straightforward way to get an asm argument in > a specific register, and I don't see any reason to break that. Well, maybe they look like so. But in reality there is _no_ connection from the register setup to the actual asm. Which is the problem the compiler faces here (apart from the libcall issue). If there should be an implicit dependence of all asms to all local register var setters and users then this isn't implemented on gimple (or rather it works by chance there as we treat register vars as memory and do not disambiguate anything across asms (yet)). >> I suggest to amend the documentation for local call-clobbered register >> variables to say that the only valid sequence using them is from a >> non-inlinable function that contains only direct initializations of the >> register variables from constants or parameters. > > Let's just implement those requirements in the compiler itself. Doesn't work for existing code, no? And if thinking new code then I'd rather have explicit dependences (and a way to represent them). Thus, for example asm ("scall" : : "asm("r0")" (10), ...) thus, why force new constraints when we already can figure out local register vars by register name? Why not extend the constraint syntax somehow to allow specifying the same effect? Richard. > Ian >