Hi!

On Fri, Mar 19, 2021 at 10:46:54AM +0800, Kewen.Lin wrote:
> As Segher and Mike pointed out, the define_insn_and_split should avoid
> to use empty split condition if the condition for define_insn isn't empty,
> otherwise it can sometimes leads to unexpected consequence.
> 
> This patch is to fix some places like this.
> 
> Bootstrapped/regtested on powerpc64le-linux-gnu P9 and
> powerpc64-linux-gnu P8.
> 
> Since it's in very low risk and can avoid some unexpected errors,
> is it ok for trunk? or has to be for GCC12?

I am curious if the splitters ever triggered where they should not have?

> diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
> index 592ac90aa44..6ab71979566 100644
> --- a/gcc/config/rs6000/rs6000.md
> +++ b/gcc/config/rs6000/rs6000.md
> @@ -4281,7 +4281,7 @@

If you add

[diff "md"]
        xfuncname = "^\\(define.*$"

to your .git/config, the patch will show what insn this is in:

> @@ -4281,7 +4281,7 @@ (define_insn_and_split "*rotldi3_insert_sf"


The patch is okay for trunk.  Thank you!

You might want to make this error easier to detect?  Maybe make
define_insn_and_split raise an error if the split condition is empty but
the insn condition is not?


Segher

Reply via email to