Garry Shandling was feeling bad the night before he died, and he was making plans to go to the ER Thursday afternoon.
Sources connected with the comedian tell TMZ ... he spoke with a doctor friend of his Wednesday late afternoon, complaining he was not feeling well. The doctor was concerned enough that he came to Shandling's home and checked him out.
Garry complained he was achy and short of breath. He did not complain of chest pains. The doctor told Garry if he was not feeling well the next day he should go to the ER to check it out. Garry said if he wasn't feeling better he'd probably go sometime Thursday afternoon.
In a recent appearance on Jerry Seinfeld's "Comedians in Cars Getting Coffee," Shandling cracked a joke about having hyperparathyroidism ... which, according to the Mayo Clinic, can lead to cardiovascular disease.
TMZ broke the story, Garry called 911 Thursday at around 10:30 AM and fell unconscious during the call. Paramedics responded, broke his door down and found him unresponsive. We're told he had a weak pulse at the house. He was pronounced dead at St. John's Hospital in Santa Monica.