A landmark study from Sweden revealed that taking sleeping pills long term is associated with a significantly increased chance of dying. In men, it was 4.5x higher overall and in women it was 2x. They followed about 3500 men and women for 20 years, and found that 379 men and 278 women died during this period. Breaking down cause-specific reasons for dying, regular sleeping pill use in men was a risk factor for cardiac death, cancer death, suicide death, and death from "all remaining causes." In women it was a risk factor only for suicide. Notably, using sleeping pills in men was a better predictor of dying from cancer than from smoking.
This study support previous studies that found that short or long sleep duration is associated with increased mortality. It’s important to note that this study doesn’t prove that taking sleeping pills per sé increased your chances of dying. It’s more likely that people with illnesses such as cancer or depression are more likely to use sleeping pills. However, what if it can be shown that poor quality or quantity of sleep can cause depression, heart disease or even cancer? Come to think of it, I think there are already many studies that suggest show these results.