diff options
author | Dale Johannesen <dalej@apple.com> | 2002-12-06 00:08:11 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@gcc.gnu.org> | 2002-12-06 00:08:11 +0000 |
commit | 1fcfaf375c135079ebea8aa17e726c51c938cc61 (patch) | |
tree | e2369ad9840bdca798167cf1c0dc408bed8bef39 /gcc | |
parent | 1a823ac1fd1aeb2654e666017cea1b82a3b188b6 (diff) | |
download | gcc-1fcfaf375c135079ebea8aa17e726c51c938cc61.zip gcc-1fcfaf375c135079ebea8aa17e726c51c938cc61.tar.gz gcc-1fcfaf375c135079ebea8aa17e726c51c938cc61.tar.bz2 |
tree.c (unsafe_for_reeval): Consider callee child of CALL_EXPR.
2002-12-05 Dale Johannesen <dalej@apple.com>
* tree.c (unsafe_for_reeval): Consider callee child of CALL_EXPR.
From-SVN: r59875
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/20021205-1.c | 10 | ||||
-rw-r--r-- | gcc/tree.c | 5 |
3 files changed, 17 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 683219f..dc7a57d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2002-12-05 Dale Johannesen <dalej@apple.com> + + * tree.c (unsafe_for_reeval): Consider callee child of CALL_EXPR. + 2002-12-05 Danny Smith <dannysmith@users.sourceforge.net> * config/i386/cygwin.h (SUBTARGET_PROLOGUE): Replace with diff --git a/gcc/testsuite/gcc.dg/20021205-1.c b/gcc/testsuite/gcc.dg/20021205-1.c new file mode 100644 index 0000000..a187625 --- /dev/null +++ b/gcc/testsuite/gcc.dg/20021205-1.c @@ -0,0 +1,10 @@ +/* dg-do compile */ +/* dg-options "-O3" */ +typedef struct x x; +struct x { char * (*bar) (int); }; +static x **foo() { return ((x**)baz()); } +int xyzzy() +{ + baz((*foo())->bar(0)); + return 3; +} @@ -1634,7 +1634,7 @@ unsafe_for_reeval (expr) { int unsafeness = 0; enum tree_code code; - int i, tmp; + int i, tmp, tmp2; tree exp; int first_rtl; @@ -1660,8 +1660,9 @@ unsafe_for_reeval (expr) return unsafeness; case CALL_EXPR: + tmp2 = unsafe_for_reeval (TREE_OPERAND (expr, 0)); tmp = unsafe_for_reeval (TREE_OPERAND (expr, 1)); - return MAX (tmp, 1); + return MAX (MAX (tmp, 1), tmp2); case TARGET_EXPR: unsafeness = 1; |