mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 14:59:39 +02:00
rs6000: Call library for block memory compare when optimizing for size
gcc/ * config/rs6000/rs6000.md (cmpmemsi): Fail when optimizing for size. gcc/testsuite/ * gcc.target/powerpc/block-cmp-3.c: New.
This commit is contained in:
@@ -10146,6 +10146,9 @@
|
||||
(use (match_operand:SI 4))])]
|
||||
"TARGET_POPCNTD"
|
||||
{
|
||||
if (optimize_insn_for_size_p ())
|
||||
FAIL;
|
||||
|
||||
if (expand_block_compare (operands))
|
||||
DONE;
|
||||
else
|
||||
|
||||
8
gcc/testsuite/gcc.target/powerpc/block-cmp-3.c
Normal file
8
gcc/testsuite/gcc.target/powerpc/block-cmp-3.c
Normal file
@@ -0,0 +1,8 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-Os" } */
|
||||
/* { dg-final { scan-assembler-times {\mb[l]? memcmp\M} 1 } } */
|
||||
|
||||
int foo (const char* s1, const char* s2)
|
||||
{
|
||||
return __builtin_memcmp (s1, s2, 4);
|
||||
}
|
||||
Reference in New Issue
Block a user