From patchwork Fri Jan 16 11:09:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 429814 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 33A4714014D for ; Fri, 16 Jan 2015 22:10:21 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=F3a6kG++QdOPE8BHev+v3xeUjimZ2bHGO5GJBe5ojIYPf6A0uoUbH V80v34CgBFFFYXjjRKz0A63HptoQXdPWHvPWiw1QlOrSONUZvDxo3C6wN+6b6Su2 t7slU+Ud5UaaGwmnIWKhNwMZJrELxXt7m8ut3bWTK6OXqpOd46/yog= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=sMo/FC3lZQTZX+UNfakw2IfxS10=; b=geV9vbml1kIUf6RcRZTw Rndlz80dJADz/mQbhsG/H3icsn1Bo5paG8ndXKEFOzRwyk12X9Z79JTAZa5Qj80L dOAhj9oGpMkj3oTXBiRnAQZX2Nu9qoOjtbvjPxe1q++Di+CE6X0YMQHQFKKO2CdT ieCKUves8zUqFbsbLMqqdBw= Received: (qmail 6364 invoked by alias); 16 Jan 2015 11:10:14 -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 6354 invoked by uid 89); 16 Jan 2015 11:10:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f173.google.com Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com) (209.85.212.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 16 Jan 2015 11:10:06 +0000 Received: by mail-wi0-f173.google.com with SMTP id r20so1511436wiv.0 for ; Fri, 16 Jan 2015 03:10:03 -0800 (PST) X-Received: by 10.180.7.198 with SMTP id l6mr5225961wia.26.1421406595075; Fri, 16 Jan 2015 03:09:55 -0800 (PST) Received: from msticlxl57.ims.intel.com (fmdmzpr02-ext.fm.intel.com. [192.55.55.37]) by mx.google.com with ESMTPSA id wb9sm2534453wic.20.2015.01.16.03.09.52 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Jan 2015 03:09:54 -0800 (PST) Date: Fri, 16 Jan 2015 14:09:44 +0300 From: Ilya Enkovich To: gcc-patches@gcc.gnu.org Subject: [PATCH, CHKP] [always_inline 2/2] Fix segafult in SRA Message-ID: <20150116110944.GC55666@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Hi, In early SRA some_callers_have_mismatched_arguments_p function is called for function, all its thunks and aliases, but actually cannot handle function with thunks because assumes call_stmt for call_edge is not NULL. This patch rejects functions with thunks instead of ICE. Bootstrapped and checked on x86_64-unknown-linux-gnu. Fixes faults revealed by the first patch in the series. OK for trunk? Thanks, Ilya --- 2015-01-16 Ilya Enkovich * tree-sra.c (some_callers_have_mismatched_arguments_p): Allow thunk callers. diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index f560fe0..f6a3acd 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -4873,7 +4873,7 @@ some_callers_have_mismatched_arguments_p (struct cgraph_node *node, { struct cgraph_edge *cs; for (cs = node->callers; cs; cs = cs->next_caller) - if (!callsite_arguments_match_p (cs->call_stmt)) + if (!cs->call_stmt || !callsite_arguments_match_p (cs->call_stmt)) return true; return false;