Abstract.Restarting GMRES, a linear solver frequently used in numerical schemes, is known to suffer from stagnation. In this paper, a simple strategy is proposed to detect and avoid stagnation, without modifying the standard GMRES code. Numerical tests with the proposed modified GMRES(m) procedure for solving linear systems and also as part of an inexact Newton procedure, demonstrate the efficiency of this strategy.Mathematical subject classification: 65H10, 65F10.