public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: Cross compiler Alpha->powerpc problems
@ 2001-03-26  4:38 David Korn
  2001-03-26  5:17 ` Bob Koninckx
  0 siblings, 1 reply; 7+ messages in thread
From: David Korn @ 2001-03-26  4:38 UTC (permalink / raw)
  To: 'bob.koninckx@mech.kuleuven.ac.be', gcc-help

>-----Original Message-----
>From: Bob Koninckx [ mailto:bob.koninckx@mech.kuleuven.ac.be ]
>Sent: 25 March 2001 11:30

>## PATH=/usr/local/crossgcc/powerpc-eabi/bin:$PATH; export PATH

  Don't do this.

  In the $prefix/$target/bin directory, you have cross binutils, with
no '$target-' prefix.  Putting this directory first in your path means that
whenever gcc tries to invoke 'as', it will find the ppc cross assembler and
run that.  That's not what you want; you want to find the native assembler,
since you're building a compiler that's meant to run on your alpha, not 
your ppc.

  What you really wanted was

  PATH=/usr/local/crossgcc/bin:$PATH; export PATH

so that the cross compile process can find the cross binutils under the
name 'powerpc-eabi-as' etc.

  Clear everything out and try again with this version of the path setting.

  I can't promise that this is the solution to your problem, but it's
still necessary; I've always had mysterious build errors when I've made
that mistake myself.

  BTW, http://sources.redhat.com/ecos/getstart.html only mentions the
tools as running under Linux and Windows, so you may find that they
don't build correctly under Alpha?  Or are you running Linux on Alpha?
Have you joined the eCos mailing list?  Did you apply the path from
http://sources.redhat.com/ecos/tools/patches/ecos-gcc-2952.pat
to the gcc source code?

      DaveK
-- 
 All your base are belong to us!


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cross compiler Alpha->powerpc problems
  2001-03-26  4:38 Cross compiler Alpha->powerpc problems David Korn
@ 2001-03-26  5:17 ` Bob Koninckx
  0 siblings, 0 replies; 7+ messages in thread
From: Bob Koninckx @ 2001-03-26  5:17 UTC (permalink / raw)
  To: David Korn; +Cc: gcc-help

David Korn wrote:

> >-----Original Message-----
> >From: Bob Koninckx [ mailto:bob.koninckx@mech.kuleuven.ac.be ]
> >Sent: 25 March 2001 11:30
>
> >## PATH=/usr/local/crossgcc/powerpc-eabi/bin:$PATH; export PATH
>
>   Don't do this.

I don't think that is the problem. Actually, the prefix and exec-prefix
directories fr both binutils and gcc were
/usr/local/crossgcc/powerpc-eabi. So there is an extra powerpc-eabi directory
(the one you
are referring too) underneath.  Moreover, The procedure works fine for the
i386-elf or m68k-coff targets
that were build in exactly the same way.

(
There are thus
/usr/local/crossgcc/powerpc-eabi/bin    and
/usr/local/crossgcc/powerpc-eabi/powerpc-eabi/bin   directories
)


>
>   In the $prefix/$target/bin directory, you have cross binutils, with
> no '$target-' prefix.  Putting this directory first in your path means that
> whenever gcc tries to invoke 'as', it will find the ppc cross assembler and
> run that.  That's not what you want; you want to find the native assembler,
> since you're building a compiler that's meant to run on your alpha, not
> your ppc.
>
>   What you really wanted was
>
>   PATH=/usr/local/crossgcc/bin:$PATH; export PATH
>
> so that the cross compile process can find the cross binutils under the
> name 'powerpc-eabi-as' etc.

As stated before that is what it finds. The fact that the problem only occurs
for the powerpc-eabi
target makes me believe that it has something to do with that target, rather
than with the build procedure


>
>
>   Clear everything out and try again with this version of the path setting.
>
>   I can't promise that this is the solution to your problem, but it's
> still necessary; I've always had mysterious build errors when I've made
> that mistake myself.
>
>   BTW, http://sources.redhat.com/ecos/getstart.html only mentions the
> tools as running under Linux and Windows, so you may find that they
> don't build correctly under Alpha?  Or are you running Linux on Alpha?

Yep, linux on an alpha workstation.  The identical procedure on an i386 host
runs without any problems.


>
> Have you joined the eCos mailing list?

Well, I searched the archives and came accross a problem for building the
tools on an alpha for an arm target.
The solution to that problem was upgrading the host compiler to at least
2.95.2. I didn't find anything concerning
the powerpc. However, I found the hint to ask gcc related questions on this
list several times. That's why I asked
it here.


> Did you apply the path from
> http://sources.redhat.com/ecos/tools/patches/ecos-gcc-2952.pat
> to the gcc source code?

Yes, I did.

>
>
>       DaveK

Thanks for your help anyway. Maybe other suggestions ??

Regards,
Bob


>
> --
>  All your base are belong to us!
>
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
>
> This footnote also confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
>
> www.mimesweeper.com
> **********************************************************************

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cross compiler Alpha->powerpc problems
  2001-03-27 13:06     ` Alexandre Oliva
@ 2001-03-28  0:50       ` Bob Koninckx
  0 siblings, 0 replies; 7+ messages in thread
