From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19672 invoked by alias); 16 Jan 2014 11:27:49 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 19658 invoked by uid 89); 16 Jan 2014 11:27:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 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-f179.google.com Received: from mail-wi0-f179.google.com (HELO mail-wi0-f179.google.com) (209.85.212.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 16 Jan 2014 11:27:47 +0000 Received: by mail-wi0-f179.google.com with SMTP id hr1so3528450wib.6 for ; Thu, 16 Jan 2014 03:27:44 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.180.99.74 with SMTP id eo10mr7692064wib.12.1389871664854; Thu, 16 Jan 2014 03:27:44 -0800 (PST) Received: by 10.194.243.105 with HTTP; Thu, 16 Jan 2014 03:27:44 -0800 (PST) In-Reply-To: <20140115155313.GA8907@redhat.com> References: <20140115155313.GA8907@redhat.com> Date: Thu, 16 Jan 2014 11:27:00 -0000 Message-ID: Subject: Re: [PATCH] Don't ICE on invalid array types (PR middle-end/59827) From: Richard Biener To: Marek Polacek Cc: GCC Patches Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00965.txt.bz2 On Wed, Jan 15, 2014 at 4:53 PM, Marek Polacek wrote: > We ICE on the following (invalid) testcase, because the DECL_ARG_TYPE > is error_mark_node and useless_type_conversion_p doesn't check that > it operates on a type. > > Regtested/bootstrapped on x86_64-linux, ok for trunk/4.8/4.7? Ok. Thanks, Richard. > 2014-01-15 Marek Polacek > > PR middle-end/59827 > * cgraph.c (gimple_check_call_args): Don't use DECL_ARG_TYPE if > it is error_mark_node. > testsuite/ > * gcc.dg/pr59827.c: New test. > > --- gcc/cgraph.c.mp2 2014-01-15 14:24:53.235255954 +0100 > +++ gcc/cgraph.c 2014-01-15 14:52:28.818244290 +0100 > @@ -3035,6 +3035,7 @@ gimple_check_call_args (gimple stmt, tre > break; > arg = gimple_call_arg (stmt, i); > if (p == error_mark_node > + || DECL_ARG_TYPE (p) == error_mark_node > || arg == error_mark_node > || (!types_compatible_p (DECL_ARG_TYPE (p), TREE_TYPE (arg)) > && !fold_convertible_p (DECL_ARG_TYPE (p), arg))) > --- gcc/testsuite/gcc.dg/pr59827.c.mp2 2014-01-15 15:06:47.129210564 +0100 > +++ gcc/testsuite/gcc.dg/pr59827.c 2014-01-15 15:09:17.295843068 +0100 > @@ -0,0 +1,15 @@ > +/* PR middle-end/59827 */ > +/* { dg-do compile } */ > + > +int > +foo (int p[2][]) /* { dg-error "array type has incomplete element type" } */ > +{ > + return p[0][0]; > +} > + > +void > +bar (void) > +{ > + int p[2][1]; > + foo (p); /* { dg-error "type of formal parameter 1 is incomplete" } */ > +} > > Marek