From patchwork Thu May 30 22:47:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dehao Chen X-Patchwork-Id: 247812 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 850DA2C007B for ; Fri, 31 May 2013 08:48:03 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; q=dns; s=default; b=YktR+PiMBq800jLkhZhjoxqXWUOk/StNbqRNX3hKPIO tsWjcsBvdT9vR3FnRuzHmRl06HygTTNm3nqQxWY/8W4kQkrE0IFQy5+fVZm8j5HZ UhpkItfSEdwTA3sDGiQQjI1l3wDHw3pvgSFnIO23FYjo0ptbObnMixvl9/U3Fmg8 = 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 :mime-version:date:message-id:subject:from:to:cc:content-type; s=default; bh=0Q+nuA4G3FRyQEn1vJkWQkYYVCs=; b=gnpcJqmDtP+kfMruu Fxu+hnef4Nnr5ruP/soqDg76m+jDocDSCbMNCncZcRqFc5ogWmYOkHgRpkjg1BQb P3RqR3LxWCY6jqIasxCfvdVpjXhdMIX/WA2M/nBnyqBCrG+34xesqgag/35Ot8HF rurpLKb1tNE5istBynF21oAtlY= Received: (qmail 12492 invoked by alias); 30 May 2013 22:47:56 -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 12466 invoked by uid 89); 30 May 2013 22:47:51 -0000 X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.1 Received: from mail-ea0-f180.google.com (HELO mail-ea0-f180.google.com) (209.85.215.180) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 30 May 2013 22:47:51 +0000 Received: by mail-ea0-f180.google.com with SMTP id g10so942867eak.11 for ; Thu, 30 May 2013 15:47:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=sYGvsN8E5DkSZASYtzUvy50AgvWYE+IUqOZ/uktPbuY=; b=c5Mpe2dRw3nn6cbPJoZ9tB+rG/BR1D/HOESdqN5IeROst/G8461mOlUcuZN93cw3Wb JSF+Vx3gyI29PGsGLqrd1LjnpcyRKoLNpivptk/ZmTl+ydw+/+PtLwruJ5HC/B8QTufB 6swxycx7QAISGDYJrZaB4qpPuBb5OFjRGEgK/OGdGOqOmmp7jQdCoqCvi1xzzJ8EphLe uXlYSuAa1LsSEOjJkhu2XsKY4P/vTUTh9stBN5deSI9DxNv6o8s1MVZNB5FZ8x9UV1KP SCC/RZFTbQNK5MmttD5NmYFCAgajlvhQdy2eCA6IPBsHFiJqJ7H+cF/0xkgCaywPPpv8 0wdA== MIME-Version: 1.0 X-Received: by 10.14.209.5 with SMTP id r5mr11370822eeo.112.1369954068827; Thu, 30 May 2013 15:47:48 -0700 (PDT) Received: by 10.14.134.70 with HTTP; Thu, 30 May 2013 15:47:48 -0700 (PDT) Date: Thu, 30 May 2013 15:47:48 -0700 Message-ID: Subject: [GOOGLE] More strict checking for call args From: Dehao Chen To: GCC Patches Cc: David Li X-Gm-Message-State: ALoCoQn2umzkB0paRohWIVhSST1Tw70mR93+c/8s88zMg/GwN0A0M9Koi3uV9AzLIKJ0q1R9emvtX4NhJQC0i3fpIt0AzOi90bPuChPaKObGu17Gc9vfbhHN5qte3kDfzguDTnLwPmZjadzap9r7Lytf8uOFvNDZUE5XSltd02mX//s9LY9SJEv/0TTEWwCUpVTUinfhYBty This patch makes more strict check of call args to make sure the number of args match. Bootstrapped and passed regression tests. OK for google branches? Thanks, Dehao Index: gcc/gimple-low.c =================================================================== --- gcc/gimple-low.c (revision 199414) +++ gcc/gimple-low.c (working copy) @@ -254,9 +254,13 @@ gimple_check_call_args (gimple stmt, tree fndecl) && !fold_convertible_p (DECL_ARG_TYPE (p), arg))) return false; } + if (p != NULL) + return false; } else if (parms) { + if (list_length (parms) - nargs != 1) + return false; for (i = 0, p = parms; i < nargs; i++, p = TREE_CHAIN (p)) { tree arg;