From: Georg-Johann Lay Date: Wed, 6 Mar 2024 11:46:25 +0000 (+0100) Subject: AVR: Adjust rtx cost of plus + zero_extend. X-Git-Tag: basepoints/gcc-15~803 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7d14310406a13aaf518c6c34728433077cd545a;p=thirdparty%2Fgcc.git AVR: Adjust rtx cost of plus + zero_extend. gcc/ * config/avr/avr.cc (avr_rtx_costs_1) [PLUS+ZERO_EXTEND]: Adjust rtx cost. --- diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc index 36995e05cbec..b87ae6a256de 100644 --- a/gcc/config/avr/avr.cc +++ b/gcc/config/avr/avr.cc @@ -12513,6 +12513,13 @@ avr_rtx_costs_1 (rtx x, machine_mode mode, int outer_code, return true; case PLUS: + if (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND + && REG_P (XEXP (x, 1))) + { + *total = COSTS_N_INSNS (GET_MODE_SIZE (mode) - 1); + return true; + } + switch (mode) { case E_QImode: