# DP: updates from the 4.7 branch upto 20130614 (r200084). last_updated() { cat > ${dir}LAST_UPDATED < + + Backport from mainline: + 2013-06-08 Walter Lee + + * config/tilepro/atomic.h: Don't include stdint.h or features.h. + Replace int64_t with long long. Add __extension__ where + appropriate. + +2013-06-06 Douglas B Rupp + + * config.host (arm-wrs-vxworks): Configure with other soft float. + 2013-05-20 Chung-Ju Wu Backport from mainline: Index: libgcc/config/tilepro/atomic.h =================================================================== --- a/src/libgcc/config/tilepro/atomic.h (revision +++ b/src/libgcc/config/tilepro/atomic.h (revision @@ -1,6 +1,5 @@ /* Macros for atomic functionality for tile. - Copyright (C) 2011, 2012 - Free Software Foundation, Inc. + Copyright (C) 2011-2013 Free Software Foundation, Inc. Contributed by Walter Lee (walt@tilera.com) This file is free software; you can redistribute it and/or modify it @@ -93,8 +92,6 @@ compare-and-exchange routine, so may be potentially less efficient. */ #endif -#include -#include #ifdef __tilegx__ #include #else @@ -123,9 +120,9 @@ /* 64-bit integer compare-and-exchange. */ static __inline __attribute__ ((always_inline)) - int64_t arch_atomic_val_compare_and_exchange_8 (volatile int64_t * mem, - int64_t oldval, - int64_t newval) + long long arch_atomic_val_compare_and_exchange_8 (volatile long long + *mem, long long oldval, + long long newval) { #ifdef __tilegx__ __insn_mtspr (SPR_CMPEXCH_VALUE, oldval); @@ -140,7 +137,7 @@ "R04" (newval_lo), "R05" (newval_hi), "m" (*mem):"r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29", "memory"); - return ((uint64_t) result_hi) << 32 | result_lo; + return ((long long) result_hi) << 32 | result_lo; #endif } @@ -151,11 +148,11 @@ #define arch_atomic_val_compare_and_exchange(mem, o, n) \ - ({ \ + __extension__ ({ \ (__typeof(*(mem)))(__typeof(*(mem)-*(mem))) \ ((sizeof(*(mem)) == 8) ? \ arch_atomic_val_compare_and_exchange_8( \ - (volatile int64_t*)(mem), (__typeof((o)-(o)))(o), \ + (volatile long long*)(mem), (__typeof((o)-(o)))(o), \ (__typeof((n)-(n)))(n)) : \ (sizeof(*(mem)) == 4) ? \ arch_atomic_val_compare_and_exchange_4( \ @@ -165,7 +162,7 @@ }) #define arch_atomic_bool_compare_and_exchange(mem, o, n) \ - ({ \ + __extension__ ({ \ __typeof(o) __o = (o); \ __builtin_expect( \ __o == arch_atomic_val_compare_and_exchange((mem), __o, (n)), 1); \ @@ -175,7 +172,7 @@ /* Loop with compare_and_exchange until we guess the correct value. Normally "expr" will be an expression using __old and __value. */ #define __arch_atomic_update_cmpxchg(mem, value, expr) \ - ({ \ + __extension__ ({ \ __typeof(value) __value = (value); \ __typeof(*(mem)) *__mem = (mem), __old = *__mem, __guess; \ do { \ @@ -190,12 +187,14 @@ /* Generic atomic op with 8- or 4-byte variant. The _mask, _addend, and _expr arguments are ignored on tilegx. */ #define __arch_atomic_update(mem, value, op, _mask, _addend, _expr) \ - ({ \ + __extension__ ({ \ ((__typeof(*(mem))) \ ((sizeof(*(mem)) == 8) ? (__typeof(*(mem)-*(mem)))__insn_##op( \ - (void *)(mem), (int64_t)(__typeof((value)-(value)))(value)) : \ + (volatile void *)(mem), \ + (long long)(__typeof((value)-(value)))(value)) : \ (sizeof(*(mem)) == 4) ? (int)__insn_##op##4( \ - (void *)(mem), (int32_t)(__typeof((value)-(value)))(value)) : \ + (volatile void *)(mem), \ + (int)(__typeof((value)-(value)))(value)) : \ __arch_atomic_error_bad_argument_size())); \ }) @@ -225,7 +224,7 @@ /* Generic atomic op with 8- or 4-byte variant. The _op argument is ignored on tilepro. */ #define __arch_atomic_update(mem, value, _op, mask, addend, expr) \ - ({ \ + __extension__ ({ \ (__typeof(*(mem)))(__typeof(*(mem)-*(mem))) \ ((sizeof(*(mem)) == 8) ? \ __arch_atomic_update_cmpxchg((mem), (value), (expr)) : \ @@ -264,13 +263,13 @@ __arch_atomic_update_cmpxchg(mem, mask, ~(__old & __value)) #define arch_atomic_bit_set(mem, bit) \ - ({ \ + __extension__ ({ \ __typeof(*(mem)) __mask = (__typeof(*(mem)))1 << (bit); \ __mask & arch_atomic_or((mem), __mask); \ }) #define arch_atomic_bit_clear(mem, bit) \ - ({ \ + __extension__ ({ \ __typeof(*(mem)) __mask = (__typeof(*(mem)))1 << (bit); \ __mask & arch_atomic_and((mem), ~__mask); \ }) Index: gcc/DATESTAMP =================================================================== --- a/src/gcc/DATESTAMP (revision +++ b/src/gcc/DATESTAMP (revision @@ -1 +1 @@ -20130603 +20130614 Index: gcc/ChangeLog =================================================================== --- a/src/gcc/ChangeLog (revision +++ b/src/gcc/ChangeLog (revision @@ -1,3 +1,31 @@ +2013-06-07 Uros Bizjak + + Backport from mainline + 2013-06-10 Uros Bizjak + + * config/alpha/alpha.c (alpha_emit_xfloating_compare): Also use + cmp_code to construct REG_EQUAL note. + + Backport from mainline + 2013-06-05 Uros Bizjak + + * config/alpha/alpha.c (alpha_emit_conditional_move): Swap all + GE, GT, GEU and GTU compares, modulo DImode compares with zero. + + Backport from mainline + 2013-05-23 Uros Bizjak + + PR target/57379 + * config/alpha/alpha.md (unspec): Add UNSPEC_XFLT_COMPARE. + * config/alpha/alpha.c (alpha_emit_xfloating_compare): Construct + REG_EQUAL note as UNSPEC_XFLT_COMPARE unspec. + +2013-06-09 Jakub Jelinek + + PR target/57568 + * config/i386/i386.md (TARGET_READ_MODIFY_WRITE peepholes): Ensure + that operands[2] doesn't overlap with operands[0]. + 2013-05-22 Uros Bizjak PR target/57356 Index: gcc/testsuite/gfortran.dg/do_5.f90 =================================================================== --- a/src/gcc/testsuite/gfortran.dg/do_5.f90 (revision +++ b/src/gcc/testsuite/gfortran.dg/do_5.f90 (revision @@ -0,0 +1,29 @@ +! { dg-do compile } +! +! PR fortran/54370 +! +! The following program was ICEing at tree-check time +! "L()" was regarded as default-kind logical. +! +! Contributed by Kirill Chilikin +! + MODULE M + CONTAINS + + LOGICAL(C_BOOL) FUNCTION L() BIND(C) + USE, INTRINSIC :: ISO_C_BINDING + L = .FALSE. + END FUNCTION + + LOGICAL(8) FUNCTION L2() BIND(C) ! { dg-warning "may not be a C interoperable kind but it is bind" } + L2 = .FALSE._8 + END FUNCTION + + SUBROUTINE S() + DO WHILE (L()) + ENDDO + DO WHILE (L2()) + ENDDO + END + + END Index: gcc/testsuite/gcc.c-torture/execute/pr57568.c =================================================================== --- a/src/gcc/testsuite/gcc.c-torture/execute/pr57568.c (revision +++ b/src/gcc/testsuite/gcc.c-torture/execute/pr57568.c (revision @@ -0,0 +1,12 @@ +/* PR target/57568 */ + +extern void abort (void); +int a[6][9] = { }, b = 1, *c = &a[3][5]; + +int +main () +{ + if (b && (*c = *c + *c)) + abort (); + return 0; +} Index: gcc/testsuite/ChangeLog =================================================================== --- a/src/gcc/testsuite/ChangeLog (revision +++ b/src/gcc/testsuite/ChangeLog (revision @@ -1,3 +1,16 @@ +2013-06-09 Jakub Jelinek + + PR target/57568 + * gcc.c-torture/execute/pr57568.c: New test. + +2013-06-06 Tobias Burnus + + Backport from mainline + 2012-08-27 Tobias Burnus + + PR fortran/54370 + * gfortran.dg/do_5.f90: New. + 2013-06-01 Janus Weil Tobias Burnus Index: gcc/fortran/ChangeLog =================================================================== --- a/src/gcc/fortran/ChangeLog (revision +++ b/src/gcc/fortran/ChangeLog (revision @@ -1,3 +1,12 @@ +2013-06-06 Tobias Burnus + + Backport from mainline + 2012-08-27 Tobias Burnus + + PR fortran/54370 + * trans-stmt.c (gfc_trans_do_while): Don't change the logical + kind for negation of the condition. + 2013-06-01 Janus Weil Tobias Burnus Index: gcc/fortran/trans-stmt.c =================================================================== --- a/src/gcc/fortran/trans-stmt.c (revision +++ b/src/gcc/fortran/trans-stmt.c (revision @@ -1743,7 +1743,7 @@ gfc_conv_expr_val (&cond, code->expr1); gfc_add_block_to_block (&block, &cond.pre); cond.expr = fold_build1_loc (code->expr1->where.lb->location, - TRUTH_NOT_EXPR, boolean_type_node, cond.expr); + TRUTH_NOT_EXPR, TREE_TYPE (cond.expr), cond.expr); /* Build "IF (! cond) GOTO exit_label". */ tmp = build1_v (GOTO_EXPR, exit_label); Index: gcc/config/alpha/alpha.md =================================================================== --- a/src/gcc/config/alpha/alpha.md (revision +++ b/src/gcc/config/alpha/alpha.md (revision @@ -25,6 +25,7 @@ ;; Uses of UNSPEC in this file: (define_c_enum "unspec" [ + UNSPEC_XFLT_COMPARE UNSPEC_ARG_HOME UNSPEC_LDGP1 UNSPEC_INSXH Index: gcc/config/alpha/alpha.c =================================================================== --- a/src/gcc/config/alpha/alpha.c (revision +++ b/src/gcc/config/alpha/alpha.c (revision @@ -2658,12 +2658,12 @@ break; case GE: case GT: case GEU: case GTU: - /* These must be swapped. */ - if (op1 != CONST0_RTX (cmp_mode)) - { - code = swap_condition (code); - tem = op0, op0 = op1, op1 = tem; - } + /* These normally need swapping, but for integer zero we have + special patterns that recognize swapped operands. */ + if (cmp_mode == DImode && op1 == const0_rtx) + break; + code = swap_condition (code); + tem = op0, op0 = op1, op1 = tem; break; default: @@ -3025,12 +3025,9 @@ operands[1] = op1; out = gen_reg_rtx (DImode); - /* What's actually returned is -1,0,1, not a proper boolean value, - so use an EXPR_LIST as with a generic libcall instead of a - comparison type expression. */ - note = gen_rtx_EXPR_LIST (VOIDmode, op1, NULL_RTX); - note = gen_rtx_EXPR_LIST (VOIDmode, op0, note); - note = gen_rtx_EXPR_LIST (VOIDmode, func, note); + /* What's actually returned is -1,0,1, not a proper boolean value. */ + note = gen_rtx_fmt_ee (cmp_code, VOIDmode, op0, op1); + note = gen_rtx_UNSPEC (DImode, gen_rtvec (1, note), UNSPEC_XFLT_COMPARE); alpha_emit_xfloating_libcall (func, out, operands, 2, note); return out; Index: gcc/config/i386/i386.md =================================================================== --- a/src/gcc/config/i386/i386.md (revision +++ b/src/gcc/config/i386/i386.md (revision @@ -17194,6 +17194,7 @@ "(TARGET_READ_MODIFY_WRITE || optimize_insn_for_size_p ()) && peep2_reg_dead_p (4, operands[0]) && !reg_overlap_mentioned_p (operands[0], operands[1]) + && !reg_overlap_mentioned_p (operands[0], operands[2]) && (mode != QImode || immediate_operand (operands[2], QImode) || q_regs_operand (operands[2], QImode)) @@ -17258,6 +17259,7 @@ || immediate_operand (operands[2], SImode) || q_regs_operand (operands[2], SImode)) && !reg_overlap_mentioned_p (operands[0], operands[1]) + && !reg_overlap_mentioned_p (operands[0], operands[2]) && ix86_match_ccmode (peep2_next_insn (3), (GET_CODE (operands[3]) == PLUS || GET_CODE (operands[3]) == MINUS)