diff options
author | Matthew Gretton-Dann <matthew.gretton-dann@linaro.org> | 2013-06-26 14:16:15 +0100 |
---|---|---|
committer | Matthew Gretton-Dann <matthew.gretton-dann@linaro.org> | 2013-06-26 14:16:15 +0100 |
commit | 6445a3b79fe9da679856910398d661690401e1fe (patch) | |
tree | 502bc61d15c460d1398aeb78dd98a00403298eff /gcc | |
parent | c3f70c7f98c828624877fa45554f7ca6b4fdc1ff (diff) |
Merge from 4.7.4 (svn branches/gcc-4_7-branch rev 200408).
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 42 | ||||
-rw-r--r-- | gcc/DATESTAMP | 2 | ||||
-rw-r--r-- | gcc/collect2.c | 18 | ||||
-rw-r--r-- | gcc/collect2.h | 4 | ||||
-rw-r--r-- | gcc/config/alpha/alpha.c | 21 | ||||
-rw-r--r-- | gcc/config/alpha/alpha.md | 1 | ||||
-rw-r--r-- | gcc/config/i386/i386.md | 2 | ||||
-rw-r--r-- | gcc/fortran/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/fortran/trans-stmt.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr57568.c | 12 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/do_5.f90 | 29 | ||||
-rw-r--r-- | gcc/tlink.c | 16 |
13 files changed, 136 insertions, 35 deletions
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); } } |