arithmetic HI+PSI

Aurelien Buhrig aurelien.buhrig.gcc@gmail.com
Mon Oct 17 08:03:00 GMT 2011


>> When I add a pointer (PSImode) with an int (HImode) (ex: sp-=cnt) ,
>> gcc expands the signed int by zero_extend'ing  the int and then adding
>> both PSI values (instead of sign extending).
>> How should I fix this ?
>> POINTERS_EXTEND_UNSIGNED is 0.
>
> As far as I know the int will be converted to SIZE_TYPE before being> added to the pointer.  Converting a signed int to SIZE_TYPE should sign> extend if SIZE_TYPE is larger than int.  I don't know why you are not> seeing that.
OK, I assume the problem is also linked to the size_t which does not
have the correct size (or a crash occurs during the
tree_ssa_loop_ivopts pass).
So I will try and fix the ssa ivopt crash first.

thanks for your help!
Aurélien



More information about the Gcc-help mailing list