/* Functions defined in mc_main.c */
extern REGPARM(1) void MC_(helperc_complain_undef) ( HWord );
+extern void MC_(helperc_value_check4_fail) ( void );
+extern void MC_(helperc_value_check0_fail) ( void );
extern REGPARM(1) void MC_(helperc_STOREV8) ( Addr, ULong );
extern REGPARM(2) void MC_(helperc_STOREV4) ( Addr, UInt );
*/
static void complainIfUndefined ( MCEnv* mce, IRAtom* atom )
{
- //static Int zzz=0;
-
/* Since the original expression is atomic, there's no duplicated
work generated by making multiple V-expressions for it. So we
don't really care about the possibility that someone else may
IRAtom* cond = mkPCastTo( mce, Ity_Bit, vatom );
/* cond will be 0 if all defined, and 1 if any not defined. */
- IRDirty* di
- = unsafeIRDirty_0_N( 1/*regparms*/,
- "MC_(helperc_complain_undef)",
- &MC_(helperc_complain_undef),
- mkIRExprVec_1( mkIRExpr_HWord( sz
- // zzz++
- ) ));
+ IRDirty* di;
+ if (sz == 4) {
+ di = unsafeIRDirty_0_N( 0/*regparms*/,
+ "MC_(helperc_value_check4_fail)",
+ &MC_(helperc_value_check4_fail),
+ mkIRExprVec_0()
+ );
+ }
+ else if (sz == 0) {
+ di = unsafeIRDirty_0_N( 0/*regparms*/,
+ "MC_(helperc_value_check0_fail)",
+ &MC_(helperc_value_check0_fail),
+ mkIRExprVec_0()
+ );
+ }
+ else {
+ di = unsafeIRDirty_0_N( 1/*regparms*/,
+ "MC_(helperc_complain_undef)",
+ &MC_(helperc_complain_undef),
+ mkIRExprVec_1( mkIRExpr_HWord( sz ))
+ );
+ }
di->guard = cond;
setHelperAnns( mce, di );
stmt( mce->bb, IRStmt_Dirty(di));