Bug 21492 - [4.0/4.1 Regression] ICE in try_crossjump_to_edge
Summary: [4.0/4.1 Regression] ICE in try_crossjump_to_edge
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.1
Assignee: Jakub Jelinek
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: ice-on-valid-code, patch
Depends on:
Blocks:
 
Reported: 2005-05-10 15:08 UTC by Jakub Jelinek
Modified: 2005-05-25 22:21 UTC (History)
1 user (show)

See Also:
Host:
Target: powerpc-linux, powerpc-darwin
Build:
Known to work: 3.3.3
Known to fail: 4.0.0 4.1.0
Last reconfirmed: 2005-05-10 17:37:04


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2005-05-10 15:08:06 UTC
// { dg-do compile }
// { dg-options "-Os -fPIC" }

extern char *bar (const char *, const char *);
extern char *baz (char *, const char *);
extern unsigned int fn (const char *);
static const struct C { int i; } k = { 0};

struct S
{
  S (const C &x, unsigned int *y) : a (x), b (y) {}
  const C &a;
  unsigned int *b;
};

struct A
{
  ~A ();
  void helper (const S &);
};

struct B : private A
{
  B (const S &x)
  {
    helper (x);
  }
};

char *
foo (char *x, const char *y)
{
  unsigned int a;
  B b (S (k, &a));
  char *c = x;

  if (bar (y, "foo"))
    {
      baz (c, "foo");
      c += fn ("foo");
    }
  else if (bar (y, "bar"))
    {
      baz (c, "bar");
      c += fn ("bar");
    }

  return x;
}

causes ICE on powerpc-linux (32-bit).
Comment 1 Andrew Pinski 2005-05-10 16:52:19 UTC
Confirmed.
Comment 2 Andrew Pinski 2005-05-11 11:20:46 UTC
Patch posted here: <http://gcc.gnu.org/ml/gcc-patches/2005-05/msg00972.html>.
Comment 3 GCC Commits 2005-05-17 06:48:28 UTC
Subject: Bug 21492

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jakub@gcc.gnu.org	2005-05-17 06:48:19

Modified files:
	gcc            : ChangeLog cfgcleanup.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/opt: crossjump1.C 

Log message:
	PR middle-end/21492
	* cfgcleanup.c (try_crossjump_to_edge): update_forwarder_flag for
	src2 if src2 has been split.
	
	* g++.dg/opt/crossjump1.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8812&r2=2.8813
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cfgcleanup.c.diff?cvsroot=gcc&r1=1.144&r2=1.145
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5480&r2=1.5481
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/crossjump1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 4 GCC Commits 2005-05-25 21:16:24 UTC
Subject: Bug 21492

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	jakub@gcc.gnu.org	2005-05-25 21:15:56

Modified files:
	gcc            : ChangeLog cfgcleanup.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/opt: crossjump1.C 

Log message:
	PR middle-end/21492
	* cfgcleanup.c (try_crossjump_to_edge): update_forwarder_flag for
	src2 if src2 has been split.
	
	* g++.dg/opt/crossjump1.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.261&r2=2.7592.2.262
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cfgcleanup.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.141&r2=1.141.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.197&r2=1.5084.2.198
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/crossjump1.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.4.1

Comment 5 Andrew Pinski 2005-05-25 22:21:51 UTC
Fixed.