]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
chrec: Move variable rtype definition to the scope only used
authorAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Tue, 21 Apr 2026 18:11:58 +0000 (11:11 -0700)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Sun, 3 May 2026 23:10:46 +0000 (16:10 -0700)
rtype here is only needed for POINTER_PLUS_EXPR and is only used
in the condition for PPE, so move it to that scope instead.

Pushed as obvious after bootstrap/test on x86_64-linux-gnu.

gcc/ChangeLog:

* tree-chrec.cc (chrec_fold_plus_poly_poly): Move
rtype definition to right before the use.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
gcc/tree-chrec.cc

index 09dd81900bce70138f975c68b77c4ba6d0e45fc3..20beaeb09ec0cf1b7ffbcefa55789beded5e3869 100644 (file)
@@ -53,7 +53,6 @@ chrec_fold_plus_poly_poly (enum tree_code code,
   tree left, right;
   class loop *loop0 = get_chrec_loop (poly0);
   class loop *loop1 = get_chrec_loop (poly1);
-  tree rtype = code == POINTER_PLUS_EXPR ? chrec_type (poly1) : type;
 
   gcc_assert (poly0);
   gcc_assert (poly1);
@@ -112,6 +111,7 @@ chrec_fold_plus_poly_poly (enum tree_code code,
 
   if (code == PLUS_EXPR || code == POINTER_PLUS_EXPR)
     {
+      tree rtype = code == POINTER_PLUS_EXPR ? chrec_type (poly1) : type;
       left = chrec_fold_plus
        (type, CHREC_LEFT (poly0), CHREC_LEFT (poly1));
       right = chrec_fold_plus