On 04/12/2016 10:06 PM, Jakub Jelinek wrote:
On Tue, Apr 12, 2016 at 10:02:18PM +0200, Bernd Schmidt wrote:
On 04/12/2016 05:10 PM, Jakub Jelinek wrote:
This patch arranges for a new argument to
convert_memory_address_addr_space_1 and calls it with that new argument set
to true, to make sure it never emits instructions or creates pseudos.
I think the approach looks sensible, but I don't know if you need the extra
argument. It looks like convert_memory_address_addr_space_1 currently only
has one user, can't you move the convert_modes call up into that function so
that convert_memory_address_addr_space_1 never emits anything?
convert_memory_address_addr_space_1 is recursive function, so it has more
than one caller (convert_memory_address_addr_space and itself).
D'oh. Sorry.
Which actually means that the patch is wrong, for no_emit on the recursive
calls it should actually check the result of the recursive call and
return NULL immediately if the recursive call returned NULL.
Hmm. I wonder whether this couldn't be restructured a bit to strip CONST
internally and putting it back at the end. However, now is not the time
for that.
So, would you be ok with the patch if I change it that way (to be tested
tomorrow)?
Yeah, I think so.
Bernd