This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch ping (was Re: [C++ PATCH] Fix ICE with offsetof-like initializer (PR c++/88410))
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 17 Dec 2018 19:58:50 +0100
- Subject: Patch ping (was Re: [C++ PATCH] Fix ICE with offsetof-like initializer (PR c++/88410))
- References: <20181209110506.GV12380@tucnak>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
On Sun, Dec 09, 2018 at 12:05:06PM +0100, Jakub Jelinek wrote:
> The following testcase ICEs starting with my change to move offsetof-like
> expression handling from the parsing to cp_fold - if the base expression
> is not INTEGER_CST, but a constant VAR_DECL initialized with INTEGER_CST,
> then we don't fold it as offsetof-like expression and as we use recursive
> cp_fold only on functions, not initializers, we don't fold that VAR_DECL in
> there into INTEGER_CST and the middle-end ICEs on it trying to fold it.
>
> Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
> trunk?
>
> 2018-12-09 Jakub Jelinek <jakub@redhat.com>
>
> PR c++/88410
> * cp-gimplify.c (cp_fold) <case ADDR_EXPR>: For offsetof-like folding,
> call maybe_constant_value on val to see if it is INTEGER_CST.
>
> * g++.dg/cpp0x/pr88410.C: New test.
I'd like to ping this patch.
Thanks.
Jakub