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/33238] New: [4.1.2 regression] ICE on statement expression using variable-sized structure in tree_low_cst, at tree.c:4502


The following code gives an internal compiler error using gcc 4.1.2, but
compiles using 3.4.  Remove the ()s around the {}s and it compiles just fine. 

void reverse(void *_p, int nmemb, int size)
{
    struct { char _[size]; } *p = _p, tmp;
    for (int i=nmemb-1, j=0; j<nmemb/2; i--, j++)
        ({ tmp = p[i]; p[i] = p[j]; p[j] = tmp; });
}

bug2.c: In function ?reverse?:
bug2.c:4: internal compiler error: in tree_low_cst, at tree.c:4502


-- 
           Summary: [4.1.2 regression] ICE on statement expression using
                    variable-sized structure in tree_low_cst, at tree.c:4502
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: radford at blackbean dot org
 GCC build triplet: x86_64-redhat-linux, i386-redhat-linux
  GCC host triplet: x86_64-redhat-linux, i386-redhat-linux
GCC target triplet: x86_64-redhat-linux, i386-redhat-linux


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


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