[gcc r16-9365] bpf: TARGET_INSN_COST: don't hardcode 1 for default ...

"Jose E. Marchesi via Gcc-cvs" <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:49f12ddc83374845f12fac9534de3e7463db828f

commit r16-9365-g49f12ddc83374845f12fac9534de3e7463db828f
Author: Vineet Gupta <[email protected]>
Date:   Mon Jul 20 11:00:56 2026 -0700

    bpf: TARGET_INSN_COST: don't hardcode 1 for default ...
    
    ... instead use pattern_cost () as used by other backends
    
    gcc/ChangeLog:
    
            * config/bpf/bpf.cc (bpf_insn_cost): Return pattern_cost () by default.
    
    Signed-off-by: Vineet Gupta <[email protected]>
    (cherry picked from commit 3c71ff89bb03152828f0efc5f1de5febf35fc039)

Diff:
---
 gcc/config/bpf/bpf.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/bpf/bpf.cc b/gcc/config/bpf/bpf.cc
index 42fdc695881a..6bd714d50534 100644
--- a/gcc/config/bpf/bpf.cc
+++ b/gcc/config/bpf/bpf.cc
@@ -648,7 +648,7 @@ bpf_insn_cost (rtx_insn *insn, bool speed ATTRIBUTE_UNUSED)
      && XINT (XEXP (pat, 1), 1) == UNSPEC_CORE_RELOC)
     return COSTS_N_INSNS (100);
 
-  return COSTS_N_INSNS (1);
+  return pattern_cost (pat, speed);
 }
 
 #undef TARGET_INSN_COST
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.