This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C PATCH] Avoid ICEs due to save_expr instead of c_save_expr (PR c/54428)
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 12 Sep 2012 20:43:01 -0700
- Subject: Re: [C PATCH] Avoid ICEs due to save_expr instead of c_save_expr (PR c/54428)
- References: <20120831123658.GS1999@tucnak.redhat.com>
On Fri, Aug 31, 2012 at 5:36 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> This is another case of the issue that save_expr shouldn't be called
> when parsing C (except for in_late_binary_op), but c_save_expr must be
> called instead.
>
> I wonder if we shouldn't add a langhook, which would do
> if (in_late_binary_op) save_expr_1 else c_save_expr
> and ensure that when not parsing in_late_binary_op is set or something
> similar, and if non-NULL, call the langhook from save_expr.
>
> Anyway, this patch fixes this issue even without such changes,
> bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk/4.7?
>
> 2012-08-31 Jakub Jelinek <jakub@redhat.com>
>
> PR c/54428
> * c-convert.c (convert): Don't call fold_convert_loc if
> TYPE_MAIN_VARIANT of a COMPLEX_TYPE is the same, unless e
> is a COMPLEX_EXPR. Remove TYPE_MAIN_VARIANT check from
> COMPLEX_TYPE -> COMPLEX_TYPE conversion.
>
> * gcc.c-torture/compile/pr54428.c: New test.
>
This caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54559
--
H.J.