]> git.pld-linux.org Git - packages/gcc.git/blob - gcc-pr23402.patch
db7c3f3537ab1caa5e8539cbf69769dde5a7d51d
[packages/gcc.git] / gcc-pr23402.patch
1 --- gcc-4.1-20050815T0803UTC/gcc/gimplify.c     2005-08-16 19:35:38.541525608 +0000
2 +++ gcc-4.1-20050815T0803UTC/gcc/gimplify.c     2005-08-16 19:36:46.005269560 +0000
3 @@ -2552,6 +2552,17 @@ zero_sized_field_decl (tree fdecl)
4    return false;
5  }
6  
7 +/* Return true if TYPE is zero sized.  */
8 +   
9 +static bool
10 +zero_sized_type (tree type)
11 +{
12 +  if (AGGREGATE_TYPE_P (type) && TYPE_SIZE (type)
13 +      && integer_zerop (TYPE_SIZE (type)))
14 +    return true;
15 +  return false;
16 +}
17 +
18  /* A subroutine of gimplify_init_constructor.  Generate individual
19     MODIFY_EXPRs for a CONSTRUCTOR.  OBJECT is the LHS against which the
20     assignments should happen.  ELTS is the CONSTRUCTOR_ELTS of the
21 @@ -2964,6 +2975,12 @@ gimplify_modify_expr_rhs (tree *expr_p, 
22                           tree *post_p, bool want_value)
23  {
24    enum gimplify_status ret = GS_OK;
25 +  tree type = TREE_TYPE (*from_p);
26 +  if (zero_sized_type (type))
27 +    {
28 +      *expr_p = build_empty_stmt ();
29 +      return GS_ALL_DONE;
30 +    }
31  
32    while (ret != GS_UNHANDLED)
33      switch (TREE_CODE (*from_p))
This page took 0.018771 seconds and 2 git commands to generate.