[Ada] Avoid repeated analysis of constraint ranges

Message ID 20210506075812.GA125732@adacore.com
State New
Headers show
Series
  • [Ada] Avoid repeated analysis of constraint ranges
Related show

Commit Message

Pierre-Marie de Rodat May 6, 2021, 7:58 a.m.
Don't call Analyse just before Process_Range_Expr_In_Decl, because the
latter starts with a call to Analyze_And_Resolve anyway.

This fixes a violation with the required sequencing in resolution of
overloaded nodes that requires the Etype being Any_Type and
Is_Overloading being False before calling Add_One_Interp for multiple
interpretations.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* sem_ch3.adb (Constraint_Index): Remove redundant problematic
	analysis.

Patch

diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -14171,8 +14171,6 @@  package body Sem_Ch3 is
       then
          --  A Range attribute will be transformed into N_Range by Resolve
 
-         Analyze (S);
-         Set_Etype (S, T);
          R := S;
 
          Process_Range_Expr_In_Decl (R, T);