This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/56078] causes cc1 to crash


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56078

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-01-23 14:32:31 UTC ---
--- gcc/c/c-typeck.c.jj    2013-01-11 09:02:31.000000000 +0100
+++ gcc/c/c-typeck.c    2013-01-23 15:24:50.839173887 +0100
@@ -7574,7 +7574,9 @@ set_nonincremental_init_from_string (tre
   end = p + TREE_STRING_LENGTH (str);

   for (purpose = bitsize_zero_node;
-       p < end && !tree_int_cst_lt (constructor_max_index, purpose);
+       p < end
+       && (constructor_max_index == NULL_TREE
+       || !tree_int_cst_lt (constructor_max_index, purpose));
        purpose = size_binop (PLUS_EXPR, purpose, bitsize_one_node))
     {
       if (wchar_bytes == 1)

makes this ICE go away, and #c3 then is handled with a warning the same as
struct T t = { .a = 1, .b = "abc" };
alone, so it is the same issue as t2 then.  The rest I guess depends on how do
we want to exactly define the extension.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]