Bug 131378 - ICE - on RHEL3, works on FC1
ICE - on RHEL3, works on FC1
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-08-31 15:08 EDT by James Antill
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-05-18 09:42:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Pre processed C file that ICEs (365.46 KB, text/plain)
2004-08-31 15:12 EDT, James Antill
no flags Details

  None (edit)
Description James Antill 2004-08-31 15:08:25 EDT
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).
Comment 1 James Antill 2004-08-31 15:12:39 EDT
Created attachment 103310 [details]
Pre processed C file that ICEs
Comment 2 Jakub Jelinek 2005-01-03 09:26:32 EST
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;
}
Comment 4 Jakub Jelinek 2005-01-03 12:17:05 EST
I have backported http://gcc.gnu.org/ml/gcc-patches/2003-07/msg02000.html
that should cure this.
Comment 5 Jakub Jelinek 2005-01-04 13:00:15 EST
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/
Comment 6 James Antill 2005-01-04 15:32:14 EST
 I've confirmed that the new packages fix the ICE.
Comment 7 Tim Powers 2005-05-18 09:42:32 EDT
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

Note You need to log in before you can comment on or make changes to this bug.