@@ -707,36 +707,11 @@ void goto_convertt::convert_assign(
707
707
}
708
708
else if (
709
709
rhs.id () == ID_side_effect &&
710
- (rhs.get (ID_statement) == ID_assign ||
711
- rhs.get (ID_statement) == ID_postincrement ||
712
- rhs.get (ID_statement) == ID_preincrement ||
713
- rhs.get (ID_statement) == ID_statement_expression ||
714
- rhs.get (ID_statement) == ID_gcc_conditional_expression))
715
- {
716
- // handle above side effects
717
- clean_expr (rhs, dest, mode);
718
-
719
- if (lhs.id () == ID_typecast)
720
- {
721
- DATA_INVARIANT (
722
- lhs.operands ().size () == 1 , " Typecast must have one operand" );
723
-
724
- // add a typecast to the rhs
725
- exprt new_rhs = rhs;
726
- rhs.make_typecast (lhs.op0 ().type ());
727
-
728
- // remove typecast from lhs
729
- exprt tmp = lhs.op0 ();
730
- lhs.swap (tmp);
731
- }
732
-
733
- code_assignt new_assign (code);
734
- new_assign.lhs () = lhs;
735
- new_assign.rhs () = rhs;
736
-
737
- copy (new_assign, ASSIGN, dest);
738
- }
739
- else if (rhs.id () == ID_side_effect)
710
+ rhs.get (ID_statement) != ID_assign &&
711
+ rhs.get (ID_statement) != ID_postincrement &&
712
+ rhs.get (ID_statement) != ID_preincrement &&
713
+ rhs.get (ID_statement) != ID_statement_expression &&
714
+ rhs.get (ID_statement) != ID_gcc_conditional_expression)
740
715
{
741
716
// preserve side effects that will be handled at later stages,
742
717
// such as allocate, new operators of other languages, e.g. java, etc
@@ -754,16 +729,6 @@ void goto_convertt::convert_assign(
754
729
// do everything else
755
730
clean_expr (rhs, dest, mode);
756
731
757
- if (lhs.id ()==ID_typecast)
758
- {
759
- // add a typecast to the rhs
760
- rhs.make_typecast (to_typecast_expr (lhs).op ().type ());
761
-
762
- // remove typecast from lhs
763
- exprt tmp=lhs.op0 ();
764
- lhs.swap (tmp);
765
- }
766
-
767
732
code_assignt new_assign (code);
768
733
new_assign.lhs ()=lhs;
769
734
new_assign.rhs ()=rhs;
0 commit comments