diff options
author | Lulu Cheng <chenglulu@loongson.cn> | 2023-08-28 11:30:21 +0800 |
---|---|---|
committer | Lulu Cheng <chenglulu@loongson.cn> | 2023-08-29 08:58:04 +0800 |
commit | 88ae53a3852dac73fdecb9cfcee2c5100cee832f (patch) | |
tree | 4c6cd2f2ec036d00123aa5badc33320acff4a2b8 /gcc/testsuite | |
parent | 61dcc62c120538793472849d22421668951c9959 (diff) | |
download | gcc-88ae53a3852dac73fdecb9cfcee2c5100cee832f.zip gcc-88ae53a3852dac73fdecb9cfcee2c5100cee832f.tar.gz gcc-88ae53a3852dac73fdecb9cfcee2c5100cee832f.tar.bz2 |
LoongArch: Enable '-free' starting at -O2.
gcc/ChangeLog:
* common/config/loongarch/loongarch-common.cc:
Enable '-free' on O2 and above.
* doc/invoke.texi: Modify the description information
of the '-free' compilation option and add the LoongArch
description.
gcc/testsuite/ChangeLog:
* gcc.target/loongarch/sign-extend.c: New test.
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/gcc.target/loongarch/sign-extend.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/loongarch/sign-extend.c b/gcc/testsuite/gcc.target/loongarch/sign-extend.c new file mode 100644 index 0000000..3f339d0 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/sign-extend.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-mabi=lp64d -O2" } */ +/* { dg-final { scan-assembler-times "slli.w" 1 } } */ + +extern int PL_savestack_ix; +extern int PL_regsize; +extern int PL_savestack_max; +void Perl_savestack_grow_cnt (int need); +extern void Perl_croak (char *); + +int +S_regcppush(int parenfloor) +{ + int retval = PL_savestack_ix; + int paren_elems_to_push = (PL_regsize - parenfloor) * 4; + int p; + + if (paren_elems_to_push < 0) + Perl_croak ("panic: paren_elems_to_push < 0"); + + if (PL_savestack_ix + (paren_elems_to_push + 6) > PL_savestack_max) + Perl_savestack_grow_cnt (paren_elems_to_push + 6); + + return retval; +} |