Based on results of a knock control for adjusting ignition timing in accordance
with the occurrence of knocking, an electronic control unit computes deposit required
ignition timing akgrg, which is ignition timing determined by taking adhesion of
deposits in an internal combustion engine into consideration. Based on the deposit
required ignition timing akgrg, the electronic control unit reduces a vvt allowable
variable range of a target VVT advancement amount, which is a control target value
of a variable valve timing mechanism. The electronic control unit corrects a required
ignition timing based on the actual VVT advancement amount vt, which is chanted
according to the reduction of the allowable variable range of the target VVT advancement
amount. As a result, problems resulting from the adhesion of deposits are effectively avoided.