This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH to fix ICE-on-invalid with wrong type of va_arg (PR c/70651)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 15 Apr 2016 15:04:24 +0200
- Subject: Re: PATCH to fix ICE-on-invalid with wrong type of va_arg (PR c/70651)
- Authentication-results: sourceware.org; auth=none
- References: <20160415125821 dot GE28445 at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Apr 15, 2016 at 02:58:21PM +0200, Marek Polacek wrote:
> Hopefully one of the last P1s for GCC 6. The problem in this PR was that we
> were triggering an assert in build_va_arg on invalid code which used wrong type
> of va_arg. We should rather error out than ICE; this patch thus turns asserts
> into errors. Only removing the assert would probably work as well, because
> gimplify.c checks the type of va_arg, but it seems to be better to give an
> error earlier, in the FE.
>
> The reason for dg-prune-output in the test is that e.g. with -m32 the test
> compiles just fine without an error. I suspect that's the case for other
> arches, too.
>
> Bootstrapped/regtested on x86_64-linux, ok for trunk?
>
> 2016-04-15 Marek Polacek <polacek@redhat.com>
>
> PR c/70651
> * c-common.c (build_va_arg): Change two asserts into errors and return
> error_mark_node.
>
> * c-c++-common/pr70651.c: New test.
Ok, thanks.
Jakub