An engine is provided with a variable valve mechanism capable of changing a
degree of an operating angle and a phase of a valve-open period of an
intake valve. A controller selectively executes at least one of a
plurality of knock controls including a phase adjustment of the valve-open
period of the intake valve when a knocking is detected by a knock sensor.
When the operating angle of the intake valve is smaller than 180 degrees,
a knock control is selected and executed such that a valve-open timing IVO
of the intake valve does not exceed a predetermined timing (TDC+.alpha.)
retarded from a top dead center TDC by a predetermined angle .alpha..
Specifically, for example, when the operating angle is smaller than 180
degrees and the valve-open timing IVO of the intake valve is after the top
dead center TDC, the valve-open timing IVO is advanced.