This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Use of compound_literal_expr in c vs target_expr in c++ for compound literals
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: fjahanian at apple dot com (Fariborz Jahanian)
- Cc: gcc at gcc dot gnu dot org (gcc mailing list)
- Date: Mon, 24 Jul 2006 18:07:31 -0400 (EDT)
- Subject: Re: Use of compound_literal_expr in c vs target_expr in c++ for compound literals
>
>
> gcc generates two separate trees for compound literals in c and c++.
> As in this test case:
>
> struct S {
> int i,j;
> };
> void foo (struct S);
>
> int main ()
> {
> foo((struct S){1,1});
> }
> On the other hand, such a guard does not exist for a
> compound_literal_expr and when gimple_add_tmp_var is called, it
> asserts. So, I added check for
> !DECL_SEEN_IN_BIND_EXPR_P (decl) in
> gimplify_compound_literal_expr before call to gimple_add_tmp_var is
> made. As in the following diff:
I think you are trying to fix PR 28418 which is an ICE in gimple_add_tmp_var with
compound literals in C.
Thanks,
Andrew Pinski