[M3devel] m3cc -enable-checking=all

Jay K jay.krell at cornell.edu
Mon May 31 12:32:43 CEST 2010


-enable_checking=all does find more serious seeming stuff once the noise of int & int => word is removed:


static void
m3cg_pop (void)
{
  UNUSED_MTYPE (t);

  if (TREE_SIDE_EFFECTS (t))
    add_stmt (EXPR_REF (-1));
  EXPR_POP ();
}


intent was presumably:

static void
m3cg_pop (void)
{
  UNUSED_MTYPE (t);
  tree a = EXPR_REF (-1);

  if (TREE_SIDE_EFFECTS (a))
    add_stmt (a);
  EXPR_POP ();
}

alas..
introduced I think by rev 1.18 in 2006.
Previously we always set side_effects.


 - Jay


----------------------------------------
> From: jay.krell at cornell.edu
> To: m3devel at elegosoft.com
> Date: Mon, 31 May 2010 09:50:59 +0000
> Subject: Re: [M3devel] m3cc -enable-checking=all
>
>
> static void
> m3cg_and (void)
> {
>   MTYPE (t);
>
>   EXPR_REF (-2) = m3_build2 (BIT_AND_EXPR, m3_unsigned_type (t),
>                              EXPR_REF (-2), EXPR_REF (-1));
>   EXPR_POP ();
> }
>
>
> Why do we make the result unsigned?
>
>  - Jay
>
> ----------------------------------------
>> From: jay.krell at cornell.edu
>> To: m3devel at elegosoft.com
>> Date: Mon, 31 May 2010 08:44:27 +0000
>> Subject: [M3devel] m3cc -enable-checking=all
>>
>>
>> Configure = Configure & " -enable-checking=all"
>>
>>
>> enables a bunch of extra checks.
>> That fail.
>> With the current 4.3 backend.
>> I'm going to look into some/all of this.
>>
>>
>> .1079 = D.1078 & 1
>> ../src/ConnectRdWr.m3:35: error: type mismatch in binary expression
>> word_64
>>
>> int_64
>>
>> int_64
>>
>> D.1101 = D.1100 & 1
>> ../src/ConnectRdWr.m3:35: error: type mismatch in binary expression
>> word_64
>>
>> int_64
>>
>> int_64
>>
>> D.1121 = D.1120 & 1
>> ../src/ConnectRdWr.m3:35: error: type mismatch in binary expression
>> word_64
>>
>>
>> I think this might be one and only one problem.
>> The "tagged reference" checking using signed 1 instead of unsigned 1 in anding with the address.
>>
>> Probably positive constants that fit in the signed type of the same size shouldn't fail.
>>
>> - Jay
>>
>>
>
 		 	   		  


More information about the M3devel mailing list