Bug 14527 - [3.4 regression] Segfault in can_throw_internal
Summary: [3.4 regression] Segfault in can_throw_internal
Status: RESOLVED DUPLICATE of bug 14477
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 3.4.1
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2004-03-11 10:16 UTC by Jakub Jelinek
Modified: 2004-10-30 21:10 UTC (History)
1 user (show)

See Also:
Host: x86_64-redhat-linux
Target: i386-redhat-linux
Build:
Known to work: 3.3.4 4.0.0
Known to fail: 3.4.0
Last reconfirmed: 2004-03-11 15:55:30


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2004-03-11 10:16:48 UTC
Following testcase causes cc1plus segfault on i386 on gcc-3_4-branch as of today.
It worked with a gcc-3_4-branch snapshot from end of January and works on 3.3
branch and trunk, so it should be handled as a regression.

// { dg-do compile }
// { dg-options "-O2" }

extern char *foo (char *, int);

struct A
{
  int i;
  void bar (char *);
};

struct B
{
  B ();
  void baz (void *);
};

struct C
{
  C (const char *, int);
};

void
A::bar (char *a)
{
  B *b;
  char *p1, *p2 = a + 512;

  while (foo (a, 511))
    {
      b = new B ();
      p1 = a;
      while (*p1)
        {
          b->baz (new C (p1, p2 - p1));
          p1 = *p2 ? p2 + 1 : p2;
        }
    }
}
Comment 1 Wolfgang Bangerth 2004-03-11 15:55:30 UTC
Confirmed. A regression indeed. 
W. 
Comment 2 Jakub Jelinek 2004-03-16 16:08:51 UTC

*** This bug has been marked as a duplicate of 14477 ***