[PATCH] jump: Change return type of predicate functions from int to bool

Bernhard Reutner-Fischer rep.dot.nop@gmail.com
Wed May 31 19:41:09 GMT 2023


On Wed, 31 May 2023 09:40:24 +0200
Uros Bizjak via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:

> On Wed, May 31, 2023 at 9:17 AM Richard Biener
> <richard.guenther@gmail.com> wrote:

> > Do we have a diagnostic that would point out places we
> > assign the bool result to an integer variable?  Do we want
> > to change those places as well (did you intend to or restrict
> > the changes to functions only used in conditional context?)  
> 
> FWIW, I'm going through candidate files by hand, looking for predicate
> functions that return 0/1. The candidate files are the ones mentioned
> in rtl.h. In addition, I am doing some drive-by cleanups in candidate
> files.

I've scratched
https://inbox.sourceware.org/gcc-patches/20221112234543.95441-5-aldot@gcc.gnu.org/
https://inbox.sourceware.org/gcc-patches/20221112234543.95441-6-aldot@gcc.gnu.org/

to generate patches.
You had to manually adjust the declarations to match the patched
definitions, and i did not change the type of local variables feeding
into the return automatically.

But it helped find some low hanging fruit quickly.

HTH and cheers,


More information about the Gcc-patches mailing list