From de67f00e393bc5d623ed70a4ca45d8be271edba1 Mon Sep 17 00:00:00 2001 From: Michael Hayes Date: Mon, 8 Feb 1999 13:50:22 +0000 Subject: [PATCH] c4x.c (c4x_address_cost): Return cost of 1 for REG+REG addressing if strength reduction enabled. * config/c4x/c4x.c (c4x_address_cost): Return cost of 1 for REG+REG addressing if strength reduction enabled. From-SVN: r25086 --- gcc/ChangeLog | 5 +++++ gcc/config/c4x/c4x.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 196d66ea24d..c81dbb583cd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Tue Feb 9 10:46:42 1999 Michael Hayes + + * config/c4x/c4x.c (c4x_address_cost): Return cost of 1 for + REG+REG addressing if strength reduction enabled. + Tue Feb 9 10:10:31 1999 Michael Hayes * config/c4x/t-c4x (LIBGCC2_CFLAGS): Delete. diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c index 2e4b941136e..291c22dba54 100644 --- a/gcc/config/c4x/c4x.c +++ b/gcc/config/c4x/c4x.c @@ -1508,6 +1508,14 @@ rtx addr; break; case REG: + /* Paradoxically, if we want autoincrement addressing for + complex arithmetic and structure arrays, we must give + REG+REG addressing the same cost as REG addressing to + prevent CSE from avoiding REG+REG addresses. This is + because GIV combination in loop.c is suboptimal and + needs fixing. */ + if (flag_strength_reduce) + return 1; return 2; case CONST_INT: -- 2.30.2