On Thu, Aug 15, 2019 at 12:22:46AM +0200, Jose E. Marchesi wrote:
> --- a/configure
> +++ b/configure
> @@ -754,6 +754,7 @@ infodir
>  docdir
>  oldincludedir
>  includedir
> +runstatedir
>  localstatedir
>  sharedstatedir
>  sysconfdir

(etc.)

You seem to have generated this with the wrong version of autoxxxx, or
the wrong options, or the previous version was.  Please check?  Or, what
else caused this change?

> --- a/contrib/config-list.mk
> +++ b/contrib/config-list.mk
> @@ -123,7 +123,7 @@ $(LIST): make-log-dir
>               TGT=`echo $@ | awk 'BEGIN { FS = "OPT" }; { print $$1 }'` &&    
>                 \
>               TGT=`$(GCC_SRC_DIR)/config.sub $$TGT` &&                        
>                 \
>               case $$TGT in                                                   
>                 \
> -                     *-*-darwin* | *-*-cygwin* | *-*-mingw* | *-*-aix*)      
>                 \
> +                     *-*-darwin* | *-*-cygwin* | *-*-mingw* | *-*-aix* | 
> bpf-*-* )                   \

This line is too long now.  No space before ) btw.

> +     gcc_unreachable ();      
> +      }
> +
> +#define KERNEL_VERSION_CODE "__BPF_KERNEL_VERSION_CODE__="    

Trailing whitespace on the first and last of these lines.

> +void
> +bpf_expand_prologue (void)
> +{
> +  int regno, fp_offset;
> +  rtx insn;
> +  HOST_WIDE_INT size;
> +
> +  bpf_compute_frame ();
> +  size = (cfun->machine->local_vars_size
> +       + cfun->machine->callee_saved_reg_size);
> +  fp_offset = -cfun->machine->local_vars_size;
> +  

Trailing ws.

> +       if (!IN_RANGE (fp_offset, -1 - 0x7fff, 0x7fff))

You might want some constraint thing for this, or a helper function?

> +         /* This has been already reported as an error in
> +            bpf_compute_frame. */
> +         break;
> +       else
> +         {
> +           mem = gen_frame_mem (DImode,
> +                                plus_constant (DImode,
> +                                               gen_rtx_REG (DImode, 
> FRAME_POINTER_REGNUM),

This line is much too long.

> +/* Expand to the instructions in a function epilogue.  This function
> +   is called when expanding the 'prologue' pattern in bpf.md.  */

'epilogue' :-)

> +void
> +bpf_asm_function_prologue (FILE *file ATTRIBUTE_UNUSED)
> +{
> +}
> +
> +#undef TARGET_ASM_FUNCTION_PROLOGUE
> +#define TARGET_ASM_FUNCTION_PROLOGUE bpf_asm_function_prologue

You can just not define these at all, if you want them empty.

> +static unsigned int
> +bpf_hard_regno_nregs (unsigned int regno ATTRIBUTE_UNUSED,
> +                   enum machine_mode mode)
> +{
> +  return ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD);
> +}

return CEIL (GET_MODE_SIZE (mode), UNITS_PER_WORD);

(not that that is such an obvious name :-/ )

> +const char *
> +bpf_output_call (rtx target)
> +{
> +  static char *insn;
> +  rtx op;
> +
> +  op = XEXP (target, 0);
> +  switch (GET_CODE (op))
> +    {
> +    case CONST_INT:
> +      insn = (char *) xmalloc (5 + 6 + 1);
> +      sprintf (insn, "call\t%ld", INTVAL (op));

Will this never overflow?  An %ld can easily be more than 6 characters.
Add a check for it, a gcc_assert or similar?  (Similar for the other
calls).

> +(define_constraint "I"
> +  "A 32-bit signed immediate."
> +  (and (match_code "const_int")
> +       (match_test "IN_RANGE (ival, -1 - 0x7fffffff, 0x7fffffff)")))

So you can use  satisfies_constraint_I  instead of the other manual tests
for 32-bit signed.

> +(define_constraint "B"
> +  "A constant argument for LDDW."
> +  (ior (match_code "const,symbol_ref,label_ref,const_double")
> +       (and (match_code "const_int")
> +            (match_test "IN_RANGE (ival, -1 - 0x7fffffffffffffff, 
> 0x7fffffffffffffff)"))))

Are 64-bit hex constants allowed with the minimum C++ version we support?
Also, this test is *always* true.  (And line too long :-) )


Segher

Reply via email to