Disclosed are purine and pyrrolo[2,3-d]pyrimidine compounds of formula (I) in which all of the variables are as defined herein. Examples are 8-(1H-indol-4-yl)-2,6-bis-((R)-3-methyl-morpholin-4-yl)-9H-purine and 8-(1H-indol-4-yl)-6-((R)-3-methyl-morpholin-4-yl)-2-(8-oxa-3-azabicyclo[3.2.1]oct-3-yl)-9H-purine. Also disclosed are pharmaceutical compositions comprising these compounds and their use as inhibitors of PI3K protein kinases and mTOR, therefore the compounds are useful in the treatment of conditions such as cancer and neurodegenerative disorders.