From patchwork Wed Oct 26 20:19:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 687338 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 3t41ZZ1Kjbz9t0w for ; Thu, 27 Oct 2016 07:19:17 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=v1Spdj3T; 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=jSLfYJux2v7kibB6xqotD0PfPFySKP2tEqb1qzVNl4/ag7wQPB M9zuHXzc1kQIa2Sg+k9RpQcFH317V5ky8lk41GnXTaJEYfKHMqctzIn1s3epiaE2 2CwFBL8UMaemCIjy2PWeT12uoms7HZGzp5dzuRkCD7TMPX9tNwAg//BAk= 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=nYkrKXbN32Z+5X/caInfK/62PSI=; b=v1Spdj3TSOsIXCkb6J3o QtFqNFJRS37eNs4RYwrCVIvrxqUWSrsYZnHheuD3LoNtvCddrS/2uzTW4IfjrmVD /trA41+vgKLshMzr1OgN1oQkdfcXJH3sdLyy/sChy/5WQI0lGysH7KMWQ2oG8npS nHjAjXvuPshheDAIqI+fTjU= Received: (qmail 61280 invoked by alias); 26 Oct 2016 20:19:07 -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 60168 invoked by uid 89); 26 Oct 2016 20:19:06 -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=16-bit, 16bit 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 20:19:05 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (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 20ADCC04B922 for ; Wed, 26 Oct 2016 20:19:04 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-128.phx2.redhat.com [10.3.116.128]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9QKJ3Yj001218 for ; Wed, 26 Oct 2016 16:19:03 -0400 To: gcc-patches From: Jeff Law Subject: Fix MIPS port WRT sprintf and fallthru warnings Message-ID: <8bdb9f24-e048-1151-5bf2-d372e311a551@redhat.com> Date: Wed, 26 Oct 2016 14:19:03 -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 The fallthrus in mips16_constant_cost are pretty obvious. One buffer overflow in mips16_build_call_stub and one obvious fallthru comment adjustment in mips16_build_call_stub. The usual stuff. Installing. jeff commit c03f0de027e1079edd02e3494601c6def50dbac1 Author: law Date: Wed Oct 26 20:16:57 2016 +0000 * config/mips/mips.c (mips16_constant_cost): Add missing fallthru comments. (mips16_build_call_stub): Increase buffer size. Adjust fallthru comment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241597 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 02a37f6..3e7704c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-10-26 Jeff Law + + * config/mips/mips.c (mips16_constant_cost): Add missing + fallthru comments. + (mips16_build_call_stub): Increase buffer size. Adjust + fallthru comment. + 2016-10-26 David Malcolm * print-rtl.c (rtx_writer::print_rtx_operand_code_u): Print diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index ebec68e..5c1a35a 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -3828,9 +3828,11 @@ mips16_constant_cost (int code, HOST_WIDE_INT x) /* Like LE, but reject the always-true case. */ if (x == -1) return -1; + /* FALLTHRU */ case LE: /* We add 1 to the immediate and use SLT. */ x += 1; + /* FALLTHRU */ case XOR: /* We can use CMPI for an xor with an unsigned 16-bit X. */ case LT: @@ -7439,7 +7441,7 @@ mips16_build_call_stub (rtx retval, rtx *fn_ptr, rtx args_size, int fp_code) if (GET_CODE (fn) != SYMBOL_REF || !call_insn_operand (fn, VOIDmode)) { - char buf[30]; + char buf[32]; rtx stub_fn, addr; rtx_insn *insn; bool lazy_p; @@ -7635,7 +7637,7 @@ mips16_build_call_stub (rtx retval, rtx *fn_ptr, rtx args_size, int fp_code) case DCmode: mips_output_64bit_xfer ('f', GP_RETURN + (8 / UNITS_PER_WORD), FP_REG_FIRST + 2); - /* Fall though. */ + /* FALLTHRU */ case DFmode: case V2SFmode: gcc_assert (TARGET_PAIRED_SINGLE_FLOAT