A device for controlling an internal combustion engine, comprising a
variable valve mechanism for varying opening areas (valve lift) or the
working angles (valve-opening periods) of at least either the intake
valves or the exhaust valves, wherein a pressure in the cylinder is
calculated based on the opening area or the working angle of at least
either the intake valve or the exhaust valve varied by the variable valve
mechanism, and the internal combustion engine is controlled based on the
pressure in the cylinder. Upon calculating the pressure in the cylinder
based on the opening areas or the working angles of the intake and
exhaust valves, it is possible to more suitably control the internal
combustion engine based not only upon the peak combustion pressure in the
cylinder like when a combustion pressure sensor is used but also upon a
pressure in the cylinder at a moment other than the peak combustion
pressure.