From patchwork Thu Jun 10 13:17:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 55217 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 29156B7D47 for ; Thu, 10 Jun 2010 23:14:03 +1000 (EST) Received: (qmail 2874 invoked by alias); 10 Jun 2010 13:13:57 -0000 Received: (qmail 2854 invoked by uid 22791); 10 Jun 2010 13:13:56 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 10 Jun 2010 13:13:50 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5ADDn0l009154 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 10 Jun 2010 09:13:49 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5ADDlit014068 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 10 Jun 2010 09:13:48 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (localhost [127.0.0.1]) by tyan-ft48-01.lab.bos.redhat.com (8.14.3/8.14.3) with ESMTP id o5ADH6r9025101 for ; Thu, 10 Jun 2010 15:17:06 +0200 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.3/8.14.3/Submit) id o5ADH3Yw025100 for gcc-patches@gcc.gnu.org; Thu, 10 Jun 2010 15:17:03 +0200 Date: Thu, 10 Jun 2010 15:17:03 +0200 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix resolve_asm_operand_names Message-ID: <20100610131703.GL10293@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-08-17) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi! This patch makes sure we don't replace %%[foo] in asm patterns, only %[foo] or %%%[foo]. void foo (void) { asm volatile ("%%[a] %[a] %%%[a] %%[a] %[a]" : : [a] "i" (6)); } before: %0 $6 %$6 %0 $6 after: %[a] $6 %$6 %[a] $6 Ok for trunk? 2010-06-10 Jakub Jelinek * stmt.c (resolve_asm_operand_names): Fix handling of %%. Jakub --- gcc/stmt.c.jj 2010-05-25 11:27:47.000000000 +0200 +++ gcc/stmt.c 2010-06-10 14:59:49.000000000 +0200 @@ -1319,7 +1319,7 @@ resolve_asm_operand_names (tree string, break; else { - c += 1; + c += 1 + (c[1] == '%'); continue; } } @@ -1341,7 +1341,7 @@ resolve_asm_operand_names (tree string, p += 2; else { - p += 1; + p += 1 + (p[1] == '%'); continue; }