In reply to kireeti1192:
https://www.avrfreaks.net/forum/why-are-all-interrupt-flags-cleared-writing-logical-1