mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-22 10:35:22 +08:00
re PR tree-optimization/30630 (Trunk GCC hangs while compiling cpu2k6/perlbench at -O2)
2007-01-29 Daniel Berlin <dberlin@dberlin.org> PR tree-optimization/30630 * tree-ssa-structalias.c (do_complex_constraint): Mark correct variable as changed. From-SVN: r121295
This commit is contained in:
parent
99af1cca0d
commit
48e540b04f
@ -1,3 +1,9 @@
|
||||
2007-01-29 Daniel Berlin <dberlin@dberlin.org>
|
||||
|
||||
PR tree-optimization/30630
|
||||
* tree-ssa-structalias.c (do_complex_constraint): Mark correct
|
||||
variable as changed.
|
||||
|
||||
2007-01-29 Simon Martin <simartin@users.sourceforge.net>
|
||||
|
||||
PR c++/28266
|
||||
|
94
gcc/testsuite/gcc.c-torture/compile/20070129.c
Normal file
94
gcc/testsuite/gcc.c-torture/compile/20070129.c
Normal file
@ -0,0 +1,94 @@
|
||||
/* This testcase would cause a hang in PTA solving due to a complex copy
|
||||
constraint and marking the wrong variable as changed. */
|
||||
|
||||
typedef struct RExC_state_t
|
||||
{
|
||||
char *end;
|
||||
char *parse;
|
||||
} RExC_state_t;
|
||||
|
||||
struct regnode_string
|
||||
{
|
||||
unsigned char str_len;
|
||||
char string[1];
|
||||
};
|
||||
|
||||
static void *regatom (RExC_state_t * pRExC_state, int *flagp);
|
||||
|
||||
static void *
|
||||
regpiece (RExC_state_t * pRExC_state, int *flagp)
|
||||
{
|
||||
return regatom (0, 0);
|
||||
}
|
||||
|
||||
static void *
|
||||
regbranch (RExC_state_t * pRExC_state, int *flagp, int first)
|
||||
{
|
||||
return regpiece (0, 0);
|
||||
}
|
||||
|
||||
static void *
|
||||
reg (RExC_state_t * pRExC_state, int paren, int *flagp)
|
||||
{
|
||||
return regbranch (0, 0, 1);
|
||||
}
|
||||
|
||||
void *
|
||||
Perl_pregcomp (char *exp, char *xend, void *pm)
|
||||
{
|
||||
return reg (0, 0, 0);
|
||||
}
|
||||
|
||||
static void *
|
||||
regatom (RExC_state_t * pRExC_state, int *flagp)
|
||||
{
|
||||
register void *ret = 0;
|
||||
int flags;
|
||||
|
||||
tryagain:
|
||||
switch (*(pRExC_state->parse))
|
||||
{
|
||||
case '(':
|
||||
ret = reg (pRExC_state, 1, &flags);
|
||||
if (flags & 0x8)
|
||||
{
|
||||
goto tryagain;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
register unsigned long len;
|
||||
register unsigned ender;
|
||||
register char *p;
|
||||
char *oldp, *s;
|
||||
unsigned long numlen;
|
||||
unsigned long foldlen;
|
||||
unsigned char tmpbuf[6 + 1], *foldbuf;
|
||||
|
||||
defchar:
|
||||
s = (((struct regnode_string *) ret)->string);
|
||||
for (len = 0, p = (pRExC_state->parse) - 1;
|
||||
len < 127 && p < (pRExC_state->end); len++)
|
||||
{
|
||||
if (((*p) == '*' || (*p) == '+' || (*p) == '?'
|
||||
|| ((*p) == '{' && regcurly (p))))
|
||||
{
|
||||
unsigned long unilen;
|
||||
for (foldbuf = tmpbuf; foldlen; foldlen -= numlen)
|
||||
{
|
||||
reguni (pRExC_state, ender, s, &unilen);
|
||||
s += unilen;
|
||||
}
|
||||
break;
|
||||
}
|
||||
unsigned long unilen;
|
||||
|
||||
reguni (pRExC_state, ender, s, &unilen);
|
||||
s += unilen;
|
||||
}
|
||||
|
||||
};
|
||||
break;
|
||||
}
|
||||
return (ret);
|
||||
}
|
@ -1538,9 +1538,9 @@ do_complex_constraint (constraint_graph_t graph, constraint_t c, bitmap delta)
|
||||
if (flag)
|
||||
{
|
||||
get_varinfo (t)->solution = tmp;
|
||||
if (!TEST_BIT (changed, c->lhs.var))
|
||||
if (!TEST_BIT (changed, t))
|
||||
{
|
||||
SET_BIT (changed, c->lhs.var);
|
||||
SET_BIT (changed, t);
|
||||
changed_count++;
|
||||
}
|
||||
}
|
||||
@ -2065,6 +2065,7 @@ solve_graph (constraint_graph_t graph)
|
||||
bitmap solution;
|
||||
VEC(constraint_t,heap) *complex = graph->complex[i];
|
||||
bool solution_empty;
|
||||
|
||||
RESET_BIT (changed, i);
|
||||
changed_count--;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user