along with pain while passing motion suggests that you may be suffering from anal fissure
You are advised to consult a general surgeon
for confirmation of diagnosis.
Treatment involves avoiding constipation by taking plenty of water,taking more of fibre in form of fruits ands green vegetables and taking stool softener( lactulose solution ) in the night.
Apply local anesthetic ointment like xylocaine jelly before passing motion.
Do regular exercises which would help you in constipation as well as your diabetes.
Make sure that you control your blood sugar,blood pressure and cholesterol