diff mbox series

[v1] LoongArch: Fixed bug in *bstrins_<mode>_for_ior_mask template.

Message ID 20231225032023.3061334-1-liwei@loongson.cn
State New
Headers show
Series [v1] LoongArch: Fixed bug in *bstrins_<mode>_for_ior_mask template. | expand

Commit Message

Li Wei Dec. 25, 2023, 3:20 a.m. UTC
We found that using the latest compiled gcc will cause a miscompare error
when running spec2006 400.perlbench test with -flto turned on.  After testing,
it was found that only the LoongArch architecture will report errors.
The first error commit was located through the git bisect command as
r14-3773-g5b857e87201335.  Through debugging, it was found that the problem
was that the split condition of the *bstrins_<mode>_for_ior_mask template was
empty, which should actually be consistent with the insn condition.

gcc/ChangeLog:

	* config/loongarch/loongarch.md: Adjust.
---
 gcc/config/loongarch/loongarch.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Xi Ruoyao Dec. 25, 2023, 10:35 a.m. UTC | #1
On Mon, 2023-12-25 at 11:20 +0800, Li Wei wrote:
> We found that using the latest compiled gcc will cause a miscompare error
> when running spec2006 400.perlbench test with -flto turned on.  After testing,
> it was found that only the LoongArch architecture will report errors.
> The first error commit was located through the git bisect command as
> r14-3773-g5b857e87201335.  Through debugging, it was found that the problem
> was that the split condition of the *bstrins_<mode>_for_ior_mask template was
> empty, which should actually be consistent with the insn condition.
> 
> gcc/ChangeLog:
> 
> 	* config/loongarch/loongarch.md: Adjust.

LGTM.  I had some misunderstandings here.  Sorry for the bug.

If a test case can be minimized and added it would be better, but I
understand that for a LTO-revealed issue it can be difficult to do so.

> ---
>  gcc/config/loongarch/loongarch.md | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gcc/config/loongarch/loongarch.md b/gcc/config/loongarch/loongarch.md
> index 7021105b241..2b0609f2f31 100644
> --- a/gcc/config/loongarch/loongarch.md
> +++ b/gcc/config/loongarch/loongarch.md
> @@ -1489,7 +1489,7 @@ (define_insn_and_split "*bstrins_<mode>_for_ior_mask"
>    "loongarch_pre_reload_split () && \
>     loongarch_use_bstrins_for_ior_with_mask (<MODE>mode, operands)"
>    "#"
> -  ""
> +  "&& true"
>    [(set (match_dup 0) (match_dup 1))
>     (set (zero_extract:GPR (match_dup 0) (match_dup 2) (match_dup 4))
>  	(match_dup 3))]
Lulu Cheng Dec. 27, 2023, 6:57 a.m. UTC | #2
Pushed to r14-6847.

在 2023/12/25 上午11:20, Li Wei 写道:
> We found that using the latest compiled gcc will cause a miscompare error
> when running spec2006 400.perlbench test with -flto turned on.  After testing,
> it was found that only the LoongArch architecture will report errors.
> The first error commit was located through the git bisect command as
> r14-3773-g5b857e87201335.  Through debugging, it was found that the problem
> was that the split condition of the *bstrins_<mode>_for_ior_mask template was
> empty, which should actually be consistent with the insn condition.
>
> gcc/ChangeLog:
>
> 	* config/loongarch/loongarch.md: Adjust.
> ---
>   gcc/config/loongarch/loongarch.md | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/config/loongarch/loongarch.md b/gcc/config/loongarch/loongarch.md
> index 7021105b241..2b0609f2f31 100644
> --- a/gcc/config/loongarch/loongarch.md
> +++ b/gcc/config/loongarch/loongarch.md
> @@ -1489,7 +1489,7 @@ (define_insn_and_split "*bstrins_<mode>_for_ior_mask"
>     "loongarch_pre_reload_split () && \
>      loongarch_use_bstrins_for_ior_with_mask (<MODE>mode, operands)"
>     "#"
> -  ""
> +  "&& true"
>     [(set (match_dup 0) (match_dup 1))
>      (set (zero_extract:GPR (match_dup 0) (match_dup 2) (match_dup 4))
>   	(match_dup 3))]
diff mbox series

Patch

diff --git a/gcc/config/loongarch/loongarch.md b/gcc/config/loongarch/loongarch.md
index 7021105b241..2b0609f2f31 100644
--- a/gcc/config/loongarch/loongarch.md
+++ b/gcc/config/loongarch/loongarch.md
@@ -1489,7 +1489,7 @@  (define_insn_and_split "*bstrins_<mode>_for_ior_mask"
   "loongarch_pre_reload_split () && \
    loongarch_use_bstrins_for_ior_with_mask (<MODE>mode, operands)"
   "#"
-  ""
+  "&& true"
   [(set (match_dup 0) (match_dup 1))
    (set (zero_extract:GPR (match_dup 0) (match_dup 2) (match_dup 4))
 	(match_dup 3))]