mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-30 07:44:45 +08:00
typeck.c (unary_complex_lvalue): Do not duplicate the argument to modify...
* typeck.c (unary_complex_lvalue): Do not duplicate the argument to modify, pre-, or post-increment when used as an lvalue and when the argument has side-effects. From-SVN: r43884
This commit is contained in:
parent
d777856dc8
commit
ae818d3be8
@ -1,3 +1,9 @@
|
||||
2001-07-09 Erik Rozendaal <dlr@acm.org>
|
||||
|
||||
* typeck.c (unary_complex_lvalue): Do not duplicate the
|
||||
argument to modify, pre-, or post-increment when used as an
|
||||
lvalue and when the argument has side-effects.
|
||||
|
||||
2001-07-08 Joseph S. Myers <jsm28@cam.ac.uk>
|
||||
|
||||
* decl.c (start_decl): Don't call SET_DEFAULT_DECL_ATTRIBUTES.
|
||||
@ -12,7 +18,7 @@
|
||||
|
||||
2001-07-06 Ira Ruben <ira@apple.com>
|
||||
|
||||
* cp-tree.def (TEMPLATE_DECL): Update comment. DECL_RESULT should
|
||||
* cp-tree.def (TEMPLATE_DECL): Update comment. DECL_RESULT should
|
||||
be DECL_TEMPLATE_RESULT.
|
||||
|
||||
2001-07-05 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||
|
@ -4808,12 +4808,21 @@ unary_complex_lvalue (code, arg)
|
||||
|| TREE_CODE (arg) == MIN_EXPR || TREE_CODE (arg) == MAX_EXPR)
|
||||
return rationalize_conditional_expr (code, arg);
|
||||
|
||||
/* Handle (a = b), (++a), and (--a) used as an "lvalue". */
|
||||
if (TREE_CODE (arg) == MODIFY_EXPR
|
||||
|| TREE_CODE (arg) == PREINCREMENT_EXPR
|
||||
|| TREE_CODE (arg) == PREDECREMENT_EXPR)
|
||||
return unary_complex_lvalue
|
||||
(code, build (COMPOUND_EXPR, TREE_TYPE (TREE_OPERAND (arg, 0)),
|
||||
arg, TREE_OPERAND (arg, 0)));
|
||||
{
|
||||
tree lvalue = TREE_OPERAND (arg, 0);
|
||||
if (TREE_SIDE_EFFECTS (lvalue))
|
||||
{
|
||||
lvalue = stabilize_reference (lvalue);
|
||||
arg = build (TREE_CODE (arg), TREE_TYPE (arg),
|
||||
lvalue, TREE_OPERAND (arg, 1));
|
||||
}
|
||||
return unary_complex_lvalue
|
||||
(code, build (COMPOUND_EXPR, TREE_TYPE (lvalue), arg, lvalue));
|
||||
}
|
||||
|
||||
if (code != ADDR_EXPR)
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user