This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] Give more chance to 'simplify_plus_minus' in simplify-rtx.c too catch something


Christophe Jaillet <christophe.jaillet@wanadoo.fr> wrote:

> I also removed a 'gcc_assert (n_ops >= 2)' which can't trigger because
n_ops
> = 2 at the entry of the function and it can only increase (at least where
> the assert is placed)


Of course it can't: in fact, if it triggered, compilation would abort.

Please don't remove gcc_assert unless they're wrong (as in buggy). Even if
the state the obvious, the obvious might change in the future, and they
serve as a reminder of what can and cannot be done. Specifically, the
scenario you're describing which makes impossible for that assert to trigger
might change in the future and become much less obvious.
-- 
Giovanni Bajo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]