diff options
author | Martin Jambor <mjambor@suse.cz> | 2010-10-04 12:15:10 +0200 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2010-10-04 12:15:10 +0200 |
commit | 1dbee8c9f90c562d20928c489412d4eca2e4b21a (patch) | |
tree | 6e4513da8811502ddc1fda4c23a67e0fd29d9709 /gcc | |
parent | eeb4dfdacf3a27faa5487d7cdc0aea3f0473a0bd (diff) | |
download | gcc-1dbee8c9f90c562d20928c489412d4eca2e4b21a.tar.gz |
re PR tree-optimization/45572 (various ICEs with -finline-small-functions -findirect-inlining -finline-functions)
2010-10-04 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/45572
* ipa-prop.c (ipa_make_edge_direct_to_target): Call
ipa_check_create_node_params.
* ipa-inline.c (add_new_edges_to_heap): Do not insert inlined edges.
* testsuite/g++.dg/ipa/pr45572-1.C: New test.
* testsuite/g++.dg/ipa/pr45572-2.C: Likewise.
From-SVN: r164930
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/ipa-inline.c | 1 | ||||
-rw-r--r-- | gcc/ipa-prop.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ipa/pr45572-1.C | 64 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ipa/pr45572-2.C | 39 |
6 files changed, 118 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9367b72557e..1a0a3f0275f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2010-10-04 Martin Jambor <mjambor@suse.cz> + + PR tree-optimization/45572 + * ipa-prop.c (ipa_make_edge_direct_to_target): Call + ipa_check_create_node_params. + * ipa-inline.c (add_new_edges_to_heap): Do not insert inlined edges. + 2010-10-04 Yao Qi <yao@codesourcery.com> * doc/passes.texi: Clean up. diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 21e0b647973..ca3823b53b3 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -1031,6 +1031,7 @@ add_new_edges_to_heap (fibheap_t heap, VEC (cgraph_edge_p, heap) *new_edges) gcc_assert (!edge->aux); if (edge->callee->local.inlinable + && edge->inline_failed && cgraph_default_inline_p (edge->callee, &edge->inline_failed)) edge->aux = fibheap_insert (heap, cgraph_edge_badness (edge, false), edge); } diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index e1d821e3988..9ffbb3f90a9 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -1447,7 +1447,7 @@ ipa_make_edge_direct_to_target (struct cgraph_edge *ie, tree target) callee = cgraph_node (target); if (!callee) return NULL; - + ipa_check_create_node_params (); cgraph_make_edge_direct (ie, callee); if (dump_file) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 00fc30c80e2..f64f53128bb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2010-10-04 Martin Jambor <mjambor@suse.cz> + + PR tree-optimization/45572 + * g++.dg/ipa/pr45572-1.C: New test. + * g++.dg/ipa/pr45572-2.C: Likewise. + 2010-10-03 Ian Lance Taylor <iant@google.com> * gcc.dg/anon-struct-11.c: New test. diff --git a/gcc/testsuite/g++.dg/ipa/pr45572-1.C b/gcc/testsuite/g++.dg/ipa/pr45572-1.C new file mode 100644 index 00000000000..82f347052d5 --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr45572-1.C @@ -0,0 +1,64 @@ +// { dg-do compile } +// { dg-options "-finline-small-functions -findirect-inlining -finline-functions -O" } + +extern "C" { +typedef long unsigned int size_t; +typedef long int __ssize_t; +typedef struct _IO_FILE FILE; +typedef struct +{ +} __mbstate_t; +extern __inline __attribute__ ((__gnu_inline__)) int +fgetc_unlocked (FILE *__fp) +{ +} +extern __inline __attribute__ ((__gnu_inline__)) int +putc_unlocked (int __c, FILE *__stream) +{ +} +extern __inline __attribute__ ((__gnu_inline__)) __ssize_t +getline (char **__lineptr, size_t *__n, FILE *__stream) +{ +} +extern __inline __attribute__ ((__gnu_inline__)) int +ferror_unlocked (FILE *__stream) throw () +{ +} +} +typedef struct +{} __mpf_struct; +typedef __mpf_struct mpf_t[1]; +typedef const __mpf_struct *mpf_srcptr; +typedef __mpf_struct *mpf_ptr; +extern "C" { + void __gmpf_add (mpf_ptr, mpf_srcptr, mpf_srcptr); +} +class _knumber +{ + public: + enum NumType {SpecialType, IntegerType, FractionType, FloatType}; + virtual NumType type(void) const = 0; + virtual _knumber * add(_knumber const & arg2) const = 0; + virtual operator long int(void) const = 0; +}; +class _knumfloat : public _knumber +{ + _knumfloat(double num = 1.0) + ; + virtual NumType type(void) const ; + virtual _knumber * add(_knumber const & arg2) const; + virtual operator long int (void) const; + mpf_t _mpf; +}; +_knumber *_knumfloat::add(_knumber const & arg2) const +{ + if (arg2.type() == SpecialType) + return arg2.add(*this); +{ + _knumfloat tmp_num(arg2); + return tmp_num.add(*this); + } + _knumfloat * tmp_num = new _knumfloat(); + __gmpf_add(tmp_num->_mpf, _mpf, + dynamic_cast<_knumfloat const &>(arg2)._mpf); +} diff --git a/gcc/testsuite/g++.dg/ipa/pr45572-2.C b/gcc/testsuite/g++.dg/ipa/pr45572-2.C new file mode 100644 index 00000000000..8b583d9c5d5 --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr45572-2.C @@ -0,0 +1,39 @@ +// { dg-do compile } +// { dg-options "-finline-small-functions -findirect-inlining -finline-function+ +typedef struct +{} __mpf_struct; +typedef __mpf_struct mpf_t[1]; +typedef const __mpf_struct *mpf_srcptr; +typedef __mpf_struct *mpf_ptr; +extern "C" { + void __gmpf_add (mpf_ptr, mpf_srcptr, mpf_srcptr); +} +class _knumber +{ + public: + enum NumType {SpecialType, IntegerType, FractionType, FloatType}; + virtual NumType type(void) const = 0; + virtual _knumber * add(_knumber const & arg2) const = 0; + virtual operator long int(void) const = 0; +}; +class _knumfloat : public _knumber +{ + _knumfloat(double num = 1.0) + ; + virtual NumType type(void) const ; + virtual _knumber * add(_knumber const & arg2) const; + virtual operator long int (void) const; + mpf_t _mpf; +}; +_knumber *_knumfloat::add(_knumber const & arg2) const +{ + if (arg2.type() == SpecialType) + return arg2.add(*this); +{ + _knumfloat tmp_num(arg2); + return tmp_num.add(*this); + } + _knumfloat * tmp_num = new _knumfloat(); + __gmpf_add(tmp_num->_mpf, _mpf, + dynamic_cast<_knumfloat const &>(arg2)._mpf); +} |