[PUSHED] fortran: Add default to switch in gfc_trans_transfer [PR117843]

Message ID 20241129091628.1200006-1-quic_apinski@quicinc.com
State Committed
Commit 48b72743b0e29871171593fe34856da62d954750
Headers
Series [PUSHED] fortran: Add default to switch in gfc_trans_transfer [PR117843] |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_build--master-arm fail Patch failed to apply

Commit Message

Andrew Pinski Nov. 29, 2024, 9:16 a.m. UTC
  This fixes a bootstrap failure due to a warning on enum values not being
handled. In this case, it is just checking two values and the rest should
are not handled so adding a default case fixes the issue.

Pushed as obvious.

	PR fortran/117843
gcc/fortran/ChangeLog:

	* trans-io.cc (gfc_trans_transfer): Add default case.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
---
 gcc/fortran/trans-io.cc | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Harald Anlauf Nov. 29, 2024, 5:23 p.m. UTC | #1
Thanks, Andrew, for fixing this!

I did not get any reports from the pre-commit testers; I only
saw the fallout later.

And sorry for breaking bootstrap!

Harald

Am 29.11.24 um 10:16 schrieb Andrew Pinski:
> This fixes a bootstrap failure due to a warning on enum values not being
> handled. In this case, it is just checking two values and the rest should
> are not handled so adding a default case fixes the issue.
> 
> Pushed as obvious.
> 
> 	PR fortran/117843
> gcc/fortran/ChangeLog:
> 
> 	* trans-io.cc (gfc_trans_transfer): Add default case.
> 
> Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
> ---
>   gcc/fortran/trans-io.cc | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/gcc/fortran/trans-io.cc b/gcc/fortran/trans-io.cc
> index 906dd7c6eb6..9b0b8cfdff9 100644
> --- a/gcc/fortran/trans-io.cc
> +++ b/gcc/fortran/trans-io.cc
> @@ -2664,6 +2664,8 @@ gfc_trans_transfer (gfc_code * code)
>   		  case EXPR_FUNCTION:
>   		  case EXPR_OP:
>   		    goto scalarize;
> +		  default:
> +		    break;
>   		  }
>   	      }
>   	}
  

Patch

diff --git a/gcc/fortran/trans-io.cc b/gcc/fortran/trans-io.cc
index 906dd7c6eb6..9b0b8cfdff9 100644
--- a/gcc/fortran/trans-io.cc
+++ b/gcc/fortran/trans-io.cc
@@ -2664,6 +2664,8 @@  gfc_trans_transfer (gfc_code * code)
 		  case EXPR_FUNCTION:
 		  case EXPR_OP:
 		    goto scalarize;
+		  default:
+		    break;
 		  }
 	      }
 	}