I think it is. Chances are that friend is already well aware that he has gained weight. Either he is unhappy about it or else he doesn't care.
If he's unhappy about it he doesn't need a so-called "friend" to make him feel worse. If he doesn't care then there's no point insulting him by bringing up his weight.
Sometimes stress causes people to have cravings for high-calorie/high-fat foods. It's a physiological thing that they can't control, and if they don't give in to the cravings they will feel as if they cannot function. If, by any chance, the friend has gained weight because of stress; there's really no need to add to his stress by bringing up weight, which is probably already bothering him.
Besides, whether the friend is disturbed by his weight gain or not, it's insulting to tell him he's gained weight (not just because he may be sensitive about the weight gain, but it's arrogant to assume he's too "clueless" to have noticed the changes in his own body).