Spencer Tracy was VERY sick during the filming of "Guess Who's Coming to Dinner". I remember in 1967 the papers picked up on them having to shut down production at least twice. But Spence the true professional he was hid it the best he could and gave it all he had, though he looked much older than his 67 years. Another one was Humphrey Bogart who was in the early stages of cancer when he filmed "The Harder They Fall" in late 1955. It did show somewhat in his previous film "The Desperate Hours" that he was looking tired, his voice getting more gravelish. I remember reading old newspaper archives, the March 8, 1956 edition had an article saying he had a major operation right after completing the film. For about 8 months, it seemed he had licked it but fate proved otherwise.
John Wayne was in bad shape when he filmed "The Shootist" in 1976. Contrary to some sources, he was not into stages of cancer yet. Plain and simple, he was 69 years old and the years of making action packed films (mostly westerns except Brannigan and McQ) simply wore his body out. Age had caught up with him, which I never thought was possible at the time.
For earlier buffs, there was Lon Chaney who filmed the talkie version of The Unholy Three in 1930. It was filmed only a few months before his death and he died less than three weeks after its release in August. Chaney did everything to look normal as only the man of a thousand faces could. He was barely 47 when filming started but he looked ten years older. He was very thin at the neck, already had wrinkles and his voice was very stone-like (though with better sound technology, only 2 years old at the time) would likely have drastically improved that.
In a case of self destruction (still that's a major health issue) if you've seen any footage of Judy Garland in 1968, one could tell she wasn't going to be around much longer. Watch the You Tube clip of her on the Tonight Show. She is likely heavily drugged, though she does her best to bring out a few laughs. The case of Judy is a sad one--it never had to happen but MGM simply wore this lady out. The best thing that happened to her was getting away from them in 1951. L.B. Mayer was a tyrant in spite of the good films the studio made.
For silent film buffs there was Wallace Reid. Wally spent the last three years of his life addicted to morphine due to an injury. Stories abound of Wally having to be propped up in front of the camera to do his close-ups with him being so drugged. The schedule was brutal. He made an average of 7 to 8 films a year from 1920-22, his final years.