From: Richard Guenther Date: Wed, 15 Apr 2009 14:17:35 +0000 (+0000) Subject: re PR tree-optimization/39764 (ICE in set_lattice_value, at tree-ssa-ccp.c:468 with... X-Git-Tag: releases/gcc-4.5.0~6585 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=25e20805c0689319973ce9a5201cd0c3e149c9e2;p=thirdparty%2Fgcc.git re PR tree-optimization/39764 (ICE in set_lattice_value, at tree-ssa-ccp.c:468 with -ffinite-math-only) 2009-04-15 Richard Guenther PR tree-optimization/39764 * tree-ssa-ccp.c (get_value): Canonicalize value with canonicalize_float_value. * g++.dg/torture/pr39764.C: New testcase. From-SVN: r146120 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 80f90940a4c3..6ba81d270a48 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-04-15 Richard Guenther + + PR tree-optimization/39764 + * tree-ssa-ccp.c (get_value): Canonicalize value with + canonicalize_float_value. + 2009-04-15 Jan Hubicka * builtins.def (va_start, va_end, va_copy): Fix my previous commit. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a6e9bf7329ef..f1a02b029c22 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-04-15 Richard Guenther + + PR tree-optimization/39764 + * g++.dg/torture/pr39764.C: New testcase. + 2009-04-15 Nathan Sidwell * g++.dg/ext/altivec-17.C: New. diff --git a/gcc/testsuite/g++.dg/torture/pr39764.C b/gcc/testsuite/g++.dg/torture/pr39764.C new file mode 100644 index 000000000000..a89013313525 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr39764.C @@ -0,0 +1,14 @@ +/* { dg-do compile } */ + +class A; +class B { }; +extern const double NaN; +B foo(A* exec, double d); +inline B baz(A* a) { + return foo(a, NaN); +} +B bar(A* a) { + return baz(a); +} +extern const double NaN = (__builtin_nanf("")); + diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 226fd3dbb27c..b9b52cdaff78 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -228,6 +228,8 @@ typedef enum doing the store). */ static prop_value_t *const_val; +static void canonicalize_float_value (prop_value_t *); + /* Dump constant propagation value VAL to file OUTF prefixed by PREFIX. */ static void @@ -387,6 +389,8 @@ get_value (tree var) if (val->lattice_val == UNINITIALIZED) *val = get_default_value (var); + canonicalize_float_value (val); + return val; }