Description of problem: Compiling the testsuite to Vstr (http://www.and.org/vstr/) produces an ICE. Version-Release number of selected component (if applicable): gcc(0:3.3.2-2).i386 How reproducible: Always. Steps to Reproduce: 1. 1.0.12 or 1.0.13 of vstr with rpmbuild --define 'chk 1' 2. Also just compile attached preprocessed output (gcc -O2 -march=i386 -mcpu=i686 -c gcc-ICE.c -o /dev/null).
Created attachment 103310 [details] Pre processed C file that ICEs
Simplified testcase: struct S { char *s1; int s2; }; struct T { int t1; struct S *t2; } *s1; extern int bar (const struct T *, unsigned int, unsigned int, const struct T *, unsigned int, unsigned int); extern inline void * baz (void *x, const void *y, unsigned int z) { unsigned char *s1 = x; const unsigned char *s2 = y; if (z > 4 || __builtin_constant_p (z)) __builtin_memcpy (x, y, z); else switch (z) { case 4: s1[3] = s2[3]; case 3: s1[2] = s2[2]; case 2: s1[1] = s2[1]; case 1: s1[0] = s2[0]; case 0: break; } return x; } extern inline int foo (struct T *b, unsigned int x, const void *y, unsigned int z) { if (!b || !z) return 0; if (x == b->t1) { struct S *r = b->t2; baz (r->s1 + r->s2, y, z); return 1; } return 0; } int test (struct T *a, struct T *b, struct T *c, struct T *d) { if (!a) abort (); if (!b) abort (); if (bar (a, 1, a->t1, b, 1, b->t1) > 0) abort (); if (bar (a, 41, a->t1 - 40, b, 1, b->t1) > 0) abort (); if (!c) abort (); if (!d) abort (); if (bar (c, 1, c->t1, d, 1, d->t1) < 0) abort (); if (bar (c, 41, c->t1 - 40, d, 1, d->t1) < 0) abort (); foo (s1, 0, "abcd", 4); return 0; }
I have backported http://gcc.gnu.org/ml/gcc-patches/2003-07/msg02000.html that should cure this.
Fix for this has been added to gcc-3.2.3-50, for the time being available from: ftp://people.redhat.com/jakub/gcc/3.2.3-50/
I've confirmed that the new packages fix the ICE.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2005-258.html