CodeMark AndPos;
CodeMark PushPos;
+ CodeMark RhsPos;
+ CodeMark RhsEndPos;
unsigned Mask;
unsigned Flags;
g_push (Flags, 0);
/* Read the expression on the right side of the '=' */
+ GetCodePos (&RhsPos);
hie1 (&Expr2);
+ GetCodePos (&RhsEndPos);
/* Do type conversion if necessary. Beware: Do not use char type
* here!
*/
TypeConversion (&Expr2, ltype);
- /* Special treatment if the value is constant */
- if (ED_IsConstAbsInt (&Expr2)) {
+ /* Special treatment if the value is constant. */
+ /* Beware: Expr2 may contain side effects, so there must not be
+ * code generated for Expr2.
+ */
+ if (ED_IsConstAbsInt (&Expr2) && CodeRangeIsEmpty (&RhsPos, &RhsEndPos)) {
/* Get the value and apply the mask */
unsigned Val = (unsigned) (Expr2.IVal & Mask);