Modern car engines have some very complex computer controlled systems in them. And the engine computers have the ability to "self-test" various systems.
And have "back-up" systems for some things should one of these systems fail.
In certain situations, the self test might detect a failure with a system - like an input to spark plug timing. Then set the check engine light and place a diagnostic trouble code in the computer memory. And then set the engine timing to a default "Limp Home Mode" which will allow you to still drive the car.
In that case you would not have the optimum timing or engine
performance and it would use more gas, but it would run.
However the check engine light could be on for all sorts of reasons. Maybe it is...
DTC P0565 Cruise Control On Signal Malfunction
Or any number of other reasons. Many of which would have nothing to do with gas mileage.
Here is a list of trouble codes...
OBD-II Check Engine Light Trouble Codes
FYI - As to which codes would be associated with a "limp home mode", good luck finding that information! This is sometimes mentioned in a Factory Service Manual, but will be
buried in text for a specific system or troubleshooting section.
And this has to do with the programming in the engine computer. That they keep top secret or feel that no one needs to know this information (they intentionally "dumb it down"*).
*If they want to get intelligent people to be car mechanics, they had better start making this technical information available! (Like the rest of the electronics industry does...)