Bug 131378 - ICE - on RHEL3, works on FC1
Summary: ICE - on RHEL3, works on FC1
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc   
(Show other bugs)
Version: 3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-08-31 19:08 UTC by James Antill
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-05-18 13:42:32 UTC
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 19:12 UTC, James Antill
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2005:258 normal SHIPPED_LIVE gcc bug fix update 2005-05-18 04:00:00 UTC

Description James Antill 2004-08-31 19:08:25 UTC
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 19:12:39 UTC
Created attachment 103310 [details]
Pre processed C file that ICEs

Comment 2 Jakub Jelinek 2005-01-03 14:26:32 UTC
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 17:17:05 UTC
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 18:00:15 UTC
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 20:32:14 UTC
 I've confirmed that the new packages fix the ICE.


Comment 7 Tim Powers 2005-05-18 13:42:32 UTC
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.