aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-07-18 20:27:18 +0000
committerRichard Stallman <rms@gnu.org>1993-07-18 20:27:18 +0000
commit1c2a9b35f73a69b56d1903cc39c0e3f25a33363c (patch)
tree581471a10efa6cb0722e0b146373939bb3f23525
parent551064b16e9a308ebc279316494adc2763e48a5d (diff)
downloadgcc-1c2a9b35f73a69b56d1903cc39c0e3f25a33363c.zip
gcc-1c2a9b35f73a69b56d1903cc39c0e3f25a33363c.tar.gz
gcc-1c2a9b35f73a69b56d1903cc39c0e3f25a33363c.tar.bz2
(c_expand_return): Set TREE_SIDE_EFFECTS for the MODIFY_EXPR that we make.
(build_unary_op): Support CONJ_EXPR. Change BIT_NOT_EXPR to CONJ_EXPR if arg is complex. From-SVN: r4939
-rw-r--r--gcc/c-typeck.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index af934e3..ab2b921 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -3029,7 +3029,13 @@ build_unary_op (code, xarg, noconvert)
break;
case BIT_NOT_EXPR:
- if (typecode != INTEGER_TYPE)
+ if (typecode == COMPLEX_TYPE)
+ {
+ code = CONJ_EXPR;
+ if (!noconvert)
+ arg = default_conversion (arg);
+ }
+ else if (typecode != INTEGER_TYPE)
errstring = "wrong type argument to bit-complement";
else if (!noconvert)
arg = default_conversion (arg);
@@ -3043,6 +3049,15 @@ build_unary_op (code, xarg, noconvert)
arg = default_conversion (arg);
break;
+ case CONJ_EXPR:
+ /* Conjugating a real value is a no-op, but allow it anyway. */
+ if (!(typecode == INTEGER_TYPE || typecode == REAL_TYPE
+ || typecode == COMPLEX_TYPE))
+ errstring = "wrong type argument to conjugation";
+ else if (!noconvert)
+ arg = default_conversion (arg);
+ break;
+
case TRUTH_NOT_EXPR:
if (typecode != INTEGER_TYPE
&& typecode != REAL_TYPE && typecode != POINTER_TYPE
@@ -5800,6 +5815,7 @@ c_expand_return (retval)
tree res = DECL_RESULT (current_function_decl);
t = build (MODIFY_EXPR, TREE_TYPE (res),
res, convert (TREE_TYPE (res), t));
+ TREE_SIDE_EFFECTS (t) = 1;
expand_return (t);
current_function_returns_value = 1;
}