[PATCH 29/31] PDP11: Use `const_double_zero' to express double zero constant

Martin Liška mliska@suse.cz
Tue Dec 15 08:26:11 GMT 2020


On 11/20/20 4:36 AM, Maciej W. Rozycki wrote:
> We do not define a comparison operation between floating-point and
> integer data, including integer zero constant.  Consequently the RTL
> instruction stream presented to the post-reload comparison elimination
> pass will include, where applicable, floating-point comparison insns
> against `const_double:DF 0.0 [0x0.0p+0]' rather than `const_int 0 [0]',
> meaning that the latter expression will not match when used in machine
> description.
> 
> Use `const_double_zero' then for the relevant patterns to match the
> intended RTL instructions.
> 
> 	gcc/
> 	* config/pdp11/pdp11.md (fcc_cc, fcc_ccnz): Use
> 	`const_double_zero' to express double zero constant.
> ---
>   gcc/config/pdp11/pdp11.md | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gcc/config/pdp11/pdp11.md b/gcc/config/pdp11/pdp11.md
> index 7a4d50fdba9..cdef49f3979 100644
> --- a/gcc/config/pdp11/pdp11.md
> +++ b/gcc/config/pdp11/pdp11.md
> @@ -105,7 +105,7 @@ (define_subst "fcc_cc"
>      (clobber (reg FCC_REGNUM))]
>     ""
>     [(set (reg:CC FCC_REGNUM)
> -	(compare:CC (match_dup 1) (const_int 0)))
> +	(compare:CC (match_dup 1) (const_double_zero)))
>      (set (match_dup 0) (match_dup 1))])
>   
>   (define_subst "fcc_ccnz"
> @@ -113,7 +113,7 @@ (define_subst "fcc_ccnz"
>      (clobber (reg FCC_REGNUM))]
>     ""
>     [(set (reg:CCNZ FCC_REGNUM)
> -	(compare:CCNZ (match_dup 1) (const_int 0)))
> +	(compare:CCNZ (match_dup 1) (const_double_zero)))
>      (set (match_dup 0) (match_dup 1))])
>   
>   (define_subst_attr "cc_cc" "cc_cc" "_nocc" "_cc")
> 

Hello.

If I see correctly, starting from this revision I can't compile a cross
compiler of x86_64-linux-gnu:

../configure --target=pdp11-aout --disable-bootstrap --enable-languages=c,c++ --disable-multilib  --enable-obsolete

$ make
build/genemit ../../gcc/common.md ../../gcc/config/pdp11/pdp11.md \
   insn-conditions.md > tmp-emit.c
genemit: Internal error: abort in gen_exp, at genemit.c:202
make: *** [Makefile:2427: s-emit] Error 1

$ Breakpoint 1, fancy_abort (file=0x435238 "../../gcc/genemit.c", line=202, func=0x435230 "gen_exp") at ../../gcc/errors.c:133
133	  internal_error ("abort in %s, at %s:%d", func, trim_filename (file), line);
(gdb) bt
#0  fancy_abort (file=0x435238 "../../gcc/genemit.c", line=202, func=0x435230 "gen_exp") at ../../gcc/errors.c:133
#1  0x0000000000402e4b in gen_exp (x=0x470de0, subroutine_type=DEFINE_INSN, used=0x4aa4b0 "", info=0x7fffffffdea0) at ../../gcc/genemit.c:202
#2  0x0000000000402f68 in gen_exp (x=0x4d6c70, subroutine_type=DEFINE_INSN, used=0x4aa4b0 "", info=0x7fffffffdea0) at ../../gcc/genemit.c:227
#3  0x0000000000402f68 in gen_exp (x=0x4d6c50, subroutine_type=DEFINE_INSN, used=0x4aa4b0 "", info=0x7fffffffdea0) at ../../gcc/genemit.c:227
#4  0x000000000040307d in gen_exp (x=0x4aa490, subroutine_type=DEFINE_INSN, used=0x4aa4b0 "", info=0x7fffffffdea0) at ../../gcc/genemit.c:255
#5  0x00000000004036c1 in gen_insn (info=0x7fffffffdea0) at ../../gcc/genemit.c:435
#6  0x0000000000404930 in main (argc=3, argv=0x7fffffffdfc8) at ../../gcc/genemit.c:911

Can you please take a look?
Thanks,
Martin


More information about the Gcc-patches mailing list