Ticket #28171: patch-mspgcc-4.4.5.diff

File patch-mspgcc-4.4.5.diff, 6.7 KB (added by stevecheckoway (Stephen Checkoway), 14 years ago)
  • configure

    diff --git gcc-4.4.5.orig/configure gcc-4.4.5/configure
    index 2925c1a..994f6b5 100755
    old new case "${target}" in 
    23602360  avr-*-*)
    23612361    noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj} target-libssp"
    23622362    ;;
     2363  msp430-*-*)
     2364    noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj} target-libssp"
     2365    ;;
    23632366  bfin-*-*)
    23642367    noconfigdirs="$noconfigdirs gdb"
    23652368    if test x${is_cross_compiler} != xno ; then
  • gcc/config.gcc

    diff --git gcc-4.4.5.orig/gcc/config.gcc gcc-4.4.5/gcc/config.gcc
    index 6f72224..bb06db3 100644
    old new avr-*-rtems*) 
    810810avr-*-*)
    811811        tm_file="avr/avr.h dbxelf.h"
    812812        ;;
     813msp430-*-*)
     814        tm_file="msp430/msp430.h dbxelf.h"
     815        c_target_objs=`cat ${srcdir}/config/msp430/objs-extra`
     816        cxx_target_objs=`cat ${srcdir}/config/msp430/objs-extra`
     817        use_fixproto=yes
     818        ;;
    813819bfin*-elf*)
    814820        tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h"
    815821        tmake_file=bfin/t-bfin-elf
  • gcc/configure

    diff --git gcc-4.4.5.orig/gcc/configure gcc-4.4.5/gcc/configure
    index 64cdd91..d881a06 100755
    old new ac_compiler_gnu=$ac_cv_c_compiler_gnu 
    15951595
    15961596
    15971597gcc_version=`cat $srcdir/BASE-VER`
     1598echo $gcc_version | sed s/\\\([0-9]\\\)\.\\\([0-9]\\\)\.\\\([0-9]\\\)/\#define\ GCC_VERSION_INT\ 0x\\1\\2\\3/g > $srcdir/_gccver.h
    15981599
    15991600# Determine the host, build, and target systems
    16001601ac_aux_dir=
    esac 
    2381923820case "$target" in
    2382023821  i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \
    2382123822  | x86_64*-*-* | hppa*-*-* | arm*-*-* \
     23823  | msp430-*-* \
    2382223824  | xstormy16*-*-* | cris-*-* | crisv32-*-* | xtensa*-*-* | bfin-*-* | score*-*-* \
    2382323825  | spu-*-* | fido*-*-* | m32c-*-*)
    2382423826    insn="nop"
  • gcc/dse.c

    diff --git gcc-4.4.5.orig/gcc/dse.c gcc-4.4.5/gcc/dse.c
    index 3d347ce..844fd51 100644
    old new replace_inc_dec (rtx *r, void *d) 
    826826    case POST_INC:
    827827      {
    828828        rtx r1 = XEXP (x, 0);
    829         rtx c = gen_int_mode (Pmode, data->size);
     829        rtx c = gen_int_mode (data->size, Pmode);
    830830        emit_insn_before (gen_rtx_SET (Pmode, r1,
    831831                                       gen_rtx_PLUS (Pmode, r1, c)),
    832832                          data->insn);
    replace_inc_dec (rtx *r, void *d) 
    837837    case POST_DEC:
    838838      {
    839839        rtx r1 = XEXP (x, 0);
    840         rtx c = gen_int_mode (Pmode, -data->size);
     840        rtx c = gen_int_mode (-data->size, Pmode);
    841841        emit_insn_before (gen_rtx_SET (Pmode, r1,
    842842                                       gen_rtx_PLUS (Pmode, r1, c)),
    843843                          data->insn);
  • gcc/emit-rtl.c

    diff --git gcc-4.4.5.orig/gcc/emit-rtl.c gcc-4.4.5/gcc/emit-rtl.c
    index a91e7fd..0574d52 100644
    old new set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp, 
    16861686      base = get_base_address (base);
    16871687      if (base && DECL_P (base)
    16881688          && TREE_READONLY (base)
    1689           && (TREE_STATIC (base) || DECL_EXTERNAL (base)))
     1689          && (TREE_STATIC (base) || DECL_EXTERNAL (base))
     1690          && !TREE_THIS_VOLATILE (base))
    16901691        {
    16911692          tree base_type = TREE_TYPE (base);
    16921693          gcc_assert (!(base_type && TYPE_NEEDS_CONSTRUCTING (base_type))
  • gcc/expr.c

    diff --git gcc-4.4.5.orig/gcc/expr.c gcc-4.4.5/gcc/expr.c
    index b6bc529..9e93287 100644
    old new move_by_pieces (rtx to, rtx from, unsigned HOST_WIDE_INT len, 
    955955          data.autinc_from = 1;
    956956          data.explicit_inc_from = -1;
    957957        }
    958       if (USE_LOAD_POST_INCREMENT (mode) && ! data.autinc_from)
     958      if (USE_LOAD_POST_INCREMENT (mode) && !data.reverse && !data.autinc_from)
    959959        {
    960960          data.from_addr = copy_addr_to_reg (from_addr);
    961961          data.autinc_from = 1;
  • gcc/loop-invariant.c

    diff --git gcc-4.4.5.orig/gcc/loop-invariant.c gcc-4.4.5/gcc/loop-invariant.c
    index 7eaabf7..0d0585e 100644
    old new move_invariant_reg (struct loop *loop, unsigned invno) 
    11711171  rtx reg, set, dest, note;
    11721172  struct use *use;
    11731173  bitmap_iterator bi;
     1174  int n_validated;
    11741175
    11751176  if (inv->reg)
    11761177    return true;
    11771178  if (!repr->move)
    11781179    return false;
     1180  n_validated = num_validated_changes ();
    11791181  /* If this is a representative of the class of equivalent invariants,
    11801182     really move the invariant.  Otherwise just replace its use with
    11811183     the register used for the representative.  */
    move_invariant_reg (struct loop *loop, unsigned invno) 
    12001202      reg = gen_reg_rtx_and_attrs (dest);
    12011203
    12021204      /* Try replacing the destination by a new pseudoregister.  */
    1203       if (!validate_change (inv->insn, &SET_DEST (set), reg, false))
     1205      validate_change (inv->insn, &SET_DEST (set), reg, true);
     1206
     1207      /* Replace the uses we know to be dominated.  It saves work for copy
     1208         propagation, and also it is necessary so that dependent invariants
     1209         are computed right.  */
     1210      /* Note that we must test the changes for validity, lest we might
     1211         rip apart a match_dup between a use and a clobber.  */
     1212      if (inv->def)
     1213        for (use = inv->def->uses; use; use = use->next)
     1214          validate_change (use->insn, use->pos, reg, true);
     1215      if (!apply_change_group ())
    12041216        goto fail;
    12051217      df_insn_rescan (inv->insn);
    12061218
    move_invariant_reg (struct loop *loop, unsigned invno) 
    12211233    }
    12221234  else
    12231235    {
    1224       if (!move_invariant_reg (loop, repr->invno))
    1225         goto fail;
     1236      /* Replace the uses we know to be dominated.  It saves work for copy
     1237         propagation, and also it is necessary so that dependent invariants
     1238         are computed right.  */
    12261239      reg = repr->reg;
     1240      if (inv->def)
     1241        for (use = inv->def->uses; use; use = use->next)
     1242          validate_change (use->insn, use->pos, reg, true);
     1243
     1244      if (verify_changes (n_validated)
     1245          && move_invariant_reg (loop, repr->invno))
     1246        confirm_change_group ();
     1247      else
     1248        {
     1249          cancel_changes (n_validated);
     1250          goto fail;
     1251        }
     1252
    12271253      set = single_set (inv->insn);
    12281254      emit_insn_after (gen_move_insn (SET_DEST (set), reg), inv->insn);
    12291255      delete_insn (inv->insn);
    move_invariant_reg (struct loop *loop, unsigned invno) 
    12321258
    12331259  inv->reg = reg;
    12341260
    1235   /* Replace the uses we know to be dominated.  It saves work for copy
    1236      propagation, and also it is necessary so that dependent invariants
    1237      are computed right.  */
    12381261  if (inv->def)
    1239     {
    1240       for (use = inv->def->uses; use; use = use->next)
    1241         {
    1242           *use->pos = reg;
    1243           df_insn_rescan (use->insn);
    1244         }     
    1245     }
     1262    for (use = inv->def->uses; use; use = use->next)
     1263      df_insn_rescan (use->insn);
    12461264
    12471265  return true;
    12481266
  • libgcc/config.host

    diff --git gcc-4.4.5.orig/libgcc/config.host gcc-4.4.5/libgcc/config.host
    index 55af651..23aa200 100644
    old new avr-*-*) 
    224224    # Make HImode functions for AVR
    225225    tmake_file=${cpu_type}/t-avr
    226226        ;;
     227msp430-*-*)
     228        ;;
    227229bfin*-elf*)
    228230        ;;
    229231bfin*-uclinux*)