From: Bob Koninckx @ 2001-03-28  0:50 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: gcc-help

Alexandre Oliva wrote:
> 
> On Mar 27, 2001, Bob Koninckx <bob.koninckx@mech.kuleuven.ac.be> wrote:
> 
> > I suppose your patch does not break Red Hat Linux.
> 
> Do you mean Red Hat Linux for alpha?  Yes, I've tested the patch I
> posted, and it does work.  But it would break on x86, without a minor
> update.
> 
> > Any chance that I can get it??
> 
> Only if you promise to let me know of any problems that might show up
> on alpha-x-ppc.  Or, even better, if it ``just works'' :-)
> 
> Here's the latest patch, tested with bootstrap on alpha, sparc and
> x86, and failed bootstrap on pa.
> 
>   ------------------------------------------------------------------------
> Index: gcc/ChangeLog
> from  Alexandre Oliva  <aoliva@redhat.com>
> 
>         * recog.c (general_operand, immediate_operand,
>         nonmemory_operand): Require CONST_INTs to be sign-extended
>         values for their modes.
>         * combine.c (try_combine): Avoid generating a new set in i2
>         that changes the expected mode of a CONST_INT.
>         * expmed.c (store_bit_field): Truncate CONST_INTs.
>         (expand_mult_highpart, expand_divmod): Likewise.
>         * expr.c (convert_modes, store_field): Likewise.
>         * integrate.c (expand_inline_function): Use promote_mode() to
>         determine whether to convert_modes() an argument as signed
>         or unsigned.
>         * optabs.c (expand_binon): Get CONST_INT operands
>         sign-extended for their appropriate modes.
>         * stmt.c (emit_case_nodes): Convert node values to the
>         appropriate mode.
>         * unroll.c (loop_iterations): Truncate abs_diff to the mode of
>         the iteration variable.
>         * varasm.c (immed_double_const): Don't require words to be
>         narrower than host wide ints to properly sign-extend
>         CONST_INTs.
> 
> Index: gcc/combine.c
> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/combine.c,v
> retrieving revision 1.183.2.2
> diff -u -p -r1.183.2.2 combine.c
> --- gcc/combine.c 2001/03/15 19:01:56 1.183.2.2
> +++ gcc/combine.c 2001/03/22 04:40:30
> @@ -2270,14 +2270,27 @@ try_combine (i3, i2, i1, new_direct_jump
>                                             XEXP (*split, 0)));
>  #endif
> 
> -         newi2pat = gen_rtx_combine (SET, VOIDmode, newdest, *split);
> -         SUBST (*split, newdest);
> -         i2_code_number = recog_for_combine (&newi2pat, i2, &new_i2_notes);
> -
>           /* If the split point was a MULT and we didn't have one before,
>              don't use one now.  */
> -         if (i2_code_number >= 0 && ! (split_code == MULT && ! have_mult))
> +         if (! (split_code == MULT && ! have_mult))
>             insn_code_number = recog_for_combine (&newpat, i3, &new_i3_notes);
> +         else
> +           insn_code_number = -1;
> +
> +         /* We want to test newi2pat only if the combination for i3
> +            would have worked.  This prevents us from generating i2
> +            as a set from a CONST_INT to a register in the wrong
> +            mode, in case i3 is a comparison in a certain mode whose
> +            result is in a different mode.  */
> +         if (insn_code_number >= 0)
> +           {
> +             newi2pat = gen_rtx_combine (SET, VOIDmode, newdest, *split);
> +             SUBST (*split, newdest);
> +             i2_code_number = recog_for_combine (&newi2pat, i2,
> +                                                 &new_i2_notes);
> +           }
> +         else
> +           i2_code_number = -1;
>         }
>      }
> 
> Index: gcc/expmed.c
> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/expmed.c,v
> retrieving revision 1.76
> diff -u -p -r1.76 expmed.c
> --- gcc/expmed.c 2001/01/31 19:05:49 1.76
> +++ gcc/expmed.c 2001/03/22 04:40:33
> @@ -589,6 +589,8 @@ store_bit_field (str_rtx, bitsize, bitnu
>               else
>                 value1 = gen_lowpart (maxmode, value1);
>             }
> +         else if (GET_CODE (value) == CONST_INT)
> +           value1 = GEN_INT (trunc_int_for_mode (INTVAL (value), maxmode));
>           else if (!CONSTANT_P (value))
>             /* Parse phase is supposed to make VALUE's data type
>                match that of the component reference, which is a type
> @@ -2782,7 +2784,7 @@ expand_mult_highpart (mode, op0, cnst1,
>    if (size > HOST_BITS_PER_WIDE_INT)
>      abort ();
> 
> -  op1 = GEN_INT (cnst1);
> +  op1 = GEN_INT (trunc_int_for_mode (cnst1, mode));
> 
>    if (GET_MODE_BITSIZE (wider_mode) <= HOST_BITS_PER_INT)
>      wide_op1 = op1;
> @@ -3269,7 +3271,7 @@ expand_divmod (rem_flag, code, mode, op0
>                 if (rem_flag && d < 0)
>                   {
>                     d = abs_d;
> -                   op1 = GEN_INT (abs_d);
> +                   op1 = GEN_INT (trunc_int_for_mode (abs_d, compute_mode));
>                   }
> 
>                 if (d == 1)
> @@ -3299,7 +3301,8 @@ expand_divmod (rem_flag, code, mode, op0
>                         t1 = copy_to_mode_reg (compute_mode, op0);
>                         do_cmp_and_jump (t1, const0_rtx, GE,
>                                          compute_mode, label);
> -                       expand_inc (t1, GEN_INT (abs_d - 1));
> +                       expand_inc (t1, GEN_INT (trunc_int_for_mode
> +                                                (abs_d - 1, compute_mode)));
>                         emit_label (label);
>                         quotient = expand_shift (RSHIFT_EXPR, compute_mode, t1,
>                                                  build_int_2 (lgup, 0),
> @@ -3336,7 +3339,10 @@ expand_divmod (rem_flag, code, mode, op0
>                                                REG_EQUAL,
>                                                gen_rtx_DIV (compute_mode,
>                                                             op0,
> -                                                           GEN_INT (abs_d)));
> +                                                           GEN_INT
> +                                                           (trunc_int_for_mode
> +                                                            (abs_d,
> +                                                             compute_mode))));
> 
>                         quotient = expand_unop (compute_mode, neg_optab,
>                                                 quotient, quotient, 0);
> @@ -3835,8 +3841,10 @@ expand_divmod (rem_flag, code, mode, op0
>             ml = invert_mod2n (d >> pre_shift, size);
>             t1 = expand_shift (RSHIFT_EXPR, compute_mode, op0,
>                                build_int_2 (pre_shift, 0), NULL_RTX, unsignedp);
> -           quotient = expand_mult (compute_mode, t1, GEN_INT (ml), NULL_RTX,
> -                                   0);
> +           quotient = expand_mult (compute_mode, t1,
> +                                   GEN_INT (trunc_int_for_mode
> +                                            (ml, compute_mode)),
> +                                   NULL_RTX, 0);
> 
>             insn = get_last_insn ();
>             set_unique_reg_note (insn,
> Index: gcc/expr.c
> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/expr.c,v
> retrieving revision 1.295.2.4
> diff -u -p -r1.295.2.4 expr.c
> --- gcc/expr.c 2001/03/15 19:01:59 1.295.2.4
> +++ gcc/expr.c 2001/03/22 04:40:35
> @@ -1374,7 +1374,7 @@ convert_modes (mode, oldmode, x, unsigne
>               && (val & ((HOST_WIDE_INT) 1 << (width - 1))))
>             val |= (HOST_WIDE_INT) (-1) << width;
> 
> -         return GEN_INT (val);
> +         return GEN_INT (trunc_int_for_mode (val, mode));
>         }
> 
>        return gen_lowpart (mode, x);
> @@ -5166,7 +5166,13 @@ store_field (target, bitsize, bitpos, mo
>               enum machine_mode tmode;
> 
>               if (unsignedp)
> -               return expand_and (temp, GEN_INT (width_mask), NULL_RTX);
> +               return expand_and (temp,
> +                                  GEN_INT
> +                                  (trunc_int_for_mode
> +                                   (width_mask,
> +                                    GET_MODE (temp) == VOIDmode
> +                                    ? value_mode
> +                                    : GET_MODE (temp))), NULL_RTX);
>               tmode = GET_MODE (temp);
>               if (tmode == VOIDmode)
>                 tmode = value_mode;
> Index: gcc/integrate.c
> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/integrate.c,v
> retrieving revision 1.126.4.4
> diff -u -p -r1.126.4.4 integrate.c
> --- gcc/integrate.c 2001/03/14 18:26:31 1.126.4.4
> +++ gcc/integrate.c 2001/03/22 04:40:36
> @@ -722,13 +722,24 @@ expand_inline_function (fndecl, parms, t
>        else if (GET_CODE (loc) != MEM)
>         {
>           if (GET_MODE (loc) != TYPE_MODE (TREE_TYPE (arg)))
> -           /* The mode if LOC and ARG can differ if LOC was a variable
> -              that had its mode promoted via PROMOTED_MODE.  */
> -           arg_vals[i] = convert_modes (GET_MODE (loc),
> -                                        TYPE_MODE (TREE_TYPE (arg)),
> -                                        expand_expr (arg, NULL_RTX, mode,
> -                                                     EXPAND_SUM),
> -                                        TREE_UNSIGNED (TREE_TYPE (formal)));
> +           {
> +             int unsignedp = TREE_UNSIGNED (TREE_TYPE (formal));
> +             enum machine_mode pmode = TYPE_MODE (TREE_TYPE (formal));
> +
> +             pmode = promote_mode (TREE_TYPE (formal), pmode,
> +                                   &unsignedp, 0);
> +
> +             if (GET_MODE (loc) != pmode)
> +               abort ();
> +
> +             /* The mode if LOC and ARG can differ if LOC was a variable
> +                that had its mode promoted via PROMOTED_MODE.  */
> +             arg_vals[i] = convert_modes (pmode,
> +                                          TYPE_MODE (TREE_TYPE (arg)),
> +                                          expand_expr (arg, NULL_RTX, mode,
> +                                                       EXPAND_SUM),
> +                                          unsignedp);
> +           }
>           else
>             arg_vals[i] = expand_expr (arg, NULL_RTX, mode, EXPAND_SUM);
>         }
> Index: gcc/optabs.c
> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/optabs.c,v
> retrieving revision 1.87
> diff -u -p -r1.87 optabs.c
> --- gcc/optabs.c 2001/01/28 01:50:06 1.87
> +++ gcc/optabs.c 2001/03/22 04:40:37
> @@ -724,17 +724,28 @@ expand_binop (mode, binoptab, op0, op1,
>         }
> 
>        /* In case the insn wants input operands in modes different from
> -        the result, convert the operands.  */
> +        the result, convert the operands.  It would seem that we
> +        don't need to convert CONST_INTs, but we do, so that they're
> +        a properly sign-extended for their modes.  Unless we're doing
> +        a widening conversion, in which case convert_to_mode might
> +        incorrectly zero-extend a constant, in case it is
> +        unsigned.  */
> 
> -      if (GET_MODE (op0) != VOIDmode
> -         && GET_MODE (op0) != mode0
> +      if (GET_MODE (op0) != mode0
>           && mode0 != VOIDmode)
> -       xop0 = convert_to_mode (mode0, xop0, unsignedp);
> +       xop0 = convert_modes (mode0,
> +                             GET_MODE (op0) != VOIDmode
> +                             ? GET_MODE (op0)
> +                             : mode0,
> +                             xop0, unsignedp);
> 
> -      if (GET_MODE (xop1) != VOIDmode
> -         && GET_MODE (xop1) != mode1
> +      if (GET_MODE (xop1) != mode1
>           && mode1 != VOIDmode)
> -       xop1 = convert_to_mode (mode1, xop1, unsignedp);
> +       xop1 = convert_modes (mode1,
> +                             GET_MODE (op1) != VOIDmode
> +                             ? GET_MODE (op1)
> +                             : mode1,
> +                             xop1, unsignedp);
> 
>        /* Now, if insn's predicates don't allow our operands, put them into
>          pseudo regs.  */
> @@ -4299,7 +4310,9 @@ expand_fix (to, from, unsignedp)
>                                  NULL_RTX, 0, OPTAB_LIB_WIDEN);
>           expand_fix (to, target, 0);
>           target = expand_binop (GET_MODE (to), xor_optab, to,
> -                                GEN_INT ((HOST_WIDE_INT) 1 << (bitsize - 1)),
> +                                GEN_INT (trunc_int_for_mode
> +                                         ((HOST_WIDE_INT) 1 << (bitsize - 1),
> +                                          GET_MODE (to))),
>                                  to, 1, OPTAB_LIB_WIDEN);
> 
>           if (target != to)
> Index: gcc/recog.c
> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/recog.c,v
> retrieving revision 1.87
> diff -u -p -r1.87 recog.c
> --- gcc/recog.c 2001/01/22 16:58:08 1.87
> +++ gcc/recog.c 2001/03/22 04:40:37
> @@ -1,6 +1,6 @@
>  /* Subroutines used by or related to instruction recognition.
>     Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998
> -   1999, 2000 Free Software Foundation, Inc.
> +   1999, 2000, 2001 Free Software Foundation, Inc.
> 
>  This file is part of GNU CC.
> 
> @@ -1012,6 +1012,12 @@ general_operand (op, mode)
>        && GET_MODE_CLASS (mode) != MODE_PARTIAL_INT)
>      return 0;
> 
> +#ifdef ENABLE_CHECKING
> +  if (GET_CODE (op) == CONST_INT
> +      && trunc_int_for_mode (INTVAL (op), mode) != INTVAL (op))
> +    abort ();
> +#endif
> +
>    if (CONSTANT_P (op))
>      return ((GET_MODE (op) == VOIDmode || GET_MODE (op) == mode
>              || mode == VOIDmode)
> @@ -1195,6 +1201,12 @@ immediate_operand (op, mode)
>        && GET_MODE_CLASS (mode) != MODE_PARTIAL_INT)
>      return 0;
> 
> +#ifdef ENABLE_CHECKING
> +  if (GET_CODE (op) == CONST_INT
> +      && trunc_int_for_mode (INTVAL (op), mode) != INTVAL (op))
> +    abort ();
> +#endif
> +
>    /* Accept CONSTANT_P_RTX, since it will be gone by CSE1 and
>       result in 0/1.  It seems a safe assumption that this is
>       in range for everyone.  */
> @@ -1265,6 +1277,12 @@ nonmemory_operand (op, mode)
>           && GET_MODE_CLASS (mode) != MODE_INT
>           && GET_MODE_CLASS (mode) != MODE_PARTIAL_INT)
>         return 0;
> +
> +#ifdef ENABLE_CHECKING
> +      if (GET_CODE (op) == CONST_INT
> +         && trunc_int_for_mode (INTVAL (op), mode) != INTVAL (op))
> +       abort ();
> +#endif
> 
>        return ((GET_MODE (op) == VOIDmode || GET_MODE (op) == mode
>               || mode == VOIDmode)
> Index: gcc/stmt.c
> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/stmt.c,v
> retrieving revision 1.184.2.2
> diff -u -p -r1.184.2.2 stmt.c
> --- gcc/stmt.c 2001/03/14 18:26:32 1.184.2.2
> +++ gcc/stmt.c 2001/03/22 04:40:38
> @@ -1,6 +1,6 @@
>  /* Expands front end tree to back end RTL for GNU C-Compiler
>     Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
> -   1998, 1999, 2000 Free Software Foundation, Inc.
> +   1998, 1999, 2000, 2001 Free Software Foundation, Inc.
> 
>  This file is part of GNU CC.
> 
> @@ -6152,6 +6152,7 @@ emit_case_nodes (index, node, default_la
>    /* If INDEX has an unsigned type, we must make unsigned branches.  */
>    int unsignedp = TREE_UNSIGNED (index_type);
>    enum machine_mode mode = GET_MODE (index);
> +  enum machine_mode imode = TYPE_MODE (index_type);
> 
>    /* See if our parents have already tested everything for us.
>       If they have, emit an unconditional jump for this node.  */
> @@ -6163,7 +6164,11 @@ emit_case_nodes (index, node, default_la
>        /* Node is single valued.  First see if the index expression matches
>          this node and then check our children, if any.  */
> 
> -      do_jump_if_equal (index, expand_expr (node->low, NULL_RTX, VOIDmode, 0),
> +      do_jump_if_equal (index,
> +                       convert_modes (mode, imode,
> +                                      expand_expr (node->low, NULL_RTX,
> +                                                   VOIDmode, 0),
> +                                      unsignedp),
>                         label_rtx (node->code_label), unsignedp);
> 
>        if (node->right != 0 && node->left != 0)
> @@ -6177,8 +6182,11 @@ emit_case_nodes (index, node, default_la
>           if (node_is_bounded (node->right, index_type))
>             {
>               emit_cmp_and_jump_insns (index,
> -                                      expand_expr (node->high, NULL_RTX,
> -                                                   VOIDmode, 0),
> +                                      convert_modes
> +                                      (mode, imode,
> +                                       expand_expr (node->high, NULL_RTX,
> +                                                    VOIDmode, 0),
> +                                       unsignedp),
>                                        GT, NULL_RTX, mode, unsignedp, 0,
>                                        label_rtx (node->right->code_label));
>               emit_case_nodes (index, node->left, default_label, index_type);
> @@ -6187,8 +6195,11 @@ emit_case_nodes (index, node, default_la
>           else if (node_is_bounded (node->left, index_type))
>             {
>               emit_cmp_and_jump_insns (index,
> -                                      expand_expr (node->high, NULL_RTX,
> -                                                   VOIDmode, 0),
> +                                      convert_modes
> +                                      (mode, imode,
> +                                       expand_expr (node->high, NULL_RTX,
> +                                                    VOIDmode, 0),
> +                                       unsignedp),
>                                        LT, NULL_RTX, mode, unsignedp, 0,
>                                        label_rtx (node->left->code_label));
>               emit_case_nodes (index, node->right, default_label, index_type);
> @@ -6203,8 +6214,11 @@ emit_case_nodes (index, node, default_la
> 
>               /* See if the value is on the right.  */
>               emit_cmp_and_jump_insns (index,
> -                                      expand_expr (node->high, NULL_RTX,
> -                                                   VOIDmode, 0),
> +                                      convert_modes
> +                                      (mode, imode,
> +                                       expand_expr (node->high, NULL_RTX,
> +                                                    VOIDmode, 0),
> +                                       unsignedp),
>                                        GT, NULL_RTX, mode, unsignedp, 0,
>                                        label_rtx (test_label));
> 
> @@ -6235,8 +6249,11 @@ emit_case_nodes (index, node, default_la
>               if (!node_has_low_bound (node, index_type))
>                 {
>                   emit_cmp_and_jump_insns (index,
> -                                          expand_expr (node->high, NULL_RTX,
> -                                                       VOIDmode, 0),
> +                                          convert_modes
> +                                          (mode, imode,
> +                                           expand_expr (node->high, NULL_RTX,
> +                                                        VOIDmode, 0),
> +                                           unsignedp),
>                                            LT, NULL_RTX, mode, unsignedp, 0,
>                                            default_label);
>                 }
> @@ -6248,8 +6265,11 @@ emit_case_nodes (index, node, default_la
>                since we haven't ruled out the numbers less than
>                this node's value.  So handle node->right explicitly.  */
>             do_jump_if_equal (index,
> -                             expand_expr (node->right->low, NULL_RTX,
> -                                          VOIDmode, 0),
> +                             convert_modes
> +                             (mode, imode,
> +                              expand_expr (node->right->low, NULL_RTX,
> +                                           VOIDmode, 0),
> +                              unsignedp),
>                               label_rtx (node->right->code_label), unsignedp);
>         }
> 
> @@ -6275,9 +6295,12 @@ emit_case_nodes (index, node, default_la
>             {
>               if (!node_has_high_bound (node, index_type))
>                 {
> -                 emit_cmp_and_jump_insns (index, expand_expr (node->high,
> -                                                              NULL_RTX,
> -                                                              VOIDmode, 0),
> +                 emit_cmp_and_jump_insns (index,
> +                                          convert_modes
> +                                          (mode, imode,
> +                                           expand_expr (node->high, NULL_RTX,
> +                                                        VOIDmode, 0),
> +                                           unsignedp),
>                                            GT, NULL_RTX, mode, unsignedp, 0,
>                                            default_label);
>                 }
> @@ -6289,8 +6312,11 @@ emit_case_nodes (index, node, default_la
>                since we haven't ruled out the numbers less than
>                this node's value.  So handle node->left explicitly.  */
>             do_jump_if_equal (index,
> -                             expand_expr (node->left->low, NULL_RTX,
> -                                          VOIDmode, 0),
> +                             convert_modes
> +                             (mode, imode,
> +                              expand_expr (node->left->low, NULL_RTX,
> +                                           VOIDmode, 0),
> +                              unsignedp),
>                               label_rtx (node->left->code_label), unsignedp);
>         }
>      }
> @@ -6312,8 +6338,12 @@ emit_case_nodes (index, node, default_la
>           if (node_is_bounded (node->right, index_type))
>             /* Right hand node is fully bounded so we can eliminate any
>                testing and branch directly to the target code.  */
> -           emit_cmp_and_jump_insns (index, expand_expr (node->high, NULL_RTX,
> -                                                        VOIDmode, 0),
> +           emit_cmp_and_jump_insns (index,
> +                                    convert_modes
> +                                    (mode, imode,
> +                                     expand_expr (node->high, NULL_RTX,
> +                                                  VOIDmode, 0),
> +                                     unsignedp),
>                                      GT, NULL_RTX, mode, unsignedp, 0,
>                                      label_rtx (node->right->code_label));
>           else
> @@ -6323,16 +6353,23 @@ emit_case_nodes (index, node, default_la
> 
>               test_label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
>               emit_cmp_and_jump_insns (index,
> -                                      expand_expr (node->high, NULL_RTX,
> -                                                   VOIDmode, 0),
> +                                      convert_modes
> +                                      (mode, imode,
> +                                       expand_expr (node->high, NULL_RTX,
> +                                                    VOIDmode, 0),
> +                                       unsignedp),
>                                        GT, NULL_RTX, mode, unsignedp, 0,
>                                        label_rtx (test_label));
>             }
> 
>           /* Value belongs to this node or to the left-hand subtree.  */
> 
> -         emit_cmp_and_jump_insns (index, expand_expr (node->low, NULL_RTX,
> -                                                      VOIDmode, 0),
> +         emit_cmp_and_jump_insns (index,
> +                                  convert_modes
> +                                  (mode, imode,
> +                                   expand_expr (node->low, NULL_RTX,
> +                                                VOIDmode, 0),
> +                                   unsignedp),
>                                    GE, NULL_RTX, mode, unsignedp, 0,
>                                    label_rtx (node->code_label));
> 
> @@ -6359,16 +6396,23 @@ emit_case_nodes (index, node, default_la
>           if (!node_has_low_bound (node, index_type))
>             {
>               emit_cmp_and_jump_insns (index,
> -                                      expand_expr (node->low, NULL_RTX,
> -                                                   VOIDmode, 0),
> +                                      convert_modes
> +                                      (mode, imode,
> +                                       expand_expr (node->low, NULL_RTX,
> +                                                    VOIDmode, 0),
> +                                       unsignedp),
>                                        LT, NULL_RTX, mode, unsignedp, 0,
>                                        default_label);
>             }
> 
>           /* Value belongs to this node or to the right-hand subtree.  */
> 
> -         emit_cmp_and_jump_insns (index, expand_expr (node->high, NULL_RTX,
> -                                                      VOIDmode, 0),
> +         emit_cmp_and_jump_insns (index,
> +                                  convert_modes
> +                                  (mode, imode,
> +                                   expand_expr (node->high, NULL_RTX,
> +                                                VOIDmode, 0),
> +                                   unsignedp),
>                                    LE, NULL_RTX, mode, unsignedp, 0,
>                                    label_rtx (node->code_label));
> 
> @@ -6382,8 +6426,11 @@ emit_case_nodes (index, node, default_la
>           if (!node_has_high_bound (node, index_type))
>             {
>               emit_cmp_and_jump_insns (index,
> -                                      expand_expr (node->high, NULL_RTX,
> -                                                   VOIDmode, 0),
> +                                      convert_modes
> +                                      (mode, imode,
> +                                       expand_expr (node->high, NULL_RTX,
> +                                                    VOIDmode, 0),
> +                                       unsignedp),
>                                        GT, NULL_RTX, mode, unsignedp, 0,
>                                        default_label);
>             }
> @@ -6391,8 +6438,11 @@ emit_case_nodes (index, node, default_la
>           /* Value belongs to this node or to the left-hand subtree.  */
> 
>           emit_cmp_and_jump_insns (index,
> -                                  expand_expr (node->low, NULL_RTX,
> -                                               VOIDmode, 0),
> +                                  convert_modes
> +                                  (mode, imode,
> +                                   expand_expr (node->low, NULL_RTX,
> +                                                VOIDmode, 0),
> +                                   unsignedp),
>                                    GE, NULL_RTX, mode, unsignedp, 0,
>                                    label_rtx (node->code_label));
> 
> @@ -6408,8 +6458,11 @@ emit_case_nodes (index, node, default_la
>           if (!node_has_high_bound (node, index_type))
>             {
>               emit_cmp_and_jump_insns (index,
> -                                      expand_expr (node->high, NULL_RTX,
> -                                                   VOIDmode, 0),
> +                                      convert_modes
> +                                      (mode, imode,
> +                                       expand_expr (node->high, NULL_RTX,
> +                                                    VOIDmode, 0),
> +                                       unsignedp),
>                                        GT, NULL_RTX, mode, unsignedp, 0,
>                                        default_label);
>             }
> @@ -6417,8 +6470,11 @@ emit_case_nodes (index, node, default_la
>           if (!node_has_low_bound (node, index_type))
>             {
>               emit_cmp_and_jump_insns (index,
> -                                      expand_expr (node->low, NULL_RTX,
> -                                                   VOIDmode, 0),
> +                                      convert_modes
> +                                      (mode, imode,
> +                                       expand_expr (node->low, NULL_RTX,
> +                                                    VOIDmode, 0),
> +                                       unsignedp),
>                                        LT, NULL_RTX, mode, unsignedp, 0,
>                                        default_label);
>             }
> Index: gcc/unroll.c
> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/unroll.c,v
> retrieving revision 1.125
> diff -u -p -r1.125 unroll.c
> --- gcc/unroll.c 2001/01/25 09:28:55 1.125
> +++ gcc/unroll.c 2001/03/22 04:40:39
> @@ -3962,6 +3962,8 @@ loop_iterations (loop)
>    else
>      abort ();
> 
> +  abs_diff = trunc_int_for_mode (abs_diff, GET_MODE (iteration_var));
> +
>    /* For NE tests, make sure that the iteration variable won't miss
>       the final value.  If abs_diff mod abs_incr is not zero, then the
>       iteration variable will overflow before the loop exits, and we
> Index: gcc/varasm.c
> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/varasm.c,v
> retrieving revision 1.161.2.5
> diff -u -p -r1.161.2.5 varasm.c
> --- gcc/varasm.c 2001/03/15 09:59:47 1.161.2.5
> +++ gcc/varasm.c 2001/03/22 04:40:40
> @@ -1989,7 +1989,7 @@ immed_double_const (i0, i1, mode)
>          represented as a 64 bit value -1, and not as 0x00000000ffffffff.
>          The later confuses the sparc backend.  */
> 
> -      if (BITS_PER_WORD < HOST_BITS_PER_WIDE_INT && BITS_PER_WORD == width
> +      if (width < HOST_BITS_PER_WIDE_INT
>           && (i0 & ((HOST_WIDE_INT) 1 << (width - 1))))
>         i0 |= ((HOST_WIDE_INT) (-1) << width);
> 
> 
>   ------------------------------------------------------------------------
> 
> --
> Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
> Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
> CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
> Free Software Evangelist    *Please* write to mailing lists, not to me


Nope, build procedure (as described on the eCos site, without their
patch) dies. See attached build output. I used again gcc-2.95.3 to
compile the thing (snapshot 20010320 with your patch).

Thanks for all your help though.

Regards,
Bob

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cross compiler Alpha->powerpc problems
  2001-03-26 22:55   ` Bob Koninckx
@ 2001-03-27 13:06     ` Alexandre Oliva
  2001-03-28  0:50       ` Bob Koninckx
  0 siblings, 1 reply; 7+ messages in thread
From: Alexandre Oliva @ 2001-03-27 13:06 UTC (permalink / raw)
  To: bob.koninckx; +Cc: gcc-help

On Mar 27, 2001, Bob Koninckx <bob.koninckx@mech.kuleuven.ac.be> wrote:

> I suppose your patch does not break Red Hat Linux.

Do you mean Red Hat Linux for alpha?  Yes, I've tested the patch I
posted, and it does work.  But it would break on x86, without a minor
update.

> Any chance that I can get it??

Only if you promise to let me know of any problems that might show up
on alpha-x-ppc.  Or, even better, if it ``just works'' :-)

Here's the latest patch, tested with bootstrap on alpha, sparc and
x86, and failed bootstrap on pa.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cross compiler Alpha->powerpc problems
  2001-03-26 19:52 ` Alexandre Oliva
@ 2001-03-26 22:55   ` Bob Koninckx
  2001-03-27 13:06     ` Alexandre Oliva
  0 siblings, 1 reply; 7+ messages in thread
From: Bob Koninckx @ 2001-03-26 22:55 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: gcc-help

Alexandre Oliva wrote:

> On Mar 25, 2001, Bob Koninckx <bob.koninckx@mech.kuleuven.ac.be> wrote:
>
> > ../../../src/gcc/gcc-2.95.2/gcc/libgcc2.c:1069: Could not split insn
> > (insn:TI 144 16 18 (set (reg:SI 10 r10)
> >         (const_int 4294901760 [0xffff0000])) 423 {movsi+1} (insn_list
> > 143 (nil))
> >     (nil))
> > make[3]: *** [libgcc2.a] Error 1
>
> > Any ideas ?? Suggestions
>
> This is a known problem.  The ppc back-end doesn't work correctly on
> 64-bit machines.  I've been working on a patch to fix this, but the
> patch I have still breaks HP-UX, so it can't be installed.
>
> --
> Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
> Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
> CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
> Free Software Evangelist    *Please* write to mailing lists, not to me

I suppose your patch does not break Red Hat Linux.  Any chance that I can
get it ?? Would be a great help to me. Thanks,

Bob

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cross compiler Alpha->powerpc problems
  2001-03-25  3:31 Bob Koninckx
@ 2001-03-26 19:52 ` Alexandre Oliva
  2001-03-26 22:55   ` Bob Koninckx
  0 siblings, 1 reply; 7+ messages in thread
From: Alexandre Oliva @ 2001-03-26 19:52 UTC (permalink / raw)
  To: bob.koninckx; +Cc: gcc-help

On Mar 25, 2001, Bob Koninckx <bob.koninckx@mech.kuleuven.ac.be> wrote:

> ../../../src/gcc/gcc-2.95.2/gcc/libgcc2.c:1069: Could not split insn
> (insn:TI 144 16 18 (set (reg:SI 10 r10)
>         (const_int 4294901760 [0xffff0000])) 423 {movsi+1} (insn_list
> 143 (nil))
>     (nil))
> make[3]: *** [libgcc2.a] Error 1

> Any ideas ?? Suggestions

This is a known problem.  The ppc back-end doesn't work correctly on
64-bit machines.  I've been working on a patch to fix this, but the
patch I have still breaks HP-UX, so it can't be installed.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Cross compiler Alpha->powerpc problems
@ 2001-03-25  3:31 Bob Koninckx
  2001-03-26 19:52 ` Alexandre Oliva
  0 siblings, 1 reply; 7+ messages in thread
From: Bob Koninckx @ 2001-03-25  3:31 UTC (permalink / raw)
  To: gcc-help

Hi guys,

I am trying to build the development tools for ecos on an alpha (rh. 7.0
distribution, 2.2.17 kernel)

My native tools are gcc-2.95.3, binutils 2.10.1

I downloaded gcc-2.95.2 (core + g++) and binutils-2.10.1

Binutils compiled fine and where installed under
/usr/local/crossgcc/powerpc-eabi

I then tried to build the compiler using the following commands


## PATH=/usr/local/crossgcc/powerpc-eabi/bin:$PATH; export PATH

## configure --target=powerpc-eabi \
## --prefix=/usr/local/crossgcc/powerpc-eabi \
## --exec-prefix=/usr/local/crossgcc/powerpc-eabi \
## --with-gnu-as --with-gnu-ld --with-newlib \
## -v 2>&1 | tee configure.out

This did not report any errors. The build phase dies with the message 


make[3]: Entering directory `/home/bob/tmp/ecos-tools/build/gcc/gcc'
rm -f tmplibgcc2.a
for name in _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 _lshrdi3
_ashldi3 _ashrdi3 _ffsdi2 _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2
_floatdidf _floatdisf _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi
_fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi
_fixtfdi _fixunstfdi _floatditf __gcc_bcmp _varargs __dummy _eprintf _bb
_shtab _clear_cache _trampoline __main _exit _ctors _pure; \
do \
  echo ${name}; \
  /home/bob/tmp/ecos-tools/build/gcc/gcc/xgcc
-B/home/bob/tmp/ecos-tools/build/gcc/gcc/
-B/usr/local/crossgcc/powerpc-eabi/powerpc-eabi/bin/
-I/usr/local/crossgcc/powerpc-eabi/powerpc-eabi/include -O2 
-DCROSS_COMPILE -DIN_GCC -DHAIFA    -g -O2 -I./include    -g1 
-DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc   -mrelocatable-lib
-mno-eabi -mstrict-align -I. -I../../../src/gcc/gcc-2.95.2/gcc
-I../../../src/gcc/gcc-2.95.2/gcc/config
-I../../../src/gcc/gcc-2.95.2/gcc/../include -c -DL${name} \
       ../../../src/gcc/gcc-2.95.2/gcc/libgcc2.c -o ${name}.o; \
  if [ $? -eq 0 ] ; then true; else exit 1; fi; \
  powerpc-eabi-ar rc tmplibgcc2.a ${name}.o; \
  rm -f ${name}.o; \
done
_muldi3
_divdi3
_moddi3
_udivdi3
_umoddi3
_negdi2
_lshrdi3
_ashldi3
_ashrdi3
_ffsdi2
_udiv_w_sdiv
_udivmoddi4
_cmpdi2
_ucmpdi2
_floatdidf
_floatdisf
../../../src/gcc/gcc-2.95.2/gcc/libgcc2.c: In function `__floatdisf':
../../../src/gcc/gcc-2.95.2/gcc/libgcc2.c:1069: Could not split insn
(insn:TI 144 16 18 (set (reg:SI 10 r10)
        (const_int 4294901760 [0xffff0000])) 423 {movsi+1} (insn_list
143 (nil))
    (nil))
make[3]: *** [libgcc2.a] Error 1




Any ideas ?? Suggestions

Thanks,

Bob

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-03-28  0:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-26  4:38 Cross compiler Alpha->powerpc problems David Korn
2001-03-26  5:17 ` Bob Koninckx
  -- strict thread matches above, loose matches on Subject: below --
2001-03-25  3:31 Bob Koninckx
2001-03-26 19:52 ` Alexandre Oliva
2001-03-26 22:55   ` Bob Koninckx
2001-03-27 13:06     ` Alexandre Oliva
2001-03-28  0:50       ` Bob Koninckx

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).