Gai gave Madara that work and had him almost got killed which is why Madara acknowledges Gai and gave him for putting in work. I felt cheated that Gai's death has been postponed due to Naruto saving him with some new found ability cause I'd rather to see Gai's death in honor for an epic battle and die hero, similar to Jiraiya death but the only missing is that nobody has ever witnessed Jiriya fought battle against Pain while everybody wintessed Gai sacificed his life for fighting against SoSP Madara. Naruto is now stronger than ever so I wonder how can SoSP Madara recovery from the injuries that Gai gave him work.