From: Richard Guenther Date: Sun, 17 Feb 2008 15:06:53 +0000 (+0000) Subject: re PR middle-end/35227 (gcc ICEs for functions with unused complex argument) X-Git-Tag: releases/gcc-4.3.0~119 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f0a77246d3d8bdf1e72502ed94c6f8c56e45333d;p=thirdparty%2Fgcc.git re PR middle-end/35227 (gcc ICEs for functions with unused complex argument) 2008-02-17 Richard Guenther PR middle-end/35227 * tree-complex.c (init_parameter_lattice_values): Handle parameters without default definition. * gcc.dg/torture/pr35227.c: New testcase. From-SVN: r132379 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 946eb6a70030..2b3033e54bc3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-02-17 Richard Guenther + + PR middle-end/35227 + * tree-complex.c (init_parameter_lattice_values): Handle parameters + without default definition. + 2008-02-17 Richard Guenther PR tree-optimization/35231 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c167949098c6..7f8b32a72582 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-02-17 Richard Guenther + + PR middle-end/35227 + * gcc.dg/torture/pr35227.c: New testcase. + 2008-02-17 Richard Guenther PR tree-optimization/35231 diff --git a/gcc/testsuite/gcc.dg/torture/pr35227.c b/gcc/testsuite/gcc.dg/torture/pr35227.c new file mode 100644 index 000000000000..d951d250fb2d --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr35227.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ + +mandel(double _Complex C) +{ + int py; + C = (__extension__ 1.0iF) * (double)py; + return cabs(C); /* { dg-warning "incompatible" } */ +} + diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c index a1964ee6813a..b9c7ebc489ff 100644 --- a/gcc/tree-complex.c +++ b/gcc/tree-complex.c @@ -161,15 +161,14 @@ is_complex_reg (tree lhs) static void init_parameter_lattice_values (void) { - tree parm; + tree parm, ssa_name; for (parm = DECL_ARGUMENTS (cfun->decl); parm ; parm = TREE_CHAIN (parm)) - if (is_complex_reg (parm) && var_ann (parm) != NULL) - { - tree ssa_name = gimple_default_def (cfun, parm); - VEC_replace (complex_lattice_t, complex_lattice_values, - SSA_NAME_VERSION (ssa_name), VARYING); - } + if (is_complex_reg (parm) + && var_ann (parm) != NULL + && (ssa_name = gimple_default_def (cfun, parm)) != NULL_TREE) + VEC_replace (complex_lattice_t, complex_lattice_values, + SSA_NAME_VERSION (ssa_name), VARYING); } /* Initialize DONT_SIMULATE_AGAIN for each stmt and phi. Return false if