From: Richard Biener <richard.guenther@gmail.com>
To: Marek Polacek <polacek@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Don't ICE on invalid array types (PR middle-end/59827)
Date: Thu, 16 Jan 2014 11:27:00 -0000 [thread overview]
Message-ID: <CAFiYyc21Z7tvZ_bDq9rJykq_iV=XeBq0v40wt0o5oVHWPFoHjA@mail.gmail.com> (raw)
In-Reply-To: <20140115155313.GA8907@redhat.com>
On Wed, Jan 15, 2014 at 4:53 PM, Marek Polacek <polacek@redhat.com> 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 <polacek@redhat.com>
>
> 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
prev parent reply other threads:[~2014-01-16 11:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-15 15:53 Marek Polacek
2014-01-16 11:27 ` Richard Biener [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFiYyc21Z7tvZ_bDq9rJykq_iV=XeBq0v40wt0o5oVHWPFoHjA@mail.gmail.com' \
--to=richard.guenther@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=polacek@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).