The gimple_call_alloc_size() function is documented to "return null when STMT is not a call to a valid allocation function" but the code assumes STMT is a call statement, causing the function to ICE when it isn't. The attached patch changes the function to fulfill its contract and return null also when STMT isn't a call. The fix seems obvious to me but I'll wait some time before committing it in case it's not to someone else. Martin