SOURCES: gcc-pr23402.patch (NEW) - fix ICE with zero sized structs.
pluto
pluto at pld-linux.org
Tue Aug 16 21:31:54 CEST 2005
Author: pluto Date: Tue Aug 16 19:31:53 2005 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- fix ICE with zero sized structs.
---- Files affected:
SOURCES:
gcc-pr23402.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/gcc-pr23402.patch
diff -u /dev/null SOURCES/gcc-pr23402.patch:1.1
--- /dev/null Tue Aug 16 21:31:53 2005
+++ SOURCES/gcc-pr23402.patch Tue Aug 16 21:31:48 2005
@@ -0,0 +1,33 @@
+--- gcc-4.1-20050815T0803UTC/gcc/gimplify.c 2005-08-16 19:35:38.541525608 +0000
++++ gcc-4.1-20050815T0803UTC/gcc/gimplify.c 2005-08-16 19:36:46.005269560 +0000
+@@ -2552,6 +2552,17 @@ zero_sized_field_decl (tree fdecl)
+ return false;
+ }
+
++/* Return true if TYPE is zero sized. */
++
++static bool
++zero_sized_type (tree type)
++{
++ if (AGGREGATE_TYPE_P (type) && TYPE_SIZE (type)
++ && integer_zerop (TYPE_SIZE (type)))
++ return true;
++ return false;
++}
++
+ /* A subroutine of gimplify_init_constructor. Generate individual
+ MODIFY_EXPRs for a CONSTRUCTOR. OBJECT is the LHS against which the
+ assignments should happen. ELTS is the CONSTRUCTOR_ELTS of the
+@@ -2964,6 +2975,12 @@ gimplify_modify_expr_rhs (tree *expr_p,
+ tree *post_p, bool want_value)
+ {
+ enum gimplify_status ret = GS_OK;
++ tree type = TREE_TYPE (*from_p);
++ if (zero_sized_type (type))
++ {
++ *expr_p = build_empty_stmt ();
++ return GS_ALL_DONE;
++ }
+
+ while (ret != GS_UNHANDLED)
+ switch (TREE_CODE (*from_p))
================================================================
More information about the pld-cvs-commit
mailing list