Investors & landlords

Sorry to be dense, but let's say that you sell a property and the previous carried forward passive losses are $500K but income that year is also $500K. Does that in effect reduce income to $0? Is AMT triggered in this simple example, or does it not apply because it is losses on previous income?