diff options
| author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-17 08:04:25 +0000 |
|---|---|---|
| committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-17 08:04:25 +0000 |
| commit | 5bfb60b4afb3901e09b9303def258f7ee72ad5ac (patch) | |
| tree | 0b1589a866d7d8f6ffa994b2f8e67db942d248ff /gcc | |
| parent | 68023786d1eea3fb2a81f027c5090cee7d87b162 (diff) | |
| download | ppe42-gcc-5bfb60b4afb3901e09b9303def258f7ee72ad5ac.tar.gz ppe42-gcc-5bfb60b4afb3901e09b9303def258f7ee72ad5ac.zip | |
2006-07-17 Richard Guenther <rguenther@suse.de>
PR tree-optimization/28238
* tree-inline.c (copy_bb): Check if we produced valid
gimple copying and substituting a stmt. If not, gimplify
it.
* g++.dg/tree-ssa/pr28238.C: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115517 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
| -rw-r--r-- | gcc/ChangeLog | 7 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/testsuite/g++.dg/tree-ssa/pr28238.C | 22 | ||||
| -rw-r--r-- | gcc/tree-inline.c | 8 |
4 files changed, 42 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 90c89795d4a..8c6048b7e09 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2006-07-17 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/28238 + * tree-inline.c (copy_bb): Check if we produced valid + gimple copying and substituting a stmt. If not, gimplify + it. + 2006-07-16 Eric Botcazou <ebotcazou@adacore.com> * optabs.c (maybe_encapsulate_block): New function extracted from... diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8b6cf37bd73..9b08ae65f01 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-07-17 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/28238 + * g++.dg/tree-ssa/pr28238.C: New testcase. + 2006-07-17 Volker Reichelt <reichelt@igpm.rwth-aachen.de> PR c++/28250 diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr28238.C b/gcc/testsuite/g++.dg/tree-ssa/pr28238.C new file mode 100644 index 00000000000..97e388fbd32 --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/pr28238.C @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +struct iterator{}; +struct ByteIterator : iterator +{ + ByteIterator (){} + int a[1024]; +}; +inline ByteIterator f () +{ + return ByteIterator (); +} +class ConfLexerCore +{ + ConfLexerCore (); + ByteIterator m_matchStart; +}; +ConfLexerCore::ConfLexerCore () +: m_matchStart (f ()) +{ } + diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 4749be519e3..92d85a89b2b 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -704,6 +704,14 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale, int count_scal if (stmt) { tree call, decl; + + /* With return slot optimization we can end up with + non-gimple (foo *)&this->m, fix that here. */ + if (TREE_CODE (stmt) == MODIFY_EXPR + && TREE_CODE (TREE_OPERAND (stmt, 1)) == NOP_EXPR + && !is_gimple_val (TREE_OPERAND (TREE_OPERAND (stmt, 1), 0))) + gimplify_stmt (&stmt); + bsi_insert_after (©_bsi, stmt, BSI_NEW_STMT); call = get_call_expr_in (stmt); /* We're duplicating a CALL_EXPR. Find any corresponding |

