chrec: Move variable rtype definition to the scope only used

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>
This commit is contained in:
Andrew Pinski
2026-04-21 11:11:58 -07:00
parent b183634956
commit 07df1f36a0

View 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