aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Gretton-Dann <matthew.gretton-dann@linaro.org>2013-06-26 14:16:15 +0100
committerMatthew Gretton-Dann <matthew.gretton-dann@linaro.org>2013-06-26 14:16:15 +0100
commit6445a3b79fe9da679856910398d661690401e1fe (patch)
tree502bc61d15c460d1398aeb78dd98a00403298eff
parentc3f70c7f98c828624877fa45554f7ca6b4fdc1ff (diff)
Merge from 4.7.4 (svn branches/gcc-4_7-branch rev 200408).
-rw-r--r--ChangeLog.linaro4
-rw-r--r--gcc/ChangeLog42
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/collect2.c18
-rw-r--r--gcc/collect2.h4
-rw-r--r--gcc/config/alpha/alpha.c21
-rw-r--r--gcc/config/alpha/alpha.md1
-rw-r--r--gcc/config/i386/i386.md2
-rw-r--r--gcc/fortran/ChangeLog9
-rw-r--r--gcc/fortran/trans-stmt.c2
-rw-r--r--gcc/testsuite/ChangeLog13
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr57568.c12
-rw-r--r--gcc/testsuite/gfortran.dg/do_5.f9029
-rw-r--r--gcc/tlink.c16
-rw-r--r--libgcc/ChangeLog13
-rw-r--r--libgcc/config.host2
-rw-r--r--libgcc/config/tilepro/atomic.h35
17 files changed, 171 insertions, 54 deletions
diff --git a/ChangeLog.linaro b/ChangeLog.linaro
index 59963caa65a..d5a02d27616 100644
--- a/ChangeLog.linaro
+++ b/ChangeLog.linaro
@@ -1,3 +1,7 @@
+2013-06-26 Matthew Gretton-Dann <matthew.gretton-dann@linaro.org>
+
+ Merge from FSF GCC 4.7.4 (svn branches/gcc-4_7-branch 200408).
+
2013-06-14 Rob Savoye <rob.savoye@linaro.org>
GCC Linaro 4.7-2013.06-1 released.
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d6ed9bbf2bf..2bfabf7b728 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,45 @@
+2013-06-21 David Edelsohn <dje.gcc@gmail.com>
+
+ Backport from mainline
+ 2013-06-19 David Edelsohn <dje.gcc@gmail.com>
+
+ PR driver/57652
+ * collect2.c (collect_atexit): New.
+ (collect_exit): Delete.
+ (main): Register collect_atexit with atexit.
+ (collect_wait): Change collect_exit to exit.
+ (do_wait): Same.
+ * collect2.h (collect_exit): Delete.
+ * tlink.c (do_tlink): Rename exit to ret. Change collect_exit to exit.
+
+2013-06-07 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2013-06-10 Uros Bizjak <ubizjak@gmail.com>
+
+ * 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 <ubizjak@gmail.com>
+
+ * 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 <ubizjak@gmail.com>
+
+ 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 <jakub@redhat.com>
+
+ 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 <ubizjak@gmail.com>
PR target/57356
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 028663d57e6..d910aa3e00f 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20130603
+20130626
diff --git a/gcc/collect2.c b/gcc/collect2.c
index 748a3f479ad..8870b7ce473 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -1,7 +1,7 @@
/* Collect static initialization info into data structures that can be
traversed by C++ initialization and finalization routines.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011, 2013
Free Software Foundation, Inc.
Contributed by Chris Smith (csmith@convex.com).
Heavily modified by Michael Meissner (meissner@cygnus.com),
@@ -384,8 +384,8 @@ static void scan_prog_file (const char *, scanpass, scanfilter);
/* Delete tempfiles and exit function. */
-void
-collect_exit (int status)
+static void
+collect_atexit (void)
{
if (c_file != 0 && c_file[0])
maybe_unlink (c_file);
@@ -413,13 +413,8 @@ collect_exit (int status)
maybe_unlink (lderrout);
}
- if (status != 0 && output_file != 0 && output_file[0])
- maybe_unlink (output_file);
-
if (response_file)
maybe_unlink (response_file);
-
- exit (status);
}
@@ -1132,6 +1127,9 @@ main (int argc, char **argv)
signal (SIGCHLD, SIG_DFL);
#endif
+ if (atexit (collect_atexit) != 0)
+ fatal_error ("atexit failed");
+
/* Unlock the stdio streams. */
unlock_std_streams ();
@@ -1973,7 +1971,7 @@ collect_wait (const char *prog, struct pex_obj *pex)
error ("%s terminated with signal %d [%s]%s",
prog, sig, strsignal(sig),
WCOREDUMP(status) ? ", core dumped" : "");
- collect_exit (FATAL_EXIT_CODE);
+ exit (FATAL_EXIT_CODE);
}
if (WIFEXITED (status))
@@ -1989,7 +1987,7 @@ do_wait (const char *prog, struct pex_obj *pex)
if (ret != 0)
{
error ("%s returned %d exit status", prog, ret);
- collect_exit (ret);
+ exit (ret);
}
if (response_file)
diff --git a/gcc/collect2.h b/gcc/collect2.h
index e18892d3a55..a9594d2f085 100644
--- a/gcc/collect2.h
+++ b/gcc/collect2.h
@@ -1,5 +1,5 @@
/* Header file for collect/tlink routines.
- Copyright (C) 1998, 2003, 2004, 2005, 2007, 2010, 2011
+ Copyright (C) 1998, 2003, 2004, 2005, 2007, 2010, 2011, 2013
Free Software Foundation, Inc.
This file is part of GCC.
@@ -26,8 +26,6 @@ extern void do_tlink (char **, char **);
extern struct pex_obj *collect_execute (const char *, char **, const char *,
const char *, int flags);
-extern void collect_exit (int) ATTRIBUTE_NORETURN;
-
extern int collect_wait (const char *, struct pex_obj *);
extern void dump_file (const char *, FILE *);
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index f27c08a8cf8..388e77d977e 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -2658,12 +2658,12 @@ alpha_emit_conditional_move (rtx cmp, enum machine_mode mode)
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 @@ alpha_emit_xfloating_compare (enum rtx_code *pcode, rtx op0, rtx op1)
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;
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index e715cc86422..bab04e4e566 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -25,6 +25,7 @@
;; Uses of UNSPEC in this file:
(define_c_enum "unspec" [
+ UNSPEC_XFLT_COMPARE
UNSPEC_ARG_HOME
UNSPEC_LDGP1
UNSPEC_INSXH
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index b0e278e917c..c76cd6bac52 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -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>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)
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 7f6fa7a3e7c..f76ec6bf284 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,12 @@
+2013-06-06 Tobias Burnus <burnus@net-b.de>
+
+ Backport from mainline
+ 2012-08-27 Tobias Burnus <burnus@net-b.de>
+
+ 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 <janus@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 630816ed401..b8914f3dc43 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -1743,7 +1743,7 @@ gfc_trans_do_while (gfc_code * code)
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);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d156c635db7..d1abd627cc0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,16 @@
+2013-06-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/57568
+ * gcc.c-torture/execute/pr57568.c: New test.
+
+2013-06-06 Tobias Burnus <burnus@net-b.de>
+
+ Backport from mainline
+ 2012-08-27 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/54370
+ * gfortran.dg/do_5.f90: New.
+
2013-06-01 Janus Weil <janus@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr57568.c b/gcc/testsuite/gcc.c-torture/execute/pr57568.c
new file mode 100644
index 00000000000..9a7ddb0c56f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr57568.c
@@ -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;
+}
diff --git a/gcc/testsuite/gfortran.dg/do_5.f90 b/gcc/testsuite/gfortran.dg/do_5.f90
new file mode 100644
index 00000000000..107a35a139d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/do_5.f90
@@ -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
diff --git a/gcc/tlink.c b/gcc/tlink.c
index 67c7086ceb1..0dac1670182 100644
--- a/gcc/tlink.c
+++ b/gcc/tlink.c
@@ -2,7 +2,7 @@
them.
Copyright (C) 1995, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2007, 2008,
- 2009, 2010, 2011 Free Software Foundation, Inc.
+ 2009, 2010, 2011, 2013 Free Software Foundation, Inc.
Contributed by Jason Merrill (jason@cygnus.com).
This file is part of GCC.
@@ -820,18 +820,18 @@ scan_linker_output (const char *fname)
void
do_tlink (char **ld_argv, char **object_lst ATTRIBUTE_UNUSED)
{
- int exit = tlink_execute ("ld", ld_argv, ldout, lderrout);
+ int ret = tlink_execute ("ld", ld_argv, ldout, lderrout);
tlink_init ();
- if (exit)
+ if (ret)
{
int i = 0;
/* Until collect does a better job of figuring out which are object
files, assume that everything on the command line could be. */
if (read_repo_files (ld_argv))
- while (exit && i++ < MAX_ITERATIONS)
+ while (ret && i++ < MAX_ITERATIONS)
{
if (tlink_verbose >= 3)
{
@@ -846,7 +846,7 @@ do_tlink (char **ld_argv, char **object_lst ATTRIBUTE_UNUSED)
break;
if (tlink_verbose)
fprintf (stderr, _("collect: relinking\n"));
- exit = tlink_execute ("ld", ld_argv, ldout, lderrout);
+ ret = tlink_execute ("ld", ld_argv, ldout, lderrout);
}
}
@@ -854,9 +854,9 @@ do_tlink (char **ld_argv, char **object_lst ATTRIBUTE_UNUSED)
unlink (ldout);
dump_file (lderrout, stderr);
unlink (lderrout);
- if (exit)
+ if (ret)
{
- error ("ld returned %d exit status", exit);
- collect_exit (exit);
+ error ("ld returned %d exit status", ret);
+ exit (ret);
}
}
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 94a2f9cdfc1..52beedbe772 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,16 @@
+2013-06-08 Walter Lee <walt@tilera.com>
+
+ Backport from mainline:
+ 2013-06-08 Walter Lee <walt@tilera.com>
+
+ * 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 <rupp@adacore.com>
+
+ * config.host (arm-wrs-vxworks): Configure with other soft float.
+
2013-05-20 Chung-Ju Wu <jasonwucj@gmail.com>
Backport from mainline:
diff --git a/libgcc/config.host b/libgcc/config.host
index f19b49c3e88..5d19c02ac6b 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -328,7 +328,7 @@ alpha*-dec-*vms*)
md_unwind_header=alpha/vms-unwind.h
;;
arm-wrs-vxworks)
- tmake_file="$tmake_file arm/t-arm arm/t-vxworks t-fdpbit"
+ tmake_file="$tmake_file arm/t-arm arm/t-vxworks t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
extra_parts="$extra_parts crti.o crtn.o"
;;
arm*-*-freebsd*)
diff --git a/libgcc/config/tilepro/atomic.h b/libgcc/config/tilepro/atomic.h
index d49d13b3fb0..8d38f0dee9c 100644
--- a/libgcc/config/tilepro/atomic.h
+++ b/libgcc/config/tilepro/atomic.h
@@ -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 <stdint.h>
-#include <features.h>
#ifdef __tilegx__
#include <arch/spr_def.h>
#else
@@ -123,9 +120,9 @@ static __inline __attribute__ ((always_inline))
/* 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 @@ static __inline __attribute__ ((always_inline))
"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 @@ extern int __arch_atomic_error_bad_argument_size (void)
#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 @@ extern int __arch_atomic_error_bad_argument_size (void)
})
#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 @@ extern int __arch_atomic_error_bad_argument_size (void)
/* 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 @@ extern int __arch_atomic_error_bad_argument_size (void)
/* 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 @@ static __inline __attribute__ ((always_inline))
/* 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 @@ static __inline __attribute__ ((always_inline))
__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); \
})