On Thu, 25 May 2023 18:58:04 +0200 Bernhard Reutner-Fischer wrote: > On Wed, 24 May 2023 18:54:06 +0100 > "Roger Sayle" wrote: > > > My understanding is that GCC's preferred null value for rtx is NULL_RTX > > (and for tree is NULL_TREE), and by being typed allows strict type checking, > > and use with function polymorphism and template instantiation. > > C++'s nullptr is preferred over NULL and 0 for pointer types that don't > > have a defined null of the correct type. > > > > This minor clean-up uses NULL_RTX consistently in i386-expand.cc. > > Oh. Well, i can't resist cleanups :) > (and handle nullptr too, and the same game for tree) so like the attached. And sed -e 's/RTX/TREE/g' -e 's/rtx/tree/g' \ < ~/coccinelle/gcc-rtx-null.0.cocci \ > ~/coccinelle/gcc-tree-null.0.cocci I do not know if we want to shorten explicit NULL comparisons. foo == NULL => !foo and foo != NULL => foo Left them alone in the form they were written. See the attached result of the rtx hunks, someone would have to build it and hack git-commit-mklog.py --changelog 'Use NULL_RTX.' to print("{}.".format(random.choice(['Ditto', 'Same', 'Likewise']))) ;) > > Just a thought.. cheers,