From patchwork Wed Oct 26 15:25:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 687126 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3t3v4V6m6wz9sCZ for ; Thu, 27 Oct 2016 02:26:18 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=lLtv21KC; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=lAXayA1k3brW+3xbgzfdHbn8vWO6Mg9e7TYlyDGzOXqVLFOXU6 Ss9T6cCv+YLKv8dnK9x/Uwp63JDIwBFRaybIk5Kop/R+rHf7EqSk9S4DAKq0LP/i qr3CL3X4ku0l2G2QK3zAoEvQYkLzZQJa3w2npfUQxGEUAokBqHJYKi7XI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=9nM0uTTWfCb/gk6sHxhD36kyAPk=; b=lLtv21KCVIO3eMZbPl3u hxusRy3nTvITK8WzfPa00a4t5rKtIlce8FtPw8fiz063FVEn1aNG7P1tpl2Vo7U/ jZtJ76zd8FQVbx04ui5z1CRQzMEFaqkAbkjamSsRFuxQRptoVbykT4c9Dj3BuHO/ 2v3jkxx+dGbP8Q11x7ppuSo= Received: (qmail 77175 invoked by alias); 26 Oct 2016 15:25:54 -0000 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 Received: (qmail 76984 invoked by uid 89); 26 Oct 2016 15:25:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=pac X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Oct 2016 15:25:51 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 79601C04B922 for ; Wed, 26 Oct 2016 15:25:50 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-128.phx2.redhat.com [10.3.116.128]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9QFPoF6027217 for ; Wed, 26 Oct 2016 11:25:50 -0400 To: gcc-patches From: Jeff Law Subject: Fix PA buglet with sprintf formatting Message-ID: Date: Wed, 26 Oct 2016 09:25:50 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 X-IsSubscribed: yes If we have enough thunks we could potentially overwrite the output buffer in pa_asm_output_mi_thunk: ASM_GENERATE_INTERNAL_LABEL (label, "LTHN", current_thunk_number); In reality we're unlikely to get enough thunks to cause a problem, but fixing this is easy by just increasing the size of the buffer. Installed on the trunk. Jeff diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c9b72bc..7d869b1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2016-10-26 Jeff Law + * config/pa/pa.c (pa_asm_output_mi_thunk): Increase buffer + size. + * config/h8300/h8300.c (h8300_print_operand): Adjust FALLTHRU comment to silence warning. diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index e04abd4..c8ce083 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -8345,7 +8345,7 @@ pa_asm_output_mi_thunk (FILE *file, tree thunk_fndecl, HOST_WIDE_INT delta, static unsigned int current_thunk_number; int val_14 = VAL_14_BITS_P (delta); unsigned int old_last_address = last_address, nbytes = 0; - char label[16]; + char label[17]; rtx xoperands[4]; xoperands[0] = XEXP (DECL_RTL (function), 0);