From caa1595af210314675316780a6964d54a46c306d Mon Sep 17 00:00:00 2001 From: mmitchel Date: Wed, 15 Sep 1999 17:21:35 +0000 Subject: [PATCH] * calls.c (precompute_arguments): Fix typo in comment. * expr.c (preexpand_calls): Don't preexpand the cleanup in a TARGET_EXPR. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29438 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 +++ gcc/calls.c | 2 +- gcc/expr.c | 15 ++++++-- gcc/testsuite/g++.old-deja/g++.other/crash10.C | 52 ++++++++++++++++++++++++++ 4 files changed, 70 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/g++.old-deja/g++.other/crash10.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5d85a313e94..da8c5cb196b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Wed Sep 15 10:25:12 1999 Mark Mitchell + + * calls.c (precompute_arguments): Fix typo in comment. + * expr.c (preexpand_calls): Don't preexpand the cleanup in a + TARGET_EXPR. + Wed Sep 15 09:59:59 1999 Mark Mitchell * dsp16xx.c (override_options): Fix typos in GC root registration. diff --git a/gcc/calls.c b/gcc/calls.c index bc1e2a7b895..6a36ef01c6e 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -1199,7 +1199,7 @@ compute_argument_block_size (reg_parm_stack_space, args_size) return unadjusted_args_size; } -/* Precompute parameters has needed for a function call. +/* Precompute parameters as needed for a function call. IS_CONST indicates the target function is a pure function. diff --git a/gcc/expr.c b/gcc/expr.c index c4d0f143fe8..c51a97a93f4 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -8542,10 +8542,17 @@ preexpand_calls (exp) for (i = 0; i < nops; i++) if (TREE_OPERAND (exp, i) != 0) { - type = TREE_CODE_CLASS (TREE_CODE (TREE_OPERAND (exp, i))); - if (type == 'e' || type == '<' || type == '1' || type == '2' - || type == 'r') - preexpand_calls (TREE_OPERAND (exp, i)); + if (TREE_CODE (exp) == TARGET_EXPR && i == 2) + /* We don't need to preexpand the cleanup for a TARGET_EXPR. + It doesn't happen before the call is made. */ + ; + else + { + type = TREE_CODE_CLASS (TREE_CODE (TREE_OPERAND (exp, i))); + if (type == 'e' || type == '<' || type == '1' || type == '2' + || type == 'r') + preexpand_calls (TREE_OPERAND (exp, i)); + } } } diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash10.C b/gcc/testsuite/g++.old-deja/g++.other/crash10.C new file mode 100644 index 00000000000..3168f3f499d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/crash10.C @@ -0,0 +1,52 @@ +// Build don't link: +// Origin: Loring Holden + +template +class REFptr { + public: + REFptr(); + REFptr(T *pObj); + virtual ~REFptr(); + operator T* () const; +}; + +class GEL; +class GELsubc { + public : + virtual GEL *GELcast() const; +}; +class GELptr : public REFptr{ + public : + GELptr(const GELptr &p); + GELptr(const GELsubc &p); +}; +class GEL { }; + +class GEOM; +class GEOMptr : public REFptr, public GELsubc { + public: + GEOMptr() { } + GEOMptr(GEOM *g); +}; +class GEOM : public GEL { + public: + GEOM(const GEOMptr &o); + GEOM(); +}; + +class TEXT2D; +class TEXT2Dptr : public REFptr { + public: + TEXT2Dptr(); + TEXT2Dptr(TEXT2D *g); +}; +class TEXT2D : public GEOM { }; + +void testit(const GELptr g); + +void +FPS() +{ + TEXT2Dptr fps_text; + testit(GEOMptr(&*fps_text)); +} -- 2.11.4.GIT