Commit 6fff2603 by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/23929 (segfault in expand_simple_operations, tree-ssa-loop-niter.c:637)

	PR tree-optimization/23929
	* tree-ssa-loop-niter.c (expand_simple_operations): Return immediately
	if expr is NULL.

	* gcc.c-torture/compile/pr23929.c: New test.

From-SVN: r104461
parent df5d6367
2005-09-20 Jakub Jelinek <jakub@redhat.com> 2005-09-20 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/23929
* tree-ssa-loop-niter.c (expand_simple_operations): Return immediately
if expr is NULL.
PR tree-optimization/23818 PR tree-optimization/23818
* tree-stdarg.c (execute_optimize_stdarg): Call * tree-stdarg.c (execute_optimize_stdarg): Call
calculate_dominance_info. calculate_dominance_info.
......
2005-09-20 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/23929
* gcc.c-torture/compile/pr23929.c: New test.
2005-09-20 Steve Ellcey <sje@cup.hp.com> 2005-09-20 Steve Ellcey <sje@cup.hp.com>
PR testsuite/23186 PR testsuite/23186
/* PR tree-optimization/23929 */
extern void bar (char *);
void
foo (int n, char *z)
{
char b[2048];
int x, y;
bar (b);
for (y = 0; y < 60; y++)
if (n == 600)
for (x = 0; x < 320;)
{
*z++ = b[x];
x += 1;
*z++ = b[x];
x += 1;
}
}
...@@ -634,11 +634,15 @@ expand_simple_operations (tree expr) ...@@ -634,11 +634,15 @@ expand_simple_operations (tree expr)
{ {
unsigned i, n; unsigned i, n;
tree ret = NULL_TREE, e, ee, stmt; tree ret = NULL_TREE, e, ee, stmt;
enum tree_code code = TREE_CODE (expr); enum tree_code code;
if (expr == NULL_TREE)
return expr;
if (is_gimple_min_invariant (expr)) if (is_gimple_min_invariant (expr))
return expr; return expr;
code = TREE_CODE (expr);
if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code))) if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code)))
{ {
n = TREE_CODE_LENGTH (code); n = TREE_CODE_LENGTH (code);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment