[PATCH] Fix missing else keyword seen with clang-static-analyzer:

Jeff Law law@redhat.com
Tue Jun 25 20:00:00 GMT 2019


On 6/24/19 7:13 AM, Martin Liška wrote:
> 
> Hi.
> 
> The patch is fixing following clang-static-analyzer error:
> /home/marxin/Programming/gcc/gcc/bb-reorder.c:1031:2: warning: Value stored to 'is_better_edge' is never read
>         is_better_edge = true;
>         ^                ~~~~
> /home/marxin/Programming/gcc/gcc/bb-reorder.c:1034:2: warning: Value stored to 'is_better_edge' is never read
>         is_better_edge = false;
>         ^                ~~~~~
> 
> It seems to me a missing else branch.
> Honza?
> 
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
> 
> Ready to be installed?
> Thanks,
> Martin
> 
> gcc/ChangeLog:
> 
> 2019-06-24  Martin Liska  <mliska@suse.cz>
> 
> 	* bb-reorder.c (connect_better_edge_p): Add missing else
> 	statement in the middle of if-else statements.
Seems reasonable.  Essentially we'll be using counts the vast majority
of the time to determine which is the better edge -- which roughly
matches the comments in the code.

OK for the trunk.
jeff



More information about the Gcc-patches mailing list