Per IRS Instructions for Form 1120, page 11:
If the corporation claims certain credits, it may need to reduce the otherwise allowable deductions for expenses used to figure the credit. This applies to credits such as the following.
If the corporation has any of the credits listed above, figure the current year credit before figuring the deduction for expenses on which the credit is based. If the corporation capitalized any costs on which it figured the credit, it may need to reduce the amount capitalized by the credit attributable to these costs. See the instructions for the form used to figure the applicable credit for more details.
Note that any link in the information above is updated each year automatically and will take you to the most recent version of the webpage or document at the time it is accessed.