https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80949

--- Comment #7 from Eric Gallager <egall at gwmail dot gwu.edu> ---
(In reply to Marek Polacek from comment #6)
> Would it be possible for you to try this patch?
> 
> --- a/gcc/c-family/c-warn.c
> +++ b/gcc/c-family/c-warn.c
> @@ -2354,8 +2354,8 @@ do_warn_duplicated_branches (tree expr)
>    tree thenb = COND_EXPR_THEN (expr);
>    tree elseb = COND_EXPR_ELSE (expr);
>  
> -  /* Don't bother if there's no else branch.  */
> -  if (elseb == NULL_TREE)
> +  /* Don't bother if any of the branches is missing.  */
> +  if (thenb == NULL_TREE || elseb == NULL_TREE)
>      return;
>  
>    /* And don't warn for empty statements.  */

I tried it and it worked; compilation succeeded with no ICEs (or other errors
for that matter). Thank you!

Reply via email to