> On Sep 13, 2018, at 10:08 AM, Andrew Stubbs <a...@codesourcery.com> wrote:
>
> On 13/09/18 11:01, Andrew Stubbs wrote:
>> The assert is caused because the def-use chains indicate that SCC conflicts
>> with itself. I suppose the question is why is it doing that, but it's
>> probably do do with that being a special register that gets used in split2
>> (particularly by the addptrdi3 pattern). Although, those patterns are
>> careful to save SCC to one side and then restore it again after, so I'd have
>> thought the DF analysis would work out?
>
> I think I may have a theory on this one now....
>
> The addptrdi3 pattern must use two 32-bit adds with a carry in SCC, but
> addptr patterns are not allowed to clobber SCC, so the splitter carefully
> saves and restores the old value.
If you don't have machine operations that add without messing with condition
codes, wouldn't it make sense to omit the definition of the add-pointer
patterns? GCC will build things out of normal (CC-clobbering) adds if there
are no add-pointer operations, which may well be more efficient in most cases
than explicitly saving/restoring a CC that may in fact not matter right at that
spot.
paul