The present invention relates to compounds of formula (I) or pharmaceutically acceptable salts thereof, wherein Q, T, V, W, X, Y, Z, ring A, R1, R2, R3, R4, R5, R5a, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17 and m are defined herein. There novel pyrrolopyrimidine and purine derivatives are useful in the treatment of abnormal cell growth, such as cancer, in mammals. Additional embodiments relate to pharmaceutical compositions containing the compounds and to methods of using the compounds and compositions in the treatment of abnormal cell growth in mammals.