diff options
| author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-12 22:24:48 +0000 |
|---|---|---|
| committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-12 22:24:48 +0000 |
| commit | 824638f97ef2652875dbbf1c5decff18de2c9713 (patch) | |
| tree | c8a7fb056d60c96eb16729f4d66e63d6bfdcbd45 | |
| parent | 777bb3dc76d24121756fee72a23c67339754ce39 (diff) | |
| download | ppe42-gcc-824638f97ef2652875dbbf1c5decff18de2c9713.tar.gz ppe42-gcc-824638f97ef2652875dbbf1c5decff18de2c9713.zip | |
PR c++/7050
* expr.c (store_expr): Don't attempt to store void-typed trees,
just evaluate them for side effects.
* cp/expr.c (cxx_expand_expr): Return const0_rtx for throw
expressions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64268 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 14 | ||||
| -rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/cp/expr.c | 2 | ||||
| -rw-r--r-- | gcc/expr.c | 10 |
4 files changed, 27 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f970d7b997c..30dbe70a6d3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-03-12 Andrew Lewycky <andrew@mxc.ca> + + PR c++/7050 + * expr.c (store_expr): Don't attempt to store void-typed trees, + just evaluate them for side effects. + 2003-03-12 Neil Booth <neil@daikokuya.co.uk> * cppfiles.c (cpp_rename_file, cpp_push_include): New. @@ -9,10 +15,10 @@ 2003-03-12 Nathanael Nerode <neroden@gcc.gnu.org> - * aclocal.m4: Introduce gcc_GAS_VERSION_GTE_IFELSE, - _gcc_COMPUTE_GAS_VERSION. - * configure.in: Use them. - * configure: Regenerate. + * aclocal.m4: Introduce gcc_GAS_VERSION_GTE_IFELSE, + _gcc_COMPUTE_GAS_VERSION. + * configure.in: Use them. + * configure: Regenerate. 2003-03-12 Bob Wilson <bob.wilson@acm.org> diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1e3380881db..71d753625b8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2003-03-12 Andrew Lewycky <andrew@mxc.ca> + + PR c++/7050 + * expr.c (cxx_expand_expr): Return const0_rtx for throw + expressions. + 2003-03-11 Mark Mitchell <mark@codesourcery.com> PR c++/9474 diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c index 7252a4df9c3..160a946ef9a 100644 --- a/gcc/cp/expr.c +++ b/gcc/cp/expr.c @@ -105,7 +105,7 @@ cxx_expand_expr (tree exp, rtx target, enum machine_mode tmode, int modifier) case THROW_EXPR: expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode, 0); - return NULL; + return const0_rtx; case MUST_NOT_THROW_EXPR: expand_eh_region_start (); diff --git a/gcc/expr.c b/gcc/expr.c index 46b264ea584..e540fb23158 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -4354,6 +4354,16 @@ store_expr (exp, target, want_value) int dont_return_target = 0; int dont_store_target = 0; + if (VOID_TYPE_P (TREE_TYPE (exp))) + { + /* C++ can generate ?: expressions with a throw expression in one + branch and an rvalue in the other. Here, we resolve attempts to + store the throw expression's nonexistant result. */ + if (want_value) + abort (); + expand_expr (exp, const0_rtx, VOIDmode, 0); + return NULL_RTX; + } if (TREE_CODE (exp) == COMPOUND_EXPR) { /* Perform first part of compound expression, then assign from second |

