aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2013-09-10 12:19:36 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2013-09-10 12:19:36 +0000
commit67849f7dab344fd2a75e4b756b6cb0c789ae05fc (patch)
tree963398fc32818752d270e31df055f9ade8a2f88d /gcc
parentab011fcfdeb4cae7e42eb3d25c1546f77c18caa6 (diff)
parent45993f2d0a21c49556fab1b2b720d6468f189c4f (diff)
Merge from branches/gcc-4_8-branch up to rev 202157.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_8-branch@202439 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog253
-rw-r--r--gcc/ChangeLog.linaro9
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/gcc-interface/trans.c5
-rw-r--r--gcc/asan.c9
-rw-r--r--gcc/c-family/ChangeLog4
-rw-r--r--gcc/c-family/c-ada-spec.c2
-rw-r--r--gcc/config/aarch64/aarch64-linux.h2
-rw-r--r--gcc/config/arm/arm.c4
-rw-r--r--gcc/config/arm/neon.md44
-rw-r--r--gcc/config/i386/driver-i386.c30
-rw-r--r--gcc/config/i386/i386.c71
-rw-r--r--gcc/config/i386/i386.md4
-rw-r--r--gcc/config/i386/sse.md28
-rw-r--r--gcc/config/i386/x86-64.h3
-rw-r--r--gcc/config/pa/pa.md16
-rw-r--r--gcc/config/rs6000/dfp.md11
-rw-r--r--gcc/config/rs6000/rs6000.c15
-rw-r--r--gcc/config/s390/htmintrin.h57
-rw-r--r--gcc/config/s390/htmxlintrin.h182
-rw-r--r--gcc/config/s390/s390intrin.h33
-rw-r--r--gcc/cp/ChangeLog19
-rw-r--r--gcc/cp/cp-tree.h17
-rw-r--r--gcc/cp/cvt.c23
-rw-r--r--gcc/cp/name-lookup.c6
-rw-r--r--gcc/cp/tree.c2
-rw-r--r--gcc/expr.c8
-rw-r--r--gcc/fortran/ChangeLog30
-rw-r--r--gcc/fortran/match.c42
-rw-r--r--gcc/fortran/trans-array.c35
-rw-r--r--gcc/fortran/trans-intrinsic.c10
-rw-r--r--gcc/genoutput.c4
-rw-r--r--gcc/gimple-ssa-strength-reduction.c22
-rw-r--r--gcc/gimple.c7
-rw-r--r--gcc/go/ChangeLog11
-rw-r--r--gcc/go/go-gcc.cc20
-rw-r--r--gcc/go/gofrontend/gogo.cc3
-rw-r--r--gcc/go/gofrontend/parse.cc3
-rw-r--r--gcc/go/gofrontend/statements.cc10
-rw-r--r--gcc/go/gofrontend/types.cc27
-rw-r--r--gcc/go/gofrontend/types.h4
-rw-r--r--gcc/lra-constraints.c4
-rw-r--r--gcc/omp-low.c1
-rw-r--r--gcc/passes.c8
-rw-r--r--gcc/recog.h52
-rw-r--r--gcc/testsuite/ChangeLog148
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr58257.c15
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg5.C30
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr57981.C17
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/ref-qual14.C18
-rw-r--r--gcc/testsuite/g++.dg/opt/pr58006.C22
-rw-r--r--gcc/testsuite/g++.dg/opt/pr58165.C14
-rw-r--r--gcc/testsuite/g++.dg/pr57878.C4
-rw-r--r--gcc/testsuite/g++.dg/template/delete2.C26
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr58164.c8
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr58209.c32
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr58277-1.c102
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr58277-2.c98
-rw-r--r--gcc/testsuite/gcc.dg/asan/pr56417.c9
-rw-r--r--gcc/testsuite/gcc.dg/pr56977.c10
-rw-r--r--gcc/testsuite/gcc.dg/pr57980.c19
-rw-r--r--gcc/testsuite/gcc.dg/pr58145-1.c37
-rw-r--r--gcc/testsuite/gcc.dg/pr58145-2.c51
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr57343.c22
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr57381.c25
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr57417.c12
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr58041.c33
-rw-r--r--gcc/testsuite/gcc.target/arm/lp1189445.c18
-rw-r--r--gcc/testsuite/gcc.target/arm/pr58041.c30
-rw-r--r--gcc/testsuite/gcc.target/i386/movabs-1.c10
-rw-r--r--gcc/testsuite/gcc.target/i386/pr57459.c60
-rw-r--r--gcc/testsuite/gcc.target/i386/pr58218.c5
-rw-r--r--gcc/testsuite/gfortran.dg/inline_sum_5.f9033
-rw-r--r--gcc/testsuite/gfortran.dg/select_type_34.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/transfer_intrinsic_6.f9020
-rw-r--r--gcc/testsuite/gfortran.fortran-torture/execute/pr57396.f9033
-rw-r--r--gcc/testsuite/gnat.dg/loop_optimization16.adb24
-rw-r--r--gcc/testsuite/gnat.dg/loop_optimization16_pkg.adb8
-rw-r--r--gcc/testsuite/gnat.dg/loop_optimization16_pkg.ads7
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug086.go4
-rw-r--r--gcc/tree-affine.c17
-rw-r--r--gcc/tree-call-cdce.c23
-rw-r--r--gcc/tree-parloops.c15
-rw-r--r--gcc/tree-sra.c8
-rw-r--r--gcc/tree-ssa-loop-niter.c20
-rw-r--r--gcc/tree-ssa-sccvn.c15
-rw-r--r--gcc/tree-ssa-strlen.c22
-rw-r--r--gcc/tree-tailcall.c13
89 files changed, 2071 insertions, 233 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 61574ced4f5..ef0bbcd1c81 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,247 @@
+2013-09-01 John David Anglin <danglin@gcc.gnu.org>
+
+ * config/pa/pa.md: Allow "const 0" operand 1 in "scc" insns.
+
+2013-08-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/58277
+ * tree-ssa-strlen.c (strlen_enter_block): If do_invalidate gave up
+ after seeing too many stmts with vdef in between dombb and current
+ bb, invalidate everything.
+
+2013-08-29 Oleg Endo <olegendo@gcc.gnu.org>
+
+ Backport from mainline
+ 2013-08-05 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR other/12081
+ * recog.h (rtx (*insn_gen_fn) (rtx, ...)): Replace typedef with new
+ class insn_gen_fn.
+ * expr.c (move_by_pieces_1, store_by_pieces_2): Replace argument
+ rtx (*) (rtx, ...) with insn_gen_fn.
+ * genoutput.c (output_insn_data): Cast gen_? function pointers to
+ insn_gen_fn::stored_funcptr. Add initializer braces.
+
+ Backport from mainline
+ 2013-08-07 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR other/12081
+ * config/rs6000/rs6000.c (gen_2arg_fn_t): Remove typedef.
+ (rs6000_emit_swdiv_high_precision, rs6000_emit_swdiv_low_precision,
+ rs6000_emit_swrsqrt): Don't cast result of GEN_FCN to gen_2arg_fn_t.
+
+2013-08-29 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2013-05-27 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/57381
+ PR tree-optimization/57417
+ * tree-ssa-sccvn.c (vn_reference_fold_indirect): Fix test
+ for unchanged base.
+ (set_ssa_val_to): Compare addresses using
+ get_addr_base_and_unit_offset.
+
+ PR tree-optimization/57396
+ * tree-affine.c (double_int_constant_multiple_p): Properly
+ return false for val == 0 and div != 0.
+
+ PR tree-optimization/57343
+ * tree-ssa-loop-niter.c (number_of_iterations_ne_max): Do not
+ use multiple_of_p if not TYPE_OVERFLOW_UNDEFINED.
+ (number_of_iterations_cond): Do not build the folded tree.
+
+2013-08-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/58257
+ * omp-low.c (copy_var_decl): Copy over TREE_NO_WARNING flag.
+
+2013-08-28 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2013-06-24 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/56977
+ * passes.c (init_optimization_passes): Move pass_fold_builtins
+ and pass_dce earlier with -Og.
+
+2013-08-28 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2013-08-27 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/driver-i386.c (host_detect_local_cpu): Update
+ Haswell processor detection.
+
+ Backport from mainline
+ 2013-08-27 Christian Widmer <shadow@umbrox.de>
+
+ PR target/57927
+ * config/i386/driver-i386.c (host_detect_local_cpu): Add detection
+ of Ivy Bridge and Haswell processors. Assume core-avx2 for unknown
+ AVX2 capable processors.
+
+2013-08-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/58218
+ * config/i386/x86-64.h (TARGET_SECTION_TYPE_FLAGS): Define.
+ * config/i386/i386.c (x86_64_elf_section_type_flags): New function.
+
+ PR tree-optimization/58209
+ * tree-tailcall.c (find_tail_calls): Give up for pointer result types
+ if m or a is non-NULL.
+
+2013-08-21 Richard Earnshaw <rearnsha@arm.com>
+
+ PR target/56979
+ * arm.c (aapcs_vfp_allocate): Decompose the argument if the
+ suggested mode for the assignment isn't compatible with the
+ registers required.
+
+2013-08-20 Alan Modra <amodra@gmail.com>
+
+ PR target/57865
+ * config/rs6000/rs6000.c (rs6000_emit_prologue): Correct ool_adjust.
+ (rs6000_emit_epilogue): Likewise.
+
+2013-08-19 Peter Bergner <bergner@vnet.ibm.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ Backport from mainline
+ * config/rs6000/dfp.md (*negtd2_fpr): Handle non-overlapping
+ destination and source operands.
+
+2013-08-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/58006
+ * tree-parloops.c (take_address_of): Don't ICE if get_name
+ returns NULL.
+ (eliminate_local_variables_stmt): Remove clobber stmts.
+
+2013-08-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/58164
+ * gimple.c (walk_stmt_load_store_addr_ops): For visit_addr
+ walk gimple_goto_dest of GIMPLE_GOTO.
+
+ PR tree-optimization/58165
+ * tree-call-cdce.c (shrink_wrap_one_built_in_call): If
+ bi_call must be the last stmt in a bb, don't split_block, instead
+ use fallthru edge from it and give up if there is none.
+ Release conds vector when returning early.
+
+2013-08-15 David Given <dg@cowlark.com>
+
+ Backport from mainline
+ 2013-04-26 Vladimir Makarov <vmakarov@redhat.com>
+
+ * lra-constraints.c (process_alt_operands): Use #if HAVE_ATTR_enable
+ instead of #ifdef.
+
+2013-08-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/58145
+ * tree-sra.c (build_ref_for_offset): If prev_base has
+ TREE_THIS_VOLATILE or TREE_SIDE_EFFECTS, propagate it to MEM_REF.
+
+2013-08-14 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config/s390/htmxlintrin.h: Add file missing from last commit.
+ * config/s390/htmintrin.h: Likewise.
+ * config/s390/s390intrin.h: Likewise.
+
+2013-08-14 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2013-08-13 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/sse.md (*sse2_maskmovdqu): Emit addr32 prefix
+ when Pmode != word_mode. Add length_address attribute.
+ (sse3_monitor_<mode>): Merge from sse3_monitor and
+ sse3_monitor64_<mode> insn patterns. Emit addr32 prefix when
+ Pmode != word_mode. Update insn length attribute.
+ * config/i386/i386.c (ix86_option_override_internal): Update
+ ix86_gen_monitor selection for merged sse3_monitor insn.
+
+2013-08-14 Jakub Jelinek <jakub@redhat.com>
+ Alexandre Oliva <aoliva@redhat.com>
+
+ PR target/58067
+ * config/i386/i386.c (ix86_delegitimize_address): For CM_MEDIUM_PIC
+ and CM_LARGE_PIC ix86_cmodel fall thru into the -m32 code, handle
+ there also UNSPEC_PLTOFF.
+
+2013-08-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/56417
+ * asan.c (instrument_strlen_call): Fix typo in comment.
+ Use char * type even for the lhs of POINTER_PLUS_EXPR.
+
+2013-08-13 Vladimir Makarov <vmakarov@redhat.com>
+
+ Backport from mainline
+ 2013-06-06 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-optimization/57459
+ * lra-constraints.c (update_ebb_live_info): Fix typo for operand
+ type when setting live regs.
+
+2013-08-13 Marek Polacek <polacek@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/57980
+ * tree-tailcall.c (process_assignment): Return false
+ when not dealing with integers or floats.
+
+2013-08-12 Andrew Haley <aph@redhat.com>
+
+ Backport from mainline:
+ * 2013-07-11 Andreas Schwab <schwab@suse.de>
+
+ * config/aarch64/aarch64-linux.h (CPP_SPEC): Define.
+
+2013-08-13 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2013-08-12 Perez Read <netfirewall@gmail.com>
+
+ PR target/58132
+ * config/i386/i386.md (*movabs<mode>_1): Add <ptrsize> PTR before
+ operand 0 for intel asm alternative.
+ (*movabs<mode>_2): Ditto for operand 1.
+
+2013-08-09 Zhenqiang Chen <zhenqiang.chen@linaro.org>
+
+ Backport from mainline:
+ 2013-08-09 Zhenqiang Chen <zhenqiang.chen@linaro.org>
+
+ * config/arm/neon.md (vcond): Fix floating-point vector
+ comparisons against 0.
+
+2013-08-08 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline:
+ 2013-08-08 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * config/arm/neon.md (movmisalign<mode>): Disable when we
+ don't allow unaligned accesses.
+ (*movmisalign<mode>_neon_store): Likewise.
+ (*movmisalign<mode>_neon_load): Likewise.
+ (*movmisalign<mode>_neon_store): Likewise.
+ (*movmisalign<mode>_neon_load): Likewise.
+
+2013-08-06 Martin Jambor <mjambor@suse.cz>
+
+ PR middle-end/58041
+ * gimple-ssa-strength-reduction.c (replace_ref): Make sure built
+ MEM_REF has proper alignment information.
+
+2013-08-05 Richard Earnshaw <rearnsha@arm.com>
+
+ PR rtl-optimization/57708
+ * recog.c (peep2_find_free_register): Validate all regs in a
+ multi-reg mode.
+
2013-08-02 Eric Botcazou <ebotcazou@adacore.com>
* config/sparc/sparc.c (sparc_emit_membar_for_model) <SMM_TSO>: Add
@@ -31,8 +275,7 @@
(s390_expand_builtin): New function.
(TARGET_INIT_BUILTINS): Define.
(TARGET_EXPAND_BUILTIN): Define.
- * common/config/s390/s390-common.c (processor_flags_table): Add
- PF_TX.
+ * common/config/s390/s390-common.c (processor_flags_table): Add PF_TX.
* config/s390/predicates.md (s390_comparison): Handle CCRAWmode.
(s390_alc_comparison): Likewise.
* config/s390/s390-modes.def: Add CCRAWmode.
@@ -73,7 +316,7 @@
2013-08-01 Ganesh Gopalasubramanian <Ganesh.Gopalasubramanian@amd.com>
Backport from mainline
- 2013-05-13 Ganesh Gopalasubramanian
+ 2013-05-13 Ganesh Gopalasubramanian
<Ganesh.Gopalasubramanian@amd.com>
* config/i386/i386.c (processor_target_table): Modified default
@@ -130,7 +373,7 @@
(ix86_save_reg): If the function contains a nonlocal label, save the
PIC base reg.
* config/darwin-protos.h (machopic_should_output_picbase_label): New.
- * gcc/config/darwin.c (emitted_pic_label_num): New GTY.
+ * gcc/config/darwin.c (emitted_pic_label_num): New GTY.
(update_pic_label_number_if_needed): New.
(machopic_output_function_base_name): Adjust for nonlocal receiver
case.
@@ -212,7 +455,7 @@
2013-07-10 Georg-Johann Lay <avr@gjlay.de>
Backport from 2013-07-10 trunk r200870.
-
+
PR target/57506
* config/avr/avr-mcus.def (atmega16hva, atmega16hva2, atmega16hvb)
(atmega16m1, atmega16u4, atmega32a, atmega32c1, atmega32hvb)
diff --git a/gcc/ChangeLog.linaro b/gcc/ChangeLog.linaro
index d297f840f5c..1adc3d39e83 100644
--- a/gcc/ChangeLog.linaro
+++ b/gcc/ChangeLog.linaro
@@ -479,15 +479,6 @@
* arm.md (mulhi3): New expand pattern.
-2013-08-26 Kugan Vivekanandarajah <kuganv@linaro.org>
-
- Backport from trunk r201501.
- 2013-08-05 Richard Earnshaw <rearnsha@arm.com>
-
- PR rtl-optimization/57708
- * recog.c (peep2_find_free_register): Validate all regs in a
- multi-reg mode.
-
2013-08-16 Christophe Lyon <christophe.lyon@linaro.org>
* LINARO-VERSION: Bump version.
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 536e3b3bccc..15420bcb17c 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20130805
+20130902
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index bdb70ddb8c0..edecddf9118 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-13 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/trans.c (can_equal_min_or_max_val_p): Be prepared for
+ values outside of the range of the type.
+
2013-06-13 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/ada-tree.h (DECL_BY_DOUBLE_REF_P): Delete.
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index cd78bf33a37..256827dbe16 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -2267,7 +2267,10 @@ can_equal_min_or_max_val_p (tree val, tree type, bool max)
if (TREE_CODE (val) != INTEGER_CST)
return true;
- return tree_int_cst_equal (val, min_or_max_val) == 1;
+ if (max)
+ return tree_int_cst_lt (val, min_or_max_val) == 0;
+ else
+ return tree_int_cst_lt (min_or_max_val, val) == 0;
}
/* Return true if VAL (of type TYPE) can equal the minimum value of TYPE.
diff --git a/gcc/asan.c b/gcc/asan.c
index 52a2dbc5dfd..d68579b2e5e 100644
--- a/gcc/asan.c
+++ b/gcc/asan.c
@@ -1675,7 +1675,7 @@ instrument_mem_region_access (tree base, tree len,
access to the last byte of the argument; it uses the result of the
call to deduce the offset of that last byte.
- Upon completion, iff the call has actullay been instrumented, this
+ Upon completion, iff the call has actually been instrumented, this
function returns TRUE and *ITER points to the statement logically
following the built-in strlen function call *ITER was initially
pointing to. Otherwise, the function returns FALSE and *ITER
@@ -1706,10 +1706,10 @@ instrument_strlen_call (gimple_stmt_iterator *iter)
/* Instrument the access to the first byte of str_arg. i.e:
_1 = str_arg; instrument (_1); */
+ tree cptr_type = build_pointer_type (char_type_node);
gimple str_arg_ssa =
gimple_build_assign_with_ops (NOP_EXPR,
- make_ssa_name (build_pointer_type
- (char_type_node), NULL),
+ make_ssa_name (cptr_type, NULL),
str_arg, NULL);
gimple_set_location (str_arg_ssa, loc);
gimple_stmt_iterator gsi = *iter;
@@ -1728,8 +1728,7 @@ instrument_strlen_call (gimple_stmt_iterator *iter)
pointer_plus expr: (_1 + len). */
gimple stmt =
gimple_build_assign_with_ops (POINTER_PLUS_EXPR,
- make_ssa_name (TREE_TYPE (str_arg),
- NULL),
+ make_ssa_name (cptr_type, NULL),
gimple_assign_lhs (str_arg_ssa),
len);
gimple_set_location (stmt, loc);
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 3acbfe39292..dd917ae1cca 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,7 @@
+2013-08-09 Arnaud Charlet <charlet@adacore.com>
+
+ * c-ada-spec.c (print_ada_declaration): Prevent accessing null asm name
+
2013-05-31 Release Manager
* GCC 4.8.1 released.
diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c
index 21cbfe94fba..2d6ce14ca48 100644
--- a/gcc/c-family/c-ada-spec.c
+++ b/gcc/c-family/c-ada-spec.c
@@ -2900,7 +2900,7 @@ print_ada_declaration (pretty_printer *buffer, tree t, tree type,
pp_string (buffer, " -- ");
dump_sloc (buffer, t);
- if (is_abstract)
+ if (is_abstract || !DECL_ASSEMBLER_NAME (t))
return 1;
newline_and_indent (buffer, spc);
diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
index e914ed27f1f..83efad447f1 100644
--- a/gcc/config/aarch64/aarch64-linux.h
+++ b/gcc/config/aarch64/aarch64-linux.h
@@ -23,6 +23,8 @@
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64.so.1"
+#define CPP_SPEC "%{pthread:-D_REENTRANT}"
+
#define LINUX_TARGET_LINK_SPEC "%{h*} \
%{static:-Bstatic} \
%{shared:-shared} \
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index fde7d6fe6fe..f90a6374638 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -4531,7 +4531,9 @@ aapcs_vfp_allocate (CUMULATIVE_ARGS *pcum, enum machine_mode mode,
if (((pcum->aapcs_vfp_regs_free >> regno) & mask) == mask)
{
pcum->aapcs_vfp_reg_alloc = mask << regno;
- if (mode == BLKmode || (mode == TImode && !TARGET_NEON))
+ if (mode == BLKmode
+ || (mode == TImode && ! TARGET_NEON)
+ || ! arm_hard_regno_mode_ok (FIRST_VFP_REGNUM + regno, mode))
{
int i;
int rcount = pcum->aapcs_vfp_rcount;
diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md
index 8f7f87b4a90..d4445b57124 100644
--- a/gcc/config/arm/neon.md
+++ b/gcc/config/arm/neon.md
@@ -242,7 +242,7 @@
[(set (match_operand:VDQX 0 "neon_struct_or_register_operand")
(unspec:VDQX [(match_operand:VDQX 1 "neon_struct_or_register_operand")]
UNSPEC_MISALIGNED_ACCESS))]
- "TARGET_NEON && !BYTES_BIG_ENDIAN"
+ "TARGET_NEON && !BYTES_BIG_ENDIAN && unaligned_access"
{
/* This pattern is not permitted to fail during expansion: if both arguments
are non-registers (e.g. memory := constant, which can be created by the
@@ -256,7 +256,7 @@
[(set (match_operand:VDX 0 "neon_struct_operand" "=Um")
(unspec:VDX [(match_operand:VDX 1 "s_register_operand" " w")]
UNSPEC_MISALIGNED_ACCESS))]
- "TARGET_NEON && !BYTES_BIG_ENDIAN"
+ "TARGET_NEON && !BYTES_BIG_ENDIAN && unaligned_access"
"vst1.<V_sz_elem>\t{%P1}, %A0"
[(set_attr "neon_type" "neon_vst1_1_2_regs_vst2_2_regs")])
@@ -264,7 +264,7 @@
[(set (match_operand:VDX 0 "s_register_operand" "=w")
(unspec:VDX [(match_operand:VDX 1 "neon_struct_operand" " Um")]
UNSPEC_MISALIGNED_ACCESS))]
- "TARGET_NEON && !BYTES_BIG_ENDIAN"
+ "TARGET_NEON && !BYTES_BIG_ENDIAN && unaligned_access"
"vld1.<V_sz_elem>\t{%P0}, %A1"
[(set_attr "neon_type" "neon_vld1_1_2_regs")])
@@ -272,7 +272,7 @@
[(set (match_operand:VQX 0 "neon_struct_operand" "=Um")
(unspec:VQX [(match_operand:VQX 1 "s_register_operand" " w")]
UNSPEC_MISALIGNED_ACCESS))]
- "TARGET_NEON && !BYTES_BIG_ENDIAN"
+ "TARGET_NEON && !BYTES_BIG_ENDIAN && unaligned_access"
"vst1.<V_sz_elem>\t{%q1}, %A0"
[(set_attr "neon_type" "neon_vst1_1_2_regs_vst2_2_regs")])
@@ -280,7 +280,7 @@
[(set (match_operand:VQX 0 "s_register_operand" "=w")
(unspec:VQX [(match_operand:VQX 1 "neon_struct_operand" " Um")]
UNSPEC_MISALIGNED_ACCESS))]
- "TARGET_NEON && !BYTES_BIG_ENDIAN"
+ "TARGET_NEON && !BYTES_BIG_ENDIAN && unaligned_access"
"vld1.<V_sz_elem>\t{%q0}, %A1"
[(set_attr "neon_type" "neon_vld1_1_2_regs")])
@@ -1669,6 +1669,7 @@
? 3 : 1;
rtx magic_rtx = GEN_INT (magic_word);
int inverse = 0;
+ int use_zero_form = 0;
int swap_bsl_operands = 0;
rtx mask = gen_reg_rtx (<V_cmp_result>mode);
rtx tmp = gen_reg_rtx (<V_cmp_result>mode);
@@ -1679,12 +1680,16 @@
switch (GET_CODE (operands[3]))
{
case GE:
+ case GT:
case LE:
+ case LT:
case EQ:
- if (!REG_P (operands[5])
- && (operands[5] != CONST0_RTX (<MODE>mode)))
- operands[5] = force_reg (<MODE>mode, operands[5]);
- break;
+ if (operands[5] == CONST0_RTX (<MODE>mode))
+ {
+ use_zero_form = 1;
+ break;
+ }
+ /* Fall through. */
default:
if (!REG_P (operands[5]))
operands[5] = force_reg (<MODE>mode, operands[5]);
@@ -1735,7 +1740,26 @@
a GT b -> a GT b
a LE b -> b GE a
a LT b -> b GT a
- a EQ b -> a EQ b */
+ a EQ b -> a EQ b
+ Note that there also exist direct comparison against 0 forms,
+ so catch those as a special case. */
+ if (use_zero_form)
+ {
+ inverse = 0;
+ switch (GET_CODE (operands[3]))
+ {
+ case LT:
+ base_comparison = gen_neon_vclt<mode>;
+ break;
+ case LE:
+ base_comparison = gen_neon_vcle<mode>;
+ break;
+ default:
+ /* Do nothing, other zero form cases already have the correct
+ base_comparison. */
+ break;
+ }
+ }
if (!inverse)
emit_insn (base_comparison (mask, operands[4], operands[5], magic_rtx));
diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c
index 55c389a16ee..76375849556 100644
--- a/gcc/config/i386/driver-i386.c
+++ b/gcc/config/i386/driver-i386.c
@@ -638,13 +638,18 @@ const char *host_detect_local_cpu (int argc, const char **argv)
/* Atom. */
cpu = "atom";
break;
+ case 0x0f:
+ /* Merom. */
+ case 0x17:
+ case 0x1d:
+ /* Penryn. */
+ cpu = "core2";
+ break;
case 0x1a:
case 0x1e:
case 0x1f:
case 0x2e:
/* Nehalem. */
- cpu = "corei7";
- break;
case 0x25:
case 0x2c:
case 0x2f:
@@ -656,20 +661,25 @@ const char *host_detect_local_cpu (int argc, const char **argv)
/* Sandy Bridge. */
cpu = "corei7-avx";
break;
- case 0x17:
- case 0x1d:
- /* Penryn. */
- cpu = "core2";
+ case 0x3a:
+ case 0x3e:
+ /* Ivy Bridge. */
+ cpu = "core-avx-i";
break;
- case 0x0f:
- /* Merom. */
- cpu = "core2";
+ case 0x3c:
+ case 0x45:
+ case 0x46:
+ /* Haswell. */
+ cpu = "core-avx2";
break;
default:
if (arch)
{
/* This is unknown family 0x6 CPU. */
- if (has_avx)
+ if (has_avx2)
+ /* Assume Haswell. */
+ cpu = "core-avx2";
+ else if (has_avx)
/* Assume Sandy Bridge. */
cpu = "corei7-avx";
else if (has_sse4_2)
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 5dab4f04abc..8475883823b 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -3768,24 +3768,19 @@ ix86_option_override_internal (bool main_args_p)
ix86_gen_leave = gen_leave_rex64;
if (Pmode == DImode)
{
- ix86_gen_monitor = gen_sse3_monitor64_di;
ix86_gen_tls_global_dynamic_64 = gen_tls_global_dynamic_64_di;
ix86_gen_tls_local_dynamic_base_64
= gen_tls_local_dynamic_base_64_di;
}
else
{
- ix86_gen_monitor = gen_sse3_monitor64_si;
ix86_gen_tls_global_dynamic_64 = gen_tls_global_dynamic_64_si;
ix86_gen_tls_local_dynamic_base_64
= gen_tls_local_dynamic_base_64_si;
}
}
else
- {
- ix86_gen_leave = gen_leave;
- ix86_gen_monitor = gen_sse3_monitor;
- }
+ ix86_gen_leave = gen_leave;
if (Pmode == DImode)
{
@@ -3797,6 +3792,7 @@ ix86_option_override_internal (bool main_args_p)
ix86_gen_allocate_stack_worker = gen_allocate_stack_worker_probe_di;
ix86_gen_adjust_stack_and_probe = gen_adjust_stack_and_probedi;
ix86_gen_probe_stack_range = gen_probe_stack_rangedi;
+ ix86_gen_monitor = gen_sse3_monitor_di;
}
else
{
@@ -3808,6 +3804,7 @@ ix86_option_override_internal (bool main_args_p)
ix86_gen_allocate_stack_worker = gen_allocate_stack_worker_probe_si;
ix86_gen_adjust_stack_and_probe = gen_adjust_stack_and_probesi;
ix86_gen_probe_stack_range = gen_probe_stack_rangesi;
+ ix86_gen_monitor = gen_sse3_monitor_si;
}
#ifdef USE_IX86_CLD
@@ -4691,6 +4688,28 @@ x86_64_elf_select_section (tree decl, int reloc,
return default_elf_select_section (decl, reloc, align);
}
+/* Select a set of attributes for section NAME based on the properties
+ of DECL and whether or not RELOC indicates that DECL's initializer
+ might contain runtime relocations. */
+
+static unsigned int ATTRIBUTE_UNUSED
+x86_64_elf_section_type_flags (tree decl, const char *name, int reloc)
+{
+ unsigned int flags = default_section_type_flags (decl, name, reloc);
+
+ if (decl == NULL_TREE
+ && (strcmp (name, ".ldata.rel.ro") == 0
+ || strcmp (name, ".ldata.rel.ro.local") == 0))
+ flags |= SECTION_RELRO;
+
+ if (strcmp (name, ".lbss") == 0
+ || strncmp (name, ".lbss.", 5) == 0
+ || strncmp (name, ".gnu.linkonce.lb.", 16) == 0)
+ flags |= SECTION_BSS;
+
+ return flags;
+}
+
/* Build up a unique section name, expressed as a
STRING_CST node, and assign it to DECL_SECTION_NAME (decl).
RELOC indicates whether the initial value of EXP requires
@@ -13598,21 +13617,29 @@ ix86_delegitimize_address (rtx x)
x = replace_equiv_address_nv (orig_x, x);
return x;
}
- if (GET_CODE (x) != CONST
- || GET_CODE (XEXP (x, 0)) != UNSPEC
- || (XINT (XEXP (x, 0), 1) != UNSPEC_GOTPCREL
- && XINT (XEXP (x, 0), 1) != UNSPEC_PCREL)
- || (!MEM_P (orig_x) && XINT (XEXP (x, 0), 1) != UNSPEC_PCREL))
- return ix86_delegitimize_tls_address (orig_x);
- x = XVECEXP (XEXP (x, 0), 0, 0);
- if (GET_MODE (orig_x) != GET_MODE (x) && MEM_P (orig_x))
+
+ if (GET_CODE (x) == CONST
+ && GET_CODE (XEXP (x, 0)) == UNSPEC
+ && (XINT (XEXP (x, 0), 1) == UNSPEC_GOTPCREL
+ || XINT (XEXP (x, 0), 1) == UNSPEC_PCREL)
+ && (MEM_P (orig_x) || XINT (XEXP (x, 0), 1) == UNSPEC_PCREL))
{
- x = simplify_gen_subreg (GET_MODE (orig_x), x,
- GET_MODE (x), 0);
- if (x == NULL_RTX)
- return orig_x;
+ x = XVECEXP (XEXP (x, 0), 0, 0);
+ if (GET_MODE (orig_x) != GET_MODE (x) && MEM_P (orig_x))
+ {
+ x = simplify_gen_subreg (GET_MODE (orig_x), x,
+ GET_MODE (x), 0);
+ if (x == NULL_RTX)
+ return orig_x;
+ }
+ return x;
}
- return x;
+
+ if (ix86_cmodel != CM_MEDIUM_PIC && ix86_cmodel != CM_LARGE_PIC)
+ return ix86_delegitimize_tls_address (orig_x);
+
+ /* Fall thru into the code shared with -m32 for -mcmodel=large -fpic
+ and -mcmodel=medium -fpic. */
}
if (GET_CODE (x) != PLUS
@@ -13649,10 +13676,12 @@ ix86_delegitimize_address (rtx x)
if (GET_CODE (x) == UNSPEC
&& ((XINT (x, 1) == UNSPEC_GOT && MEM_P (orig_x) && !addend)
- || (XINT (x, 1) == UNSPEC_GOTOFF && !MEM_P (orig_x))))
+ || (XINT (x, 1) == UNSPEC_GOTOFF && !MEM_P (orig_x))
+ || (XINT (x, 1) == UNSPEC_PLTOFF && ix86_cmodel == CM_LARGE_PIC
+ && !MEM_P (orig_x) && !addend)))
result = XVECEXP (x, 0, 0);
- if (TARGET_MACHO && darwin_local_data_pic (x)
+ if (!TARGET_64BIT && TARGET_MACHO && darwin_local_data_pic (x)
&& !MEM_P (orig_x))
result = XVECEXP (x, 0, 0);
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 57e0dcacdc0..4d5b2872d09 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -2316,7 +2316,7 @@
"TARGET_LP64 && ix86_check_movabs (insn, 0)"
"@
movabs{<imodesuffix>}\t{%1, %P0|[%P0], %1}
- mov{<imodesuffix>}\t{%1, %a0|%a0, %1}"
+ mov{<imodesuffix>}\t{%1, %a0|<iptrsize> PTR %a0, %1}"
[(set_attr "type" "imov")
(set_attr "modrm" "0,*")
(set_attr "length_address" "8,0")
@@ -2330,7 +2330,7 @@
"TARGET_LP64 && ix86_check_movabs (insn, 1)"
"@
movabs{<imodesuffix>}\t{%P1, %0|%0, [%P1]}
- mov{<imodesuffix>}\t{%a1, %0|%0, %a1}"
+ mov{<imodesuffix>}\t{%a1, %0|%0, <iptrsize> PTR %a1}"
[(set_attr "type" "imov")
(set_attr "modrm" "0,*")
(set_attr "length_address" "8,0")
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 4f9bd658e2d..05cf7f9a05e 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -7758,9 +7758,17 @@
(mem:V16QI (match_dup 0))]
UNSPEC_MASKMOV))]
"TARGET_SSE2"
- "%vmaskmovdqu\t{%2, %1|%1, %2}"
+{
+ /* We can't use %^ here due to ASM_OUTPUT_OPCODE processing
+ that requires %v to be at the beginning of the opcode name. */
+ if (Pmode != word_mode)
+ fputs ("\taddr32", asm_out_file);
+ return "%vmaskmovdqu\t{%2, %1|%1, %2}";
+}
[(set_attr "type" "ssemov")
(set_attr "prefix_data16" "1")
+ (set (attr "length_address")
+ (symbol_ref ("Pmode != word_mode")))
;; The implicit %rdi operand confuses default length_vex computation.
(set (attr "length_vex")
(symbol_ref ("3 + REX_SSE_REGNO_P (REGNO (operands[2]))")))
@@ -7808,26 +7816,18 @@
"mwait"
[(set_attr "length" "3")])
-(define_insn "sse3_monitor"
- [(unspec_volatile [(match_operand:SI 0 "register_operand" "a")
- (match_operand:SI 1 "register_operand" "c")
- (match_operand:SI 2 "register_operand" "d")]
- UNSPECV_MONITOR)]
- "TARGET_SSE3 && !TARGET_64BIT"
- "monitor\t%0, %1, %2"
- [(set_attr "length" "3")])
-
-(define_insn "sse3_monitor64_<mode>"
+(define_insn "sse3_monitor_<mode>"
[(unspec_volatile [(match_operand:P 0 "register_operand" "a")
(match_operand:SI 1 "register_operand" "c")
(match_operand:SI 2 "register_operand" "d")]
UNSPECV_MONITOR)]
- "TARGET_SSE3 && TARGET_64BIT"
+ "TARGET_SSE3"
;; 64bit version is "monitor %rax,%rcx,%rdx". But only lower 32bits in
;; RCX and RDX are used. Since 32bit register operands are implicitly
;; zero extended to 64bit, we only need to set up 32bit registers.
- "monitor"
- [(set_attr "length" "3")])
+ "%^monitor"
+ [(set (attr "length")
+ (symbol_ref ("(Pmode != word_mode) + 3")))])
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
diff --git a/gcc/config/i386/x86-64.h b/gcc/config/i386/x86-64.h
index c103c5865a3..66f96d98e2e 100644
--- a/gcc/config/i386/x86-64.h
+++ b/gcc/config/i386/x86-64.h
@@ -103,3 +103,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#undef TARGET_ASM_UNIQUE_SECTION
#define TARGET_ASM_UNIQUE_SECTION x86_64_elf_unique_section
+
+#undef TARGET_SECTION_TYPE_FLAGS
+#define TARGET_SECTION_TYPE_FLAGS x86_64_elf_section_type_flags
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 5e6d5652e71..bcafc5c5329 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -833,7 +833,7 @@
(define_insn "scc"
[(set (match_operand:SI 0 "register_operand" "=r")
(match_operator:SI 3 "comparison_operator"
- [(match_operand:SI 1 "register_operand" "r")
+ [(match_operand:SI 1 "reg_or_0_operand" "rM")
(match_operand:SI 2 "arith11_operand" "rI")]))]
""
"{com%I2clr|cmp%I2clr},%B3 %2,%1,%0\;ldi 1,%0"
@@ -843,7 +843,7 @@
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=r")
(match_operator:DI 3 "comparison_operator"
- [(match_operand:DI 1 "register_operand" "r")
+ [(match_operand:DI 1 "reg_or_0_operand" "rM")
(match_operand:DI 2 "arith11_operand" "rI")]))]
"TARGET_64BIT"
"cmp%I2clr,*%B3 %2,%1,%0\;ldi 1,%0"
@@ -853,10 +853,10 @@
(define_insn "iorscc"
[(set (match_operand:SI 0 "register_operand" "=r")
(ior:SI (match_operator:SI 3 "comparison_operator"
- [(match_operand:SI 1 "register_operand" "r")
+ [(match_operand:SI 1 "reg_or_0_operand" "rM")
(match_operand:SI 2 "arith11_operand" "rI")])
(match_operator:SI 6 "comparison_operator"
- [(match_operand:SI 4 "register_operand" "r")
+ [(match_operand:SI 4 "reg_or_0_operand" "rM")
(match_operand:SI 5 "arith11_operand" "rI")])))]
""
"{com%I2clr|cmp%I2clr},%S3 %2,%1,%%r0\;{com%I5clr|cmp%I5clr},%B6 %5,%4,%0\;ldi 1,%0"
@@ -866,10 +866,10 @@
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=r")
(ior:DI (match_operator:DI 3 "comparison_operator"
- [(match_operand:DI 1 "register_operand" "r")
+ [(match_operand:DI 1 "reg_or_0_operand" "rM")
(match_operand:DI 2 "arith11_operand" "rI")])
(match_operator:DI 6 "comparison_operator"
- [(match_operand:DI 4 "register_operand" "r")
+ [(match_operand:DI 4 "reg_or_0_operand" "rM")
(match_operand:DI 5 "arith11_operand" "rI")])))]
"TARGET_64BIT"
"cmp%I2clr,*%S3 %2,%1,%%r0\;cmp%I5clr,*%B6 %5,%4,%0\;ldi 1,%0"
@@ -881,7 +881,7 @@
(define_insn "negscc"
[(set (match_operand:SI 0 "register_operand" "=r")
(neg:SI (match_operator:SI 3 "comparison_operator"
- [(match_operand:SI 1 "register_operand" "r")
+ [(match_operand:SI 1 "reg_or_0_operand" "rM")
(match_operand:SI 2 "arith11_operand" "rI")])))]
""
"{com%I2clr|cmp%I2clr},%B3 %2,%1,%0\;ldi -1,%0"
@@ -891,7 +891,7 @@
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=r")
(neg:DI (match_operator:DI 3 "comparison_operator"
- [(match_operand:DI 1 "register_operand" "r")
+ [(match_operand:DI 1 "reg_or_0_operand" "rM")
(match_operand:DI 2 "arith11_operand" "rI")])))]
"TARGET_64BIT"
"cmp%I2clr,*%B3 %2,%1,%0\;ldi -1,%0"
diff --git a/gcc/config/rs6000/dfp.md b/gcc/config/rs6000/dfp.md
index f73e115e342..040bae49001 100644
--- a/gcc/config/rs6000/dfp.md
+++ b/gcc/config/rs6000/dfp.md
@@ -394,11 +394,14 @@
"")
(define_insn "*negtd2_fpr"
- [(set (match_operand:TD 0 "gpc_reg_operand" "=d")
- (neg:TD (match_operand:TD 1 "gpc_reg_operand" "d")))]
+ [(set (match_operand:TD 0 "gpc_reg_operand" "=d,d")
+ (neg:TD (match_operand:TD 1 "gpc_reg_operand" "0,d")))]
"TARGET_HARD_FLOAT && TARGET_FPRS"
- "fneg %0,%1"
- [(set_attr "type" "fp")])
+ "@
+ fneg %0,%1
+ fneg %0,%1\;fmr %L0,%L1"
+ [(set_attr "type" "fp")
+ (set_attr "length" "4,8")])
(define_expand "abstd2"
[(set (match_operand:TD 0 "gpc_reg_operand" "")
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index d92248ed404..e22c33dc37e 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -284,9 +284,6 @@ static struct
{ "rsqrtd", (RECIP_DF_RSQRT | RECIP_V2DF_RSQRT) },
};
-/* 2 argument gen function typedef. */
-typedef rtx (*gen_2arg_fn_t) (rtx, rtx, rtx);
-
/* Pointer to function (in rs6000-c.c) that can define or undefine target
macros that have changed. Languages that don't support the preprocessor
don't link in rs6000-c.c, so we can't call it directly. */
@@ -19960,8 +19957,7 @@ rs6000_emit_prologue (void)
HOST_WIDE_INT offset;
if (!(strategy & SAVE_INLINE_GPRS))
- ool_adjust = 8 * (info->first_gp_reg_save
- - (FIRST_SAVRES_REGISTER + 1));
+ ool_adjust = 8 * (info->first_gp_reg_save - FIRST_SAVED_GP_REGNO);
offset = info->spe_gp_save_offset + frame_off - ool_adjust;
spe_save_area_ptr = gen_rtx_REG (Pmode, 11);
save_off = frame_off - offset;
@@ -21203,8 +21199,7 @@ rs6000_emit_epilogue (int sibcall)
anew to every function. */
if (!restoring_GPRs_inline)
- ool_adjust = 8 * (info->first_gp_reg_save
- - (FIRST_SAVRES_REGISTER + 1));
+ ool_adjust = 8 * (info->first_gp_reg_save - FIRST_SAVED_GP_REGNO);
frame_reg_rtx = gen_rtx_REG (Pmode, 11);
emit_insn (gen_addsi3 (frame_reg_rtx, old_frame_reg_rtx,
GEN_INT (info->spe_gp_save_offset
@@ -26659,7 +26654,7 @@ rs6000_emit_swdiv_high_precision (rtx dst, rtx n, rtx d)
enum machine_mode mode = GET_MODE (dst);
rtx x0, e0, e1, y1, u0, v0;
enum insn_code code = optab_handler (smul_optab, mode);
- gen_2arg_fn_t gen_mul = (gen_2arg_fn_t) GEN_FCN (code);
+ insn_gen_fn gen_mul = GEN_FCN (code);
rtx one = rs6000_load_constant_and_splat (mode, dconst1);
gcc_assert (code != CODE_FOR_nothing);
@@ -26697,7 +26692,7 @@ rs6000_emit_swdiv_low_precision (rtx dst, rtx n, rtx d)
enum machine_mode mode = GET_MODE (dst);
rtx x0, e0, e1, e2, y1, y2, y3, u0, v0, one;
enum insn_code code = optab_handler (smul_optab, mode);
- gen_2arg_fn_t gen_mul = (gen_2arg_fn_t) GEN_FCN (code);
+ insn_gen_fn gen_mul = GEN_FCN (code);
gcc_assert (code != CODE_FOR_nothing);
@@ -26768,7 +26763,7 @@ rs6000_emit_swrsqrt (rtx dst, rtx src)
int i;
rtx halfthree;
enum insn_code code = optab_handler (smul_optab, mode);
- gen_2arg_fn_t gen_mul = (gen_2arg_fn_t) GEN_FCN (code);
+ insn_gen_fn gen_mul = GEN_FCN (code);
gcc_assert (code != CODE_FOR_nothing);
diff --git a/gcc/config/s390/htmintrin.h b/gcc/config/s390/htmintrin.h
new file mode 100644
index 00000000000..7aaa9f5bf7c
--- /dev/null
+++ b/gcc/config/s390/htmintrin.h
@@ -0,0 +1,57 @@
+/* GNU compiler hardware transactional execution intrinsics
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ Contributed by Andreas Krebbel (Andreas.Krebbel@de.ibm.com)
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef _HTMINTRIN_H
+#define _HTMINTRIN_H
+
+
+/* Condition codes generated by tbegin */
+#define _HTM_TBEGIN_STARTED 0
+#define _HTM_TBEGIN_INDETERMINATE 1
+#define _HTM_TBEGIN_TRANSIENT 2
+#define _HTM_TBEGIN_PERSISTENT 3
+
+/* The abort codes below this threshold are reserved for machine
+ use. */
+#define _HTM_FIRST_USER_ABORT_CODE 256
+
+/* The transaction diagnostic block is it is defined in the Principles
+ of Operation chapter 5-91. */
+
+struct __htm_tdb {
+ unsigned char format; /* 0 */
+ unsigned char flags;
+ unsigned char reserved1[4];
+ unsigned short nesting_depth;
+ unsigned long long abort_code; /* 8 */
+ unsigned long long conflict_token; /* 16 */
+ unsigned long long atia; /* 24 */
+ unsigned char eaid; /* 32 */
+ unsigned char dxc;
+ unsigned char reserved2[2];
+ unsigned int program_int_id;
+ unsigned long long exception_id; /* 40 */
+ unsigned long long bea; /* 48 */
+ unsigned char reserved3[72]; /* 56 */
+ unsigned long long gprs[16]; /* 128 */
+} __attribute__((__packed__, __aligned__ (8)));
+
+
+#endif /* _HTMINTRIN_H */
diff --git a/gcc/config/s390/htmxlintrin.h b/gcc/config/s390/htmxlintrin.h
new file mode 100644
index 00000000000..bb142195b2b
--- /dev/null
+++ b/gcc/config/s390/htmxlintrin.h
@@ -0,0 +1,182 @@
+/* XL compiler hardware transactional execution intrinsics
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ Contributed by Andreas Krebbel (Andreas.Krebbel@de.ibm.com)
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef _HTMXLINTRIN_H
+#define _HTMXLINTRIN_H
+
+#include <stdint.h>
+
+#include <htmintrin.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* These intrinsics are being made available for compatibility with
+ the IBM XL compiler. For documentation please see the "z/OS XL
+ C/C++ Programming Guide" publically available on the web. */
+
+extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__TM_simple_begin ()
+{
+ return __builtin_tbegin_nofloat (0);
+}
+
+extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__TM_begin (void* const tdb)
+{
+ return __builtin_tbegin_nofloat (tdb);
+}
+
+extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__TM_end ()
+{
+ return __builtin_tend ();
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__TM_abort ()
+{
+ return __builtin_tabort (_HTM_FIRST_USER_ABORT_CODE);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__TM_named_abort (unsigned char const code)
+{
+ return __builtin_tabort ((int)_HTM_FIRST_USER_ABORT_CODE + code);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__TM_non_transactional_store (void* const addr, long long const value)
+{
+ __builtin_non_tx_store ((uint64_t*)addr, (uint64_t)value);
+}
+
+extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__TM_nesting_depth (void* const tdb_ptr)
+{
+ int depth = __builtin_tx_nesting_depth ();
+ struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr;
+
+ if (depth != 0)
+ return depth;
+
+ if (tdb->format == 0)
+ return 0;
+ return tdb->nesting_depth;
+}
+
+/* Transaction failure diagnostics */
+
+extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__TM_is_user_abort (void* const tdb_ptr)
+{
+ struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr;
+
+ if (tdb->format == 0)
+ return 0;
+
+ return !!(tdb->abort_code >= _HTM_FIRST_USER_ABORT_CODE);
+}
+
+extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__TM_is_named_user_abort (void* const tdb_ptr, unsigned char* code)
+{
+ struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr;
+
+ if (tdb->format == 0)
+ return 0;
+
+ if (tdb->abort_code >= _HTM_FIRST_USER_ABORT_CODE)
+ {
+ *code = tdb->abort_code - _HTM_FIRST_USER_ABORT_CODE;
+ return 1;
+ }
+ return 0;
+}
+
+extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__TM_is_illegal (void* const tdb_ptr)
+{
+ struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr;
+
+ return (tdb->format == 0
+ && (tdb->abort_code == 4 /* unfiltered program interruption */
+ || tdb->abort_code == 11 /* restricted instruction */));
+}
+
+extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__TM_is_footprint_exceeded (void* const tdb_ptr)
+{
+ struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr;
+
+ return (tdb->format == 0
+ && (tdb->abort_code == 7 /* fetch overflow */
+ || tdb->abort_code == 8 /* store overflow */));
+}
+
+extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__TM_is_nested_too_deep (void* const tdb_ptr)
+{
+ struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr;
+
+ return tdb->format == 0 && tdb->abort_code == 13; /* depth exceeded */
+}
+
+extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__TM_is_conflict (void* const tdb_ptr)
+{
+ struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr;
+
+ return (tdb->format == 0
+ && (tdb->abort_code == 9 /* fetch conflict */
+ || tdb->abort_code == 10 /* store conflict */));
+}
+
+extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__TM_is_failure_persistent (long const result)
+{
+ return result == _HTM_TBEGIN_PERSISTENT;
+}
+
+extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__TM_failure_address (void* const tdb_ptr)
+{
+ struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr;
+#ifdef __s390x__
+ return tdb->atia;
+#else
+ return tdb->atia & 0xffffffff;
+#endif
+}
+
+extern __inline long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+__TM_failure_code (void* const tdb_ptr)
+{
+ struct __htm_tdb *tdb = (struct __htm_tdb*)tdb_ptr;
+
+ return tdb->abort_code;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _HTMXLINTRIN_H */
diff --git a/gcc/config/s390/s390intrin.h b/gcc/config/s390/s390intrin.h
new file mode 100644
index 00000000000..e1a00ce58e3
--- /dev/null
+++ b/gcc/config/s390/s390intrin.h
@@ -0,0 +1,33 @@
+/* S/390 System z specific intrinsics
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ Contributed by Andreas Krebbel (Andreas.Krebbel@de.ibm.com)
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef _S390INTRIN_H
+#define _S390INTRIN_H
+
+#ifndef __s390__
+ #error s390intrin.h included on wrong platform/compiler
+#endif
+
+#ifdef __HTM__
+#include <htmintrin.h>
+#endif
+
+
+#endif /* _S390INTRIN_H*/
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 20e9ebaa646..b5dc49e9627 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,22 @@
+2013-08-20 Jason Merrill <jason@redhat.com>
+
+ PR c++/58119
+ * cp-tree.h (WILDCARD_TYPE_P): Split out from...
+ (MAYBE_CLASS_TYPE_P): ...here.
+ * cvt.c (build_expr_type_conversion): Don't complain about a
+ template that can't match the desired type category.
+
+2013-08-17 Jason Merrill <jason@redhat.com>
+
+ PR c++/58083
+ * name-lookup.c (push_class_level_binding_1): It's OK to push a
+ lambda type after the enclosing type is complete.
+
+2013-08-06 Jason Merrill <jason@redhat.com>
+
+ PR c++/57825
+ * tree.c (strip_typedefs) [METHOD_TYPE]: Preserve ref-qualifier.
+
2013-07-29 Jason Merrill <jason@redhat.com>
PR c++/57901
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index b10c53bc499..71b5bf6c96c 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1211,17 +1211,20 @@ enum languages { lang_c, lang_cplusplus, lang_java };
/* The _DECL for this _TYPE. */
#define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE)))
-/* Nonzero if T is a class (or struct or union) type. Also nonzero
- for template type parameters, typename types, and instantiated
- template template parameters. Keep these checks in ascending code
- order. */
-#define MAYBE_CLASS_TYPE_P(T) \
+/* Nonzero if T is a type that could resolve to any kind of concrete type
+ at instantiation time. */
+#define WILDCARD_TYPE_P(T) \
(TREE_CODE (T) == TEMPLATE_TYPE_PARM \
|| TREE_CODE (T) == TYPENAME_TYPE \
|| TREE_CODE (T) == TYPEOF_TYPE \
|| TREE_CODE (T) == BOUND_TEMPLATE_TEMPLATE_PARM \
- || TREE_CODE (T) == DECLTYPE_TYPE \
- || CLASS_TYPE_P (T))
+ || TREE_CODE (T) == DECLTYPE_TYPE)
+
+/* Nonzero if T is a class (or struct or union) type. Also nonzero
+ for template type parameters, typename types, and instantiated
+ template template parameters. Keep these checks in ascending code
+ order. */
+#define MAYBE_CLASS_TYPE_P(T) (WILDCARD_TYPE_P (T) || CLASS_TYPE_P (T))
/* Set CLASS_TYPE_P for T to VAL. T must be a class, struct, or
union type. */
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index f83f3704927..8c03e2086ce 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -1583,17 +1583,6 @@ build_expr_type_conversion (int desires, tree expr, bool complain)
if (DECL_NONCONVERTING_P (cand))
continue;
- if (TREE_CODE (cand) == TEMPLATE_DECL)
- {
- if (complain)
- {
- error ("ambiguous default type conversion from %qT",
- basetype);
- error (" candidate conversions include %qD", cand);
- }
- return error_mark_node;
- }
-
candidate = non_reference (TREE_TYPE (TREE_TYPE (cand)));
switch (TREE_CODE (candidate))
@@ -1627,11 +1616,23 @@ build_expr_type_conversion (int desires, tree expr, bool complain)
break;
default:
+ /* A wildcard could be instantiated to match any desired
+ type, but we can't deduce the template argument. */
+ if (WILDCARD_TYPE_P (candidate))
+ win = true;
break;
}
if (win)
{
+ if (TREE_CODE (cand) == TEMPLATE_DECL)
+ {
+ if (complain)
+ error ("default type conversion can't deduce template"
+ " argument for %qD", cand);
+ return error_mark_node;
+ }
+
if (winner)
{
if (complain)
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 2a47331ea73..c121a4163a9 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -3015,8 +3015,10 @@ push_class_level_binding_1 (tree name, tree x)
if (name == error_mark_node)
return false;
- /* Check for invalid member names. */
- gcc_assert (TYPE_BEING_DEFINED (current_class_type));
+ /* Check for invalid member names. But don't worry about a default
+ argument-scope lambda being pushed after the class is complete. */
+ gcc_assert (TYPE_BEING_DEFINED (current_class_type)
+ || LAMBDA_TYPE_P (TREE_TYPE (decl)));
/* Check that we're pushing into the right binding level. */
gcc_assert (current_class_type == class_binding_level->this_entity);
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index a75663406d4..c7502d6207b 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1220,6 +1220,8 @@ strip_typedefs (tree t)
result =
build_method_type_directly (class_type, type,
TREE_CHAIN (arg_types));
+ result
+ = build_ref_qualified_type (result, type_memfn_rqual (t));
}
else
{
diff --git a/gcc/expr.c b/gcc/expr.c
index 2c5f21aa9a7..7e909bc0f5c 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -119,7 +119,7 @@ struct store_by_pieces_d
int reverse;
};
-static void move_by_pieces_1 (rtx (*) (rtx, ...), enum machine_mode,
+static void move_by_pieces_1 (insn_gen_fn, machine_mode,
struct move_by_pieces_d *);
static bool block_move_libcall_safe_for_call_parm (void);
static bool emit_block_move_via_movmem (rtx, rtx, rtx, unsigned, unsigned, HOST_WIDE_INT);
@@ -128,7 +128,7 @@ static void emit_block_move_via_loop (rtx, rtx, rtx, unsigned);
static rtx clear_by_pieces_1 (void *, HOST_WIDE_INT, enum machine_mode);
static void clear_by_pieces (rtx, unsigned HOST_WIDE_INT, unsigned int);
static void store_by_pieces_1 (struct store_by_pieces_d *, unsigned int);
-static void store_by_pieces_2 (rtx (*) (rtx, ...), enum machine_mode,
+static void store_by_pieces_2 (insn_gen_fn, machine_mode,
struct store_by_pieces_d *);
static tree clear_storage_libcall_fn (int);
static rtx compress_float_constant (rtx, rtx);
@@ -1043,7 +1043,7 @@ move_by_pieces_ninsns (unsigned HOST_WIDE_INT l, unsigned int align,
to make a move insn for that mode. DATA has all the other info. */
static void
-move_by_pieces_1 (rtx (*genfun) (rtx, ...), enum machine_mode mode,
+move_by_pieces_1 (insn_gen_fn genfun, machine_mode mode,
struct move_by_pieces_d *data)
{
unsigned int size = GET_MODE_SIZE (mode);
@@ -2657,7 +2657,7 @@ store_by_pieces_1 (struct store_by_pieces_d *data ATTRIBUTE_UNUSED,
to make a move insn for that mode. DATA has all the other info. */
static void
-store_by_pieces_2 (rtx (*genfun) (rtx, ...), enum machine_mode mode,
+store_by_pieces_2 (insn_gen_fn genfun, machine_mode mode,
struct store_by_pieces_d *data)
{
unsigned int size = GET_MODE_SIZE (mode);
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 9a8b794bc57..d3a136fe8b5 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,33 @@
+2013-08-24 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/57798
+ * trans-array.c (gfc_conv_ss_startstride, set_loop_bounds,
+ gfc_set_delta): Generate preliminary code before the outermost loop.
+
+2013-08-24 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans-array.c (gfc_conv_section_startstride): Move &loop->pre access
+ to the callers.
+ (gfc_conv_ss_startstride, gfc_conv_expr_descriptor): Update callers.
+
+2013-08-24 Janus Weil <janus@gcc.gnu.org>
+
+ Backport from trunk:
+ 2013-08-22 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/58185
+ * match.c (copy_ts_from_selector_to_associate): Only build class
+ container for polymorphic selector. Some cleanup.
+
+2013-08-11 Janus Weil <janus@gcc.gnu.org>
+
+ Backport from trunk:
+ 2013-08-09 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/58058
+ * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Free the temporary
+ string, if necessary.
+
2013-07-28 Tobias Burnus <burnus@net-b.de>
Backport from mainline
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index e9a701bb608..a320248fe3e 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -5142,7 +5142,6 @@ copy_ts_from_selector_to_associate (gfc_expr *associate, gfc_expr *selector)
{
gfc_ref *ref;
gfc_symbol *assoc_sym;
- int i;
assoc_sym = associate->symtree->n.sym;
@@ -5153,9 +5152,8 @@ copy_ts_from_selector_to_associate (gfc_expr *associate, gfc_expr *selector)
while (ref && ref->next)
ref = ref->next;
- if (selector->ts.type == BT_CLASS
- && CLASS_DATA (selector)->as
- && ref && ref->type == REF_ARRAY)
+ if (selector->ts.type == BT_CLASS && CLASS_DATA (selector)->as
+ && ref && ref->type == REF_ARRAY)
{
/* Ensure that the array reference type is set. We cannot use
gfc_resolve_expr at this point, so the usable parts of
@@ -5163,7 +5161,7 @@ copy_ts_from_selector_to_associate (gfc_expr *associate, gfc_expr *selector)
if (ref->u.ar.type == AR_UNKNOWN)
{
ref->u.ar.type = AR_ELEMENT;
- for (i = 0; i < ref->u.ar.dimen + ref->u.ar.codimen; i++)
+ for (int i = 0; i < ref->u.ar.dimen + ref->u.ar.codimen; i++)
if (ref->u.ar.dimen_type[i] == DIMEN_RANGE
|| ref->u.ar.dimen_type[i] == DIMEN_VECTOR
|| (ref->u.ar.dimen_type[i] == DIMEN_UNKNOWN
@@ -5182,37 +5180,19 @@ copy_ts_from_selector_to_associate (gfc_expr *associate, gfc_expr *selector)
selector->rank = 0;
}
- if (selector->ts.type != BT_CLASS)
+ if (selector->rank)
{
- /* The correct class container has to be available. */
- if (selector->rank)
- {
- assoc_sym->attr.dimension = 1;
- assoc_sym->as = gfc_get_array_spec ();
- assoc_sym->as->rank = selector->rank;
- assoc_sym->as->type = AS_DEFERRED;
- }
- else
- assoc_sym->as = NULL;
-
- assoc_sym->ts.type = BT_CLASS;
- assoc_sym->ts.u.derived = selector->ts.u.derived;
- assoc_sym->attr.pointer = 1;
- gfc_build_class_symbol (&assoc_sym->ts, &assoc_sym->attr,
- &assoc_sym->as, false);
+ assoc_sym->attr.dimension = 1;
+ assoc_sym->as = gfc_get_array_spec ();
+ assoc_sym->as->rank = selector->rank;
+ assoc_sym->as->type = AS_DEFERRED;
}
else
+ assoc_sym->as = NULL;
+
+ if (selector->ts.type == BT_CLASS)
{
/* The correct class container has to be available. */
- if (selector->rank)
- {
- assoc_sym->attr.dimension = 1;
- assoc_sym->as = gfc_get_array_spec ();
- assoc_sym->as->rank = selector->rank;
- assoc_sym->as->type = AS_DEFERRED;
- }
- else
- assoc_sym->as = NULL;
assoc_sym->ts.type = BT_CLASS;
assoc_sym->ts.u.derived = CLASS_DATA (selector)->ts.u.derived;
assoc_sym->attr.pointer = 1;
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 75fed2f651c..b34f6fb19a6 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -3674,7 +3674,7 @@ evaluate_bound (stmtblock_t *block, tree *bounds, gfc_expr ** values,
/* Calculate the lower bound of an array section. */
static void
-gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int dim)
+gfc_conv_section_startstride (stmtblock_t * block, gfc_ss * ss, int dim)
{
gfc_expr *stride = NULL;
tree desc;
@@ -3703,12 +3703,12 @@ gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int dim)
/* Calculate the start of the range. For vector subscripts this will
be the range of the vector. */
- evaluate_bound (&loop->pre, info->start, ar->start, desc, dim, true);
+ evaluate_bound (block, info->start, ar->start, desc, dim, true);
/* Similarly calculate the end. Although this is not used in the
scalarizer, it is needed when checking bounds and where the end
is an expression with side-effects. */
- evaluate_bound (&loop->pre, info->end, ar->end, desc, dim, false);
+ evaluate_bound (block, info->end, ar->end, desc, dim, false);
/* Calculate the stride. */
if (stride == NULL)
@@ -3717,8 +3717,8 @@ gfc_conv_section_startstride (gfc_loopinfo * loop, gfc_ss * ss, int dim)
{
gfc_init_se (&se, NULL);
gfc_conv_expr_type (&se, stride, gfc_array_index_type);
- gfc_add_block_to_block (&loop->pre, &se.pre);
- info->stride[dim] = gfc_evaluate_now (se.expr, &loop->pre);
+ gfc_add_block_to_block (block, &se.pre);
+ info->stride[dim] = gfc_evaluate_now (se.expr, block);
}
}
@@ -3735,6 +3735,8 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
gfc_ss *ss;
tree desc;
+ gfc_loopinfo * const outer_loop = outermost_loop (loop);
+
loop->dimen = 0;
/* Determine the rank of the loop. */
for (ss = loop->ss; ss != gfc_ss_terminator; ss = ss->loop_chain)
@@ -3794,10 +3796,11 @@ done:
/* Get the descriptor for the array. If it is a cross loops array,
we got the descriptor already in the outermost loop. */
if (ss->parent == NULL)
- gfc_conv_ss_descriptor (&loop->pre, ss, !loop->array_parameter);
+ gfc_conv_ss_descriptor (&outer_loop->pre, ss,
+ !loop->array_parameter);
for (n = 0; n < ss->dimen; n++)
- gfc_conv_section_startstride (loop, ss, ss->dim[n]);
+ gfc_conv_section_startstride (&outer_loop->pre, ss, ss->dim[n]);
break;
case GFC_SS_INTRINSIC:
@@ -3833,7 +3836,7 @@ done:
fold_convert (gfc_array_index_type,
rank),
gfc_index_one_node);
- info->end[0] = gfc_evaluate_now (tmp, &loop->pre);
+ info->end[0] = gfc_evaluate_now (tmp, &outer_loop->pre);
info->start[0] = gfc_index_zero_node;
info->stride[0] = gfc_index_one_node;
continue;
@@ -4115,7 +4118,7 @@ done:
}
tmp = gfc_finish_block (&block);
- gfc_add_expr_to_block (&loop->pre, tmp);
+ gfc_add_expr_to_block (&outer_loop->pre, tmp);
}
for (loop = loop->nested; loop; loop = loop->next)
@@ -4398,6 +4401,8 @@ set_loop_bounds (gfc_loopinfo *loop)
mpz_t i;
bool nonoptional_arr;
+ gfc_loopinfo * const outer_loop = outermost_loop (loop);
+
loopspec = loop->specloop;
mpz_init (i);
@@ -4583,7 +4588,7 @@ set_loop_bounds (gfc_loopinfo *loop)
else
{
/* Set the delta for this section. */
- info->delta[dim] = gfc_evaluate_now (loop->from[n], &loop->pre);
+ info->delta[dim] = gfc_evaluate_now (loop->from[n], &outer_loop->pre);
/* Number of iterations is (end - start + step) / step.
with start = 0, this simplifies to
last = end / step;
@@ -4595,7 +4600,7 @@ set_loop_bounds (gfc_loopinfo *loop)
gfc_array_index_type, tmp, info->stride[dim]);
tmp = fold_build2_loc (input_location, MAX_EXPR, gfc_array_index_type,
tmp, build_int_cst (gfc_array_index_type, -1));
- loop->to[n] = gfc_evaluate_now (tmp, &loop->pre);
+ loop->to[n] = gfc_evaluate_now (tmp, &outer_loop->pre);
/* Make the loop variable start at 0. */
loop->from[n] = gfc_index_zero_node;
}
@@ -4671,6 +4676,8 @@ gfc_set_delta (gfc_loopinfo *loop)
tree tmp;
int n, dim;
+ gfc_loopinfo * const outer_loop = outermost_loop (loop);
+
loopspec = loop->specloop;
/* Calculate the translation from loop variables to array indices. */
@@ -4706,7 +4713,7 @@ gfc_set_delta (gfc_loopinfo *loop)
gfc_array_index_type,
info->start[dim], tmp);
- info->delta[dim] = gfc_evaluate_now (tmp, &loop->pre);
+ info->delta[dim] = gfc_evaluate_now (tmp, &outer_loop->pre);
}
}
}
@@ -6690,10 +6697,10 @@ gfc_conv_expr_descriptor (gfc_se *se, gfc_expr *expr)
gcc_assert (ar->dimen_type[n + ndim] == DIMEN_THIS_IMAGE);
/* Make sure the call to gfc_conv_section_startstride won't
- generate unnecessary code to calculate stride. */
+ generate unnecessary code to calculate stride. */
gcc_assert (ar->stride[n + ndim] == NULL);
- gfc_conv_section_startstride (&loop, ss, n + ndim);
+ gfc_conv_section_startstride (&loop.pre, ss, n + ndim);
loop.from[n + loop.dimen] = info->start[n + ndim];
loop.to[n + loop.dimen] = info->end[n + ndim];
}
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index a2bb2a78ee7..ddd9eaea5c2 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -5653,8 +5653,7 @@ scalar_transfer:
if (expr->ts.type == BT_CHARACTER)
{
- tree direct;
- tree indirect;
+ tree direct, indirect, free;
ptr = convert (gfc_get_pchar_type (expr->ts.kind), source);
tmpdecl = gfc_create_var (gfc_get_pchar_type (expr->ts.kind),
@@ -5687,6 +5686,13 @@ scalar_transfer:
tmp = build3_v (COND_EXPR, tmp, direct, indirect);
gfc_add_expr_to_block (&se->pre, tmp);
+ /* Free the temporary string, if necessary. */
+ free = gfc_call_free (tmpdecl);
+ tmp = fold_build2_loc (input_location, GT_EXPR, boolean_type_node,
+ dest_word_len, source_bytes);
+ tmp = build3_v (COND_EXPR, tmp, free, build_empty_stmt (input_location));
+ gfc_add_expr_to_block (&se->post, tmp);
+
se->expr = tmpdecl;
se->string_length = fold_convert (gfc_charlen_type_node, dest_word_len);
}
diff --git a/gcc/genoutput.c b/gcc/genoutput.c
index 995c5c55f11..59afaa452aa 100644
--- a/gcc/genoutput.c
+++ b/gcc/genoutput.c
@@ -404,9 +404,9 @@ output_insn_data (void)
}
if (d->name && d->name[0] != '*')
- printf (" (insn_gen_fn) gen_%s,\n", d->name);
+ printf (" { (insn_gen_fn::stored_funcptr) gen_%s },\n", d->name);
else
- printf (" 0,\n");
+ printf (" { 0 },\n");
printf (" &operand_data[%d],\n", d->operand_number);
printf (" %d,\n", d->n_generator_args);
diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c
index 57b343ab5cf..5cda3873eb3 100644
--- a/gcc/gimple-ssa-strength-reduction.c
+++ b/gcc/gimple-ssa-strength-reduction.c
@@ -1525,11 +1525,23 @@ unconditional_cands_with_known_stride_p (slsr_cand_t root)
static void
replace_ref (tree *expr, slsr_cand_t c)
{
- tree add_expr = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (c->base_expr),
- c->base_expr, c->stride);
- tree mem_ref = fold_build2 (MEM_REF, TREE_TYPE (*expr), add_expr,
- double_int_to_tree (c->cand_type, c->index));
-
+ tree add_expr, mem_ref, acc_type = TREE_TYPE (*expr);
+ unsigned HOST_WIDE_INT misalign;
+ unsigned align;
+
+ /* Ensure the memory reference carries the minimum alignment
+ requirement for the data type. See PR58041. */
+ get_object_alignment_1 (*expr, &align, &misalign);
+ if (misalign != 0)
+ align = (misalign & -misalign);
+ if (align < TYPE_ALIGN (acc_type))
+ acc_type = build_aligned_type (acc_type, align);
+
+ add_expr = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (c->base_expr),
+ c->base_expr, c->stride);
+ mem_ref = fold_build2 (MEM_REF, acc_type, add_expr,
+ double_int_to_tree (c->cand_type, c->index));
+
/* Gimplify the base addressing expression for the new MEM_REF tree. */
gimple_stmt_iterator gsi = gsi_for_stmt (c->cand_stmt);
TREE_OPERAND (mem_ref, 0)
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 785c2f021a7..97a37e32df7 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -4045,6 +4045,13 @@ walk_stmt_load_store_addr_ops (gimple stmt, void *data,
ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data);
}
}
+ else if (visit_addr
+ && gimple_code (stmt) == GIMPLE_GOTO)
+ {
+ tree op = gimple_goto_dest (stmt);
+ if (TREE_CODE (op) == ADDR_EXPR)
+ ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data);
+ }
return ret;
}
diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog
index 9e8d36ece04..7edfb604686 100644
--- a/gcc/go/ChangeLog
+++ b/gcc/go/ChangeLog
@@ -1,3 +1,14 @@
+2013-08-28 Ian Lance Taylor <iant@google.com>
+
+ * go-gcc.cc (Gcc_backend::immutable_struct): Set TREE_PUBLIC if
+ the struct is not hidden.
+ (Gcc_backend::immutable_struct_set_init): Don't set TREE_PUBLIC.
+
+2013-08-06 Ian Lance Taylor <iant@google.com>
+
+ * go-gcc.cc (Gcc_backend::immutable_struct_set_init): Use
+ compute_reloc_for_constant.
+
2013-08-02 Ian Lance Taylor <iant@google.com>
* go-gcc.cc (immutable_struct_set_init): Always call
diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc
index 50dbb3128f1..025bb2bdca0 100644
--- a/gcc/go/go-gcc.cc
+++ b/gcc/go/go-gcc.cc
@@ -1475,8 +1475,8 @@ Gcc_backend::temporary_variable(Bfunction* function, Bblock* bblock,
// Create a named immutable initialized data structure.
Bvariable*
-Gcc_backend::immutable_struct(const std::string& name, bool, bool,
- Btype* btype, Location location)
+Gcc_backend::immutable_struct(const std::string& name, bool is_hidden,
+ bool, Btype* btype, Location location)
{
tree type_tree = btype->get_tree();
if (type_tree == error_mark_node)
@@ -1490,6 +1490,8 @@ Gcc_backend::immutable_struct(const std::string& name, bool, bool,
TREE_CONSTANT(decl) = 1;
TREE_USED(decl) = 1;
DECL_ARTIFICIAL(decl) = 1;
+ if (!is_hidden)
+ TREE_PUBLIC(decl) = 1;
// We don't call rest_of_decl_compilation until we have the
// initializer.
@@ -1503,8 +1505,7 @@ Gcc_backend::immutable_struct(const std::string& name, bool, bool,
void
Gcc_backend::immutable_struct_set_init(Bvariable* var, const std::string&,
- bool is_hidden, bool is_common, Btype*,
- Location,
+ bool, bool is_common, Btype*, Location,
Bexpression* initializer)
{
tree decl = var->get_tree();
@@ -1515,17 +1516,14 @@ Gcc_backend::immutable_struct_set_init(Bvariable* var, const std::string&,
DECL_INITIAL(decl) = init_tree;
// We can't call make_decl_one_only until we set DECL_INITIAL.
- if (!is_common)
- {
- if (!is_hidden)
- TREE_PUBLIC(decl) = 1;
- }
- else
+ if (is_common)
make_decl_one_only(decl, DECL_ASSEMBLER_NAME(decl));
// These variables are often unneeded in the final program, so put
// them in their own section so that linker GC can discard them.
- resolve_unique_section(decl, 1, 1);
+ resolve_unique_section(decl,
+ compute_reloc_for_constant (init_tree),
+ 1);
rest_of_decl_compilation(decl, 1, 0);
}
diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc
index 0b69d5d9887..4e5bd447831 100644
--- a/gcc/go/gofrontend/gogo.cc
+++ b/gcc/go/gofrontend/gogo.cc
@@ -3133,7 +3133,8 @@ Check_return_statements_traverse::function(Named_object* no)
return TRAVERSE_CONTINUE;
if (func->block()->may_fall_through())
- error_at(func->location(), "control reaches end of non-void function");
+ error_at(func->block()->end_location(),
+ "missing return at end of function");
return TRAVERSE_CONTINUE;
}
diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc
index 429d91bafe2..9d112850fee 100644
--- a/gcc/go/gofrontend/parse.cc
+++ b/gcc/go/gofrontend/parse.cc
@@ -5266,7 +5266,8 @@ Parse::range_clause_decl(const Typed_identifier_list* til,
no->var_value()->set_type_from_range_value();
if (is_new)
any_new = true;
- p_range_clause->value = Expression::make_var_reference(no, location);
+ if (!Gogo::is_sink_name(pti->name()))
+ p_range_clause->value = Expression::make_var_reference(no, location);
}
if (!any_new)
diff --git a/gcc/go/gofrontend/statements.cc b/gcc/go/gofrontend/statements.cc
index ca1ad07af6c..7314918a9a1 100644
--- a/gcc/go/gofrontend/statements.cc
+++ b/gcc/go/gofrontend/statements.cc
@@ -4093,6 +4093,16 @@ Type_case_clauses::Type_case_clause::lower(Type* switch_val_type,
bool
Type_case_clauses::Type_case_clause::may_fall_through() const
{
+ if (this->is_fallthrough_)
+ {
+ // This case means that we automatically fall through to the
+ // next case (it's used for T1 in case T1, T2:). It does not
+ // mean that we fall through to the end of the type switch as a
+ // whole. There is sure to be a next case and that next case
+ // will determine whether we fall through to the statements
+ // after the type switch.
+ return false;
+ }
if (this->statements_ == NULL)
return true;
return this->statements_->may_fall_through();
diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc
index 0a86d472062..b32c0587e6c 100644
--- a/gcc/go/gofrontend/types.cc
+++ b/gcc/go/gofrontend/types.cc
@@ -4221,6 +4221,22 @@ Struct_field::is_field_name(const std::string& name) const
}
}
+// Return whether this field is an embedded built-in type.
+
+bool
+Struct_field::is_embedded_builtin(Gogo* gogo) const
+{
+ const std::string& name(this->field_name());
+ // We know that a field is an embedded type if it is anonymous.
+ // We can decide if it is a built-in type by checking to see if it is
+ // registered globally under the field's name.
+ // This allows us to distinguish between embedded built-in types and
+ // embedded types that are aliases to built-in types.
+ return (this->is_anonymous()
+ && !Gogo::is_hidden_name(name)
+ && gogo->lookup_global(name.c_str()) != NULL);
+}
+
// Class Struct_type.
// A hash table used to find identical unnamed structs so that they
@@ -4835,11 +4851,16 @@ Struct_type::do_type_descriptor(Gogo* gogo, Named_type* name)
++q;
go_assert(q->is_field_name("pkgPath"));
- if (!Gogo::is_hidden_name(pf->field_name()))
- fvals->push_back(Expression::make_nil(bloc));
+ bool is_embedded_builtin = pf->is_embedded_builtin(gogo);
+ if (!Gogo::is_hidden_name(pf->field_name()) && !is_embedded_builtin)
+ fvals->push_back(Expression::make_nil(bloc));
else
{
- std::string n = Gogo::hidden_name_pkgpath(pf->field_name());
+ std::string n;
+ if (is_embedded_builtin)
+ n = gogo->package_name();
+ else
+ n = Gogo::hidden_name_pkgpath(pf->field_name());
Expression* s = Expression::make_string(n, bloc);
fvals->push_back(Expression::make_unary(OPERATOR_AND, s, bloc));
}
diff --git a/gcc/go/gofrontend/types.h b/gcc/go/gofrontend/types.h
index 56626f1960e..8bc022eb824 100644
--- a/gcc/go/gofrontend/types.h
+++ b/gcc/go/gofrontend/types.h
@@ -1926,6 +1926,10 @@ class Struct_field
bool
is_field_name(const std::string& name) const;
+ // Return whether this struct field is an embedded built-in type.
+ bool
+ is_embedded_builtin(Gogo*) const;
+
// The field type.
Type*
type() const
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index dfbe93a8037..32e8c45f287 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -1388,7 +1388,7 @@ process_alt_operands (int only_alternative)
for (nalt = 0; nalt < n_alternatives; nalt++)
{
/* Loop over operands for one constraint alternative. */
-#ifdef HAVE_ATTR_enabled
+#if HAVE_ATTR_enabled
if (curr_id->alternative_enabled_p != NULL
&& ! curr_id->alternative_enabled_p[nalt])
continue;
@@ -4396,7 +4396,7 @@ update_ebb_live_info (rtx head, rtx tail)
bitmap_clear_bit (&live_regs, reg->regno);
/* Mark each used value as live. */
for (reg = curr_id->regs; reg != NULL; reg = reg->next)
- if (reg->type == OP_IN
+ if (reg->type != OP_OUT
&& bitmap_bit_p (&check_only_regs, reg->regno))
bitmap_set_bit (&live_regs, reg->regno);
/* It is quite important to remove dead move insns because it
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 7440bef22b0..354d30ad0a2 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -836,6 +836,7 @@ copy_var_decl (tree var, tree name, tree type)
DECL_ARTIFICIAL (copy) = DECL_ARTIFICIAL (var);
DECL_IGNORED_P (copy) = DECL_IGNORED_P (var);
DECL_CONTEXT (copy) = DECL_CONTEXT (var);
+ TREE_NO_WARNING (copy) = TREE_NO_WARNING (var);
TREE_USED (copy) = 1;
DECL_SEEN_IN_BIND_EXPR_P (copy) = 1;
diff --git a/gcc/passes.c b/gcc/passes.c
index 8390223e88e..7085f5d247f 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -1531,15 +1531,15 @@ init_optimization_passes (void)
/* Perform simple scalar cleanup which is constant/copy propagation. */
NEXT_PASS (pass_ccp);
NEXT_PASS (pass_object_sizes);
+ /* Fold remaining builtins. */
+ NEXT_PASS (pass_fold_builtins);
/* Copy propagation also copy-propagates constants, this is necessary
- to forward object-size results properly. */
+ to forward object-size and builtin folding results properly. */
NEXT_PASS (pass_copy_prop);
+ NEXT_PASS (pass_dce);
NEXT_PASS (pass_asan);
NEXT_PASS (pass_tsan);
NEXT_PASS (pass_rename_ssa_copies);
- NEXT_PASS (pass_dce);
- /* Fold remaining builtins. */
- NEXT_PASS (pass_fold_builtins);
/* ??? We do want some kind of loop invariant motion, but we possibly
need to adjust LIM to be more friendly towards preserving accurate
debug information here. */
diff --git a/gcc/recog.h b/gcc/recog.h
index 67ad0f70d33..27e3b7c71db 100644
--- a/gcc/recog.h
+++ b/gcc/recog.h
@@ -256,7 +256,57 @@ extern struct operand_alternative recog_op_alt[MAX_RECOG_OPERANDS][MAX_RECOG_ALT
typedef int (*insn_operand_predicate_fn) (rtx, enum machine_mode);
typedef const char * (*insn_output_fn) (rtx *, rtx);
-typedef rtx (*insn_gen_fn) (rtx, ...);
+
+struct insn_gen_fn
+{
+ typedef rtx (*f0) (void);
+ typedef rtx (*f1) (rtx);
+ typedef rtx (*f2) (rtx, rtx);
+ typedef rtx (*f3) (rtx, rtx, rtx);
+ typedef rtx (*f4) (rtx, rtx, rtx, rtx);
+ typedef rtx (*f5) (rtx, rtx, rtx, rtx, rtx);
+ typedef rtx (*f6) (rtx, rtx, rtx, rtx, rtx, rtx);
+ typedef rtx (*f7) (rtx, rtx, rtx, rtx, rtx, rtx, rtx);
+ typedef rtx (*f8) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx);
+ typedef rtx (*f9) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx);
+ typedef rtx (*f10) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx);
+ typedef rtx (*f11) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx);
+ typedef rtx (*f12) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx);
+ typedef rtx (*f13) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx);
+ typedef rtx (*f14) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx);
+ typedef rtx (*f15) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx);
+ typedef rtx (*f16) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx);
+
+ typedef f0 stored_funcptr;
+
+ rtx operator () (void) const { return ((f0)func) (); }
+ rtx operator () (rtx a0) const { return ((f1)func) (a0); }
+ rtx operator () (rtx a0, rtx a1) const { return ((f2)func) (a0, a1); }
+ rtx operator () (rtx a0, rtx a1, rtx a2) const { return ((f3)func) (a0, a1, a2); }
+ rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3) const { return ((f4)func) (a0, a1, a2, a3); }
+ rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4) const { return ((f5)func) (a0, a1, a2, a3, a4); }
+ rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5) const { return ((f6)func) (a0, a1, a2, a3, a4, a5); }
+ rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6) const { return ((f7)func) (a0, a1, a2, a3, a4, a5, a6); }
+ rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7) const { return ((f8)func) (a0, a1, a2, a3, a4, a5, a6, a7); }
+ rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8) const { return ((f9)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8); }
+ rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9) const { return ((f10)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
+ rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9, rtx a10) const { return ((f11)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
+ rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9, rtx a10, rtx a11) const { return ((f12)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
+ rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9, rtx a10, rtx a11, rtx a12) const { return ((f13)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
+ rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9, rtx a10, rtx a11, rtx a12, rtx a13) const { return ((f14)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
+ rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9, rtx a10, rtx a11, rtx a12, rtx a13, rtx a14) const { return ((f15)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
+ rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9, rtx a10, rtx a11, rtx a12, rtx a13, rtx a14, rtx a15) const { return ((f16)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
+
+ // This is for compatibility of code that invokes functions like
+ // (*funcptr) (arg)
+ insn_gen_fn operator * (void) const { return *this; }
+
+ // The wrapped function pointer must be public and there must not be any
+ // constructors. Otherwise the insn_data_d struct initializers generated
+ // by genoutput.c will result in static initializer functions, which defeats
+ // the purpose of the generated insn_data_d array.
+ stored_funcptr func;
+};
struct insn_operand_data
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d3037fa5410..82f8ecdbc84 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,149 @@
+2013-08-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/58277
+ * gcc.c-torture/execute/pr58277-1.c: New test.
+ * gcc.c-torture/execute/pr58277-2.c: New test.
+
+2013-08-29 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2013-07-22 Georg-Johann Lay <avr@gjlay.de>
+
+ PR testsuite/52641
+ * gcc.dg/torture/pr57381.c: Add dg-require-effective-target int32plus.
+
+ 2013-05-27 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/57417
+ * gcc.dg/torture/pr57417.c: New testcase.
+
+ PR tree-optimization/57396
+ * gfortran.fortran-torture/execute/pr57396.f90: New testcase.
+
+ PR tree-optimization/57343
+ * gcc.dg/torture/pr57343.c: New testcase.
+
+ 2013-05-23 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/57381
+ * gcc.dg/torture/pr57381.c: New testcase.
+
+2013-08-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/58257
+ * c-c++-common/gomp/pr58257.c: New test.
+
+2013-08-28 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2013-06-24 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/56977
+ * gcc.dg/pr56977.c: New testcase.
+
+2013-08-24 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/57798
+ * gfortran.dg/inline_sum_5.f90: New.
+
+2013-08-24 Janus Weil <janus@gcc.gnu.org>
+
+ Backport from trunk:
+ 2013-08-22 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/58185
+ * gfortran.dg/select_type_34.f90: New.
+
+2013-08-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/58218
+ * gcc.target/i386/pr58218.c: New test.
+
+ PR tree-optimization/58209
+ * gcc.c-torture/execute/pr58209.c: New test.
+
+2013-08-20 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/58190
+ * g++.dg/pr57878.C: Use __SIZE_TYPE__.
+
+2013-08-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/58006
+ * g++.dg/opt/pr58006.C: New test.
+
+2013-08-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/58164
+ * gcc.c-torture/compile/pr58164.c: New test.
+
+ PR tree-optimization/58165
+ * g++.dg/opt/pr58165.C: New test.
+
+2013-08-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/58145
+ * gcc.dg/pr58145-1.c: New test.
+ * gcc.dg/pr58145-2.c: New test.
+
+2013-08-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/56417
+ * gcc.dg/asan/pr56417.c: New test.
+
+2013-08-13 Vladimir Makarov <vmakarov@redhat.com>
+
+ Backport from mainline
+ 2013-06-06 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-optimization/57459
+ * gcc.target/i386/pr57459.c: New test.
+
+2013-08-13 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/loop_optimization16.adb: New test.
+ * gnat.dg/loop_optimization16_pkg.ad[sb]: New helper.
+
+2013-08-13 Marek Polacek <polacek@redhat.com>
+
+ PR tree-optimization/57980
+ * gcc.dg/pr57980.c: New test.
+
+2013-08-13 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2013-08-12 Perez Read <netfirewall@gmail.com>
+
+ PR target/58132
+ * gcc.target/i386/movabs-1.c: New test.
+
+2013-08-11 Janus Weil <janus@gcc.gnu.org>
+
+ Backport from trunk:
+ 2013-08-09 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/58058
+ * gfortran.dg/transfer_intrinsic_6.f90: New.
+
+2013-08-09 Zhenqiang Chen <zhenqiang.chen@linaro.org>
+
+ Backport from mainline:
+ 2013-08-09 Zhenqiang Chen <zhenqiang.chen@linaro.org>
+
+ * gcc.target/arm/lp1189445.c: New testcase.
+
+2013-08-06 Martin Jambor <mjambor@suse.cz>
+ Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ * gcc.dg/torture/pr58041.c (foo): Accept z by reference.
+ (a): Fix constructor.
+
+2013-08-06 Martin Jambor <mjambor@suse.cz>
+
+ PR middle-end/58041
+ * gcc.dg/torture/pr58041.c: New test.
+ * gcc.target/arm/pr58041.c: Likewise.
+
2013-08-02 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
Backport from mainline
@@ -33,7 +179,7 @@
2013-07-18 Wei Mi <wmi@google.com>
PR rtl-optimization/57878
- * g++.dg/pr57518.C: New test.
+ * g++.dg/pr57878.C: New test.
2013-07-19 Georg-Johann Lay <avr@gjlay.de>
diff --git a/gcc/testsuite/c-c++-common/gomp/pr58257.c b/gcc/testsuite/c-c++-common/gomp/pr58257.c
new file mode 100644
index 00000000000..8f8d24a998a
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr58257.c
@@ -0,0 +1,15 @@
+/* PR middle-end/58257 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp -Wall" } */
+
+int
+foo (int n)
+{
+ int a[10][10];
+ int x, y;
+#pragma omp parallel for collapse(2) /* { dg-bogus "may be used uninitialized in this function" } */
+ for (x = 0; x < n; x++) /* { dg-bogus "may be used uninitialized in this function" } */
+ for (y = 0; y < n; y++)
+ a[x][y] = x + y * y;
+ return a[0][0];
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg5.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg5.C
new file mode 100644
index 00000000000..d85918dd07b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg5.C
@@ -0,0 +1,30 @@
+// PR c++/58083
+// { dg-do compile { target c++11 } }
+
+namespace details {
+struct iterator_concept_checker
+{
+ typedef char yes_type;
+ typedef char (&no_type)[2];
+
+ template <typename T>
+ static no_type test(...);
+
+ template <typename T>
+ static yes_type test(
+ int*
+ , void (*)(T) = [](T it)
+ {
+ auto copy = T{it}; // copy constructible
+ copy = it; // copy assignable
+ copy.~T(); // destroyable
+ ++it; // incrementable
+ }
+ );
+};
+}
+
+int main()
+{
+ details::iterator_concept_checker::test<int>(0);
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr57981.C b/gcc/testsuite/g++.dg/cpp0x/pr57981.C
new file mode 100644
index 00000000000..5ee1f0ed6ff
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr57981.C
@@ -0,0 +1,17 @@
+// { dg-options "-std=c++11 -Wall -Wextra" }
+
+template<class T>
+void f(T t, void* = 0) // { dg-warning "unused parameter" }
+{
+}
+
+template<class T>
+auto g(T t) -> decltype(f(t))
+{
+ f(t);
+}
+
+int main()
+{
+ g(0);
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/ref-qual14.C b/gcc/testsuite/g++.dg/cpp0x/ref-qual14.C
new file mode 100644
index 00000000000..8e55551aeb2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/ref-qual14.C
@@ -0,0 +1,18 @@
+// PR c++/57825
+// { dg-do compile { target c++11 } }
+
+template<typename T>
+struct target_class
+{};
+
+template<typename Class, typename Ret, typename... Args>
+struct target_class<Ret (Class::*)(Args...)>
+{};
+
+template<typename Class, typename Ret, typename... Args>
+struct target_class<Ret (Class::*)(Args...) &>
+{};
+
+template<typename Class, typename Ret, typename... Args>
+struct target_class<Ret (Class::*)(Args...) &&>
+{};
diff --git a/gcc/testsuite/g++.dg/opt/pr58006.C b/gcc/testsuite/g++.dg/opt/pr58006.C
new file mode 100644
index 00000000000..fd3b7bebd8a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr58006.C
@@ -0,0 +1,22 @@
+// PR tree-optimization/58006
+// { dg-do compile }
+// { dg-require-effective-target pthread }
+// { dg-options "-Ofast -ftree-parallelize-loops=2" }
+
+extern "C" float sqrtf (float);
+
+struct S
+{
+ float i, j;
+ float foo () const { return sqrtf (i * i + j * j); }
+ S () : i (1), j (1) {}
+};
+
+void
+bar (int a, int b)
+{
+ int i;
+ float f;
+ for (i = a; i < b; i++)
+ f = S ().foo ();
+}
diff --git a/gcc/testsuite/g++.dg/opt/pr58165.C b/gcc/testsuite/g++.dg/opt/pr58165.C
new file mode 100644
index 00000000000..d758e370050
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr58165.C
@@ -0,0 +1,14 @@
+// PR tree-optimization/58165
+// { dg-do compile }
+// { dg-options "-O2" }
+
+extern "C" float sqrtf (float);
+
+struct A { A (); ~A (); };
+
+void
+foo (double d)
+{
+ A a;
+ sqrtf (d);
+}
diff --git a/gcc/testsuite/g++.dg/pr57878.C b/gcc/testsuite/g++.dg/pr57878.C
index b1aa25c486c..da4fc4bb563 100644
--- a/gcc/testsuite/g++.dg/pr57878.C
+++ b/gcc/testsuite/g++.dg/pr57878.C
@@ -6,7 +6,7 @@ typedef long long int64;
typedef unsigned int uint32;
typedef unsigned long long uint64;
namespace std {
- typedef unsigned int size_t;
+ typedef __SIZE_TYPE__ size_t;
template<class _CharT>
struct char_traits;
template<typename _Tp>
@@ -22,7 +22,7 @@ namespace std {
return static_cast<_Tp&&>(__t);
}
}
-typedef unsigned int size_t;
+typedef __SIZE_TYPE__ size_t;
extern "C++" {
inline void* operator new(std::size_t, void* __p) noexcept {
return __p;
diff --git a/gcc/testsuite/g++.dg/template/delete2.C b/gcc/testsuite/g++.dg/template/delete2.C
new file mode 100644
index 00000000000..b6ab380c9f9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/delete2.C
@@ -0,0 +1,26 @@
+// PR c++/58119
+
+template <class T>
+struct A
+{
+ operator T*();
+ template <class U>
+ operator A<U>();
+};
+
+template <class T>
+struct B
+{
+ operator T*();
+ template <class U>
+ operator A<U>*();
+};
+
+int main()
+{
+ A<int> a;
+ delete a;
+
+ B<int> b;
+ delete b; // { dg-error "template|delete" }
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr58164.c b/gcc/testsuite/gcc.c-torture/compile/pr58164.c
new file mode 100644
index 00000000000..7fe24fa439f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr58164.c
@@ -0,0 +1,8 @@
+/* PR tree-optimization/58164 */
+
+int
+foo (void)
+{
+ int x = 0;
+ goto *&x;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr58209.c b/gcc/testsuite/gcc.c-torture/execute/pr58209.c
new file mode 100644
index 00000000000..78743bfb959
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr58209.c
@@ -0,0 +1,32 @@
+/* PR tree-optimization/58209 */
+
+extern void abort (void);
+typedef __INTPTR_TYPE__ T;
+T buf[1024];
+
+T *
+foo (T n)
+{
+ if (n == 0)
+ return (T *) buf;
+ T s = (T) foo (n - 1);
+ return (T *) (s + sizeof (T));
+}
+
+T *
+bar (T n)
+{
+ if (n == 0)
+ return buf;
+ return foo (n - 1) + 1;
+}
+
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 27; i++)
+ if (foo (i) != buf + i || bar (i) != buf + i)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr58277-1.c b/gcc/testsuite/gcc.c-torture/execute/pr58277-1.c
new file mode 100644
index 00000000000..811988f4371
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr58277-1.c
@@ -0,0 +1,102 @@
+/* PR tree-optimization/58277 */
+
+extern void abort (void);
+static int a[2];
+int b, c, d, *e, f, g, h, **i = &e, k, l = 1, n, o, p;
+static int **volatile j = &e;
+const int m;
+char u;
+
+int
+bar ()
+{
+ u = 0;
+ return m;
+}
+
+__attribute__((noinline, noclone)) void
+baz ()
+{
+ asm ("");
+}
+
+static int
+foo ()
+{
+ int t1;
+ g = bar ();
+ if (l)
+ ;
+ else
+ for (;; h++)
+ {
+ *i = 0;
+ o = *e = 0;
+ if (p)
+ {
+ f = 0;
+ return 0;
+ }
+ for (;; k++)
+ {
+ int *t2 = 0;
+ int *const *t3[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, &t2, 0, 0, &t2, &t2, &t2,
+ &t2, &t2, 0, 0, 0, 0, 0, 0, 0, &t2, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, &t2, 0, 0, 0, 0, 0, 0, 0, &t2, &t2,
+ &t2, &t2, &t2, 0, 0, 0, 0, 0, 0, 0, &t2, 0, 0, 0,
+ &t2, 0, 0, 0, &t2, 0, &t2, 0, 0, &t2, 0, 0, 0, 0,
+ 0, &t2, 0, 0, 0, 0, &t2, &t2, 0, 0, 0, 0, &t2, 0,
+ 0, 0, 0, 0, 0, 0, &t2, 0, 0, 0, 0, 0, &t2, 0, 0, 0,
+ &t2, &t2
+ };
+ int *const **t4[] = {&t3[0]};
+ **i = 0;
+ if (**j)
+ break;
+ u = 0;
+ }
+ *i = *j;
+ t1 = 0;
+ for (; t1 < 5; t1++)
+ *i = *j;
+ }
+ *j = 0;
+ return 1;
+}
+
+int
+main ()
+{
+ int t5;
+ a[0] = 1;
+ {
+ int *t6[6] = {&d, &d};
+ for (n = 1; n; n--)
+ if (foo())
+ {
+ int *t7[] = {0};
+ d = 0;
+ for (; u < 1; u++)
+ *i = *j;
+ *i = 0;
+ *i = 0;
+ int t8[5] = {0};
+ *i = &t8[0];
+ int *const *t9 = &t6[0];
+ int *const **t10 = &t9;
+ *t10 = &t7[0];
+ }
+ }
+ u = 0;
+ for (; b; b++)
+ for (t5 = 0; t5 < 10; t5++)
+ c = a[a[a[a[a[a[a[a[c]]]]]]]];
+
+ baz ();
+
+ if (!a[a[a[a[a[a[a[a[a[a[a[a[a[a[a[u]]]]]]]]]]]]]]])
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr58277-2.c b/gcc/testsuite/gcc.c-torture/execute/pr58277-2.c
new file mode 100644
index 00000000000..d919c2f3f80
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr58277-2.c
@@ -0,0 +1,98 @@
+/* PR tree-optimization/58277 */
+
+extern void abort (void);
+static int a[1], b, c, e, i, j, k, m, q[] = { 1, 1 }, t;
+int volatile d;
+int **r;
+static int ***volatile s = &r;
+int f, g, o, x;
+static int *volatile h = &f, *p;
+char n;
+
+static void
+fn1 ()
+{
+ b = a[a[a[a[a[a[a[a[b]]]]]]]];
+ b = a[a[a[a[a[a[a[a[b]]]]]]]];
+ b = a[a[b]];
+ b = a[a[a[a[a[a[a[a[b]]]]]]]];
+ b = a[a[a[a[a[a[a[a[b]]]]]]]];
+}
+
+static int
+fn2 ()
+{
+ n = 0;
+ for (; g; t++)
+ {
+ for (;; m++)
+ {
+ d;
+ int *u;
+ int **v[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, &u, 0, 0, 0, 0, &u, &u, &u, &u, &u, &u, &u, 0,
+ &u, 0, &u, &u, &u, 0, &u, &u, 0, &u, &u, &u, &u, 0, &u, &u, &u,
+ &u, &u, 0, &u, &u, 0, &u, 0, &u, &u, 0, &u, &u, &u, &u, &u, 0,
+ &u, 0, 0, 0, &u, &u, &u, 0, 0, &u, &u, &u, 0, &u, 0, &u, &u
+ };
+ int ***w[] = { &v[0] };
+ if (*p)
+ break;
+ return 0;
+ }
+ *h = 0;
+ }
+ return 1;
+}
+
+static void
+fn3 ()
+{
+ int *y[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+ for (; i; i++)
+ x = 0;
+ if (fn2 ())
+ {
+ int *z[6] = { };
+ for (; n < 1; n++)
+ *h = 0;
+ int t1[7];
+ for (; c; c++)
+ o = t1[0];
+ for (; e; e--)
+ {
+ int **t2 = &y[0];
+ int ***t3 = &t2;
+ *t3 = &z[0];
+ }
+ }
+ *s = 0;
+ for (n = 0;; n = 0)
+ {
+ int t4 = 0;
+ if (q[n])
+ break;
+ *r = &t4;
+ }
+}
+
+int
+main ()
+{
+ for (; j; j--)
+ a[0] = 0;
+ fn3 ();
+ for (; k; k++)
+ fn1 ();
+ fn1 ();
+
+ if (n)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/asan/pr56417.c b/gcc/testsuite/gcc.dg/asan/pr56417.c
new file mode 100644
index 00000000000..b7eabf125aa
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/asan/pr56417.c
@@ -0,0 +1,9 @@
+/* PR sanitizer/56417 */
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+int
+foo (void)
+{
+ return __builtin_strlen (&foo);
+}
diff --git a/gcc/testsuite/gcc.dg/pr56977.c b/gcc/testsuite/gcc.dg/pr56977.c
new file mode 100644
index 00000000000..fde88afed1d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr56977.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-Og" } */
+
+__attribute__((__error__("error"))) void error ();
+
+void f (int i) {
+ if (__builtin_constant_p (i)) {
+ error ();
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/pr57980.c b/gcc/testsuite/gcc.dg/pr57980.c
new file mode 100644
index 00000000000..be83536c5f7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr57980.c
@@ -0,0 +1,19 @@
+/* PR tree-optimization/57980 */
+/* { dg-do compile } */
+/* { dg-options "-O -foptimize-sibling-calls -w" } */
+
+typedef int V __attribute__ ((vector_size (2 * sizeof (int))));
+extern V f (void);
+
+V
+bar (void)
+{
+ return -f ();
+}
+
+V
+foo (void)
+{
+ V v = { };
+ return v - f ();
+}
diff --git a/gcc/testsuite/gcc.dg/pr58145-1.c b/gcc/testsuite/gcc.dg/pr58145-1.c
new file mode 100644
index 00000000000..0e236c0456d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr58145-1.c
@@ -0,0 +1,37 @@
+/* PR tree-optimization/58145 */
+/* { dg-do compile { target { int32plus } } } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+struct S { unsigned int data : 32; };
+struct T { unsigned int data; };
+volatile struct S s2;
+
+void
+f1 (int val)
+{
+ struct S s = { .data = val };
+ *(volatile struct S *) 0x880000UL = s;
+}
+
+void
+f2 (int val)
+{
+ struct T t = { .data = val };
+ *(volatile struct T *) 0x880000UL = t;
+}
+
+void
+f3 (int val)
+{
+ *(volatile unsigned int *) 0x880000UL = val;
+}
+
+void
+f4 (int val)
+{
+ struct S s = { .data = val };
+ s2 = s;
+}
+
+/* { dg-final { scan-tree-dump-times " ={v} " 4 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/pr58145-2.c b/gcc/testsuite/gcc.dg/pr58145-2.c
new file mode 100644
index 00000000000..840e9828972
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr58145-2.c
@@ -0,0 +1,51 @@
+/* PR tree-optimization/58145 */
+/* { dg-do compile { target { int32plus } } } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+struct S { unsigned int data : 32; };
+struct T { unsigned int data; };
+volatile struct S s2;
+
+static inline void
+f1 (int val)
+{
+ struct S s = { .data = val };
+ *(volatile struct S *) 0x880000UL = s;
+}
+
+static inline void
+f2 (int val)
+{
+ struct T t = { .data = val };
+ *(volatile struct T *) 0x880000UL = t;
+}
+
+static inline void
+f3 (int val)
+{
+ *(volatile unsigned int *) 0x880000UL = val;
+}
+
+static inline void
+f4 (int val)
+{
+ struct S s = { .data = val };
+ s2 = s;
+}
+
+void
+f5 (void)
+{
+ int i;
+ for (i = 0; i < 100; i++)
+ f1 (0);
+ for (i = 0; i < 100; i++)
+ f2 (0);
+ for (i = 0; i < 100; i++)
+ f3 (0);
+ for (i = 0; i < 100; i++)
+ f4 (0);
+}
+
+/* { dg-final { scan-tree-dump-times " ={v} " 4 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/torture/pr57343.c b/gcc/testsuite/gcc.dg/torture/pr57343.c
new file mode 100644
index 00000000000..b05bad5cb43
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr57343.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+
+int c = 0;
+
+int
+main ()
+{
+ int i, f = 1;
+ for (i = 0; i < 5; i++)
+ {
+ --c;
+ unsigned char h = c * 100;
+ if (h == 0)
+ {
+ f = 0;
+ break;
+ }
+ }
+ if (f != 1)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr57381.c b/gcc/testsuite/gcc.dg/torture/pr57381.c
new file mode 100644
index 00000000000..ff6550a6d5f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr57381.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+
+struct S0 { int f0, f1, f2; };
+
+struct S1 {
+ int f0;
+ volatile struct S0 f2;
+};
+
+static struct S1 s = {0x47BED265,{0x06D4EB3E,5,0U}};
+
+int foo(struct S0 p)
+{
+ for (s.f2.f2 = 0; (s.f2.f2 <= 12); s.f2.f2++)
+ {
+ volatile int *l_61[5][2][2] = {{{&s.f2.f0,&s.f2.f0},{&s.f2.f0,&s.f2.f0}},{{&s.f2.f0,&s.f2.f0},{&s.f2.f0,&s.f2.f0}},{{&s.f2.f0,(void*)0},{&s.f2.f0,&s.f2.f0}},{{&s.f2.f0,&s.f2.f0},{&s.f2.f0,&s.f2.f0}},{{&s.f2.f0,&s.f2.f0},{(void*)0,&s.f2.f0}}};
+
+ volatile int **l_68 = &l_61[0][0][1];
+ volatile int *l_76 = &s.f2.f0;
+ (*l_68) = l_61[0][0][0];
+ if ((*l_76 = (p.f2 % 5))) ;
+ }
+ return p.f0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr57417.c b/gcc/testsuite/gcc.dg/torture/pr57417.c
new file mode 100644
index 00000000000..6eac6f932b8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr57417.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+
+int a, b;
+volatile int *c;
+
+void foo ()
+{
+ volatile int d[1];
+ b = 0;
+ for (;; a--)
+ c = &d[b];
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr58041.c b/gcc/testsuite/gcc.dg/torture/pr58041.c
new file mode 100644
index 00000000000..169a71ae7e4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr58041.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+
+typedef long long V
+ __attribute__ ((vector_size (2 * sizeof (long long)), may_alias));
+
+struct s
+{
+ char u;
+ V v[2];
+} __attribute__((packed,aligned(1)));
+
+__attribute__((noinline, noclone))
+long long foo(struct s *x, int y, V *z)
+{
+ V a = x->v[y];
+ x->v[y] = *z;
+ return a[1];
+}
+
+struct s a = {0,{{0,0},{0,0}}};
+int main()
+{
+ V v1 = {0,1};
+ V v2 = {0,2};
+
+ if (foo(&a,0,&v1) != 0)
+ __builtin_abort();
+ if (foo(&a,0,&v2) != 1)
+ __builtin_abort();
+ if (foo(&a,1,&v1) != 0)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/lp1189445.c b/gcc/testsuite/gcc.target/arm/lp1189445.c
new file mode 100644
index 00000000000..766748e5509
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/lp1189445.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_neon } */
+/* { dg-add-options arm_neon } */
+/* { dg-options "-O3" } */
+
+int id;
+int
+test (const long int *data)
+{
+ int i, retval;
+ retval = id;
+ for (i = 0; i < id; i++)
+ {
+ retval &= (data[i] <= 0);
+ }
+
+ return (retval);
+}
diff --git a/gcc/testsuite/gcc.target/arm/pr58041.c b/gcc/testsuite/gcc.target/arm/pr58041.c
new file mode 100644
index 00000000000..481a72b81c7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr58041.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -mno-unaligned-access" } */
+/* { dg-final { scan-assembler "ldrb" } } */
+/* { dg-final { scan-assembler "strb" } } */
+
+struct s
+{
+ char u;
+ long long v[2];
+} __attribute__((packed,aligned(1)));
+
+__attribute__((noinline, noclone))
+long long foo(struct s *x, int y, long long z)
+{
+ long long a = x->v[y];
+ x->v[y] = z;
+ return a;
+}
+
+struct s a = {0,{0,0}};
+int main()
+{
+ if (foo(&a,0,1) != 0)
+ __builtin_abort();
+ if (foo(&a,0,2) != 1)
+ __builtin_abort();
+ if (foo(&a,1,1) != 0)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/movabs-1.c b/gcc/testsuite/gcc.target/i386/movabs-1.c
new file mode 100644
index 00000000000..75ef8d2a6cb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/movabs-1.c
@@ -0,0 +1,10 @@
+/* { dg-do assemble } */
+/* { dg-options "-O2 -masm=intel" } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-require-effective-target masm_intel } */
+
+void
+foo (void)
+{
+ *(volatile long*)0xFFFF800000000000 = -1;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr57459.c b/gcc/testsuite/gcc.target/i386/pr57459.c
new file mode 100644
index 00000000000..75101145afc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr57459.c
@@ -0,0 +1,60 @@
+/* PR rtl-optimization/57459 */
+/* { dg-do run } */
+/* { dg-options "-fno-inline -O2 -minline-all-stringops -fno-omit-frame-pointer" } */
+
+int total1[10], total2[10], total3[10], total4[10], total5[10], a[20];
+int len;
+
+void stackclean() {
+ void *ptr = __builtin_alloca(20000);
+ __builtin_memset(ptr, 0, 20000);
+}
+
+void foo(const char *s) {
+ int r1 = a[1];
+ int r2 = a[2];
+ int r3 = a[3];
+ int r4 = a[4];
+ int r5 = a[5];
+
+ len = __builtin_strlen(s);
+
+ if (s != 0)
+ return;
+
+ while (r1) {
+ total1[r1] = r1;
+ r1--;
+ }
+
+ while (r2) {
+ total2[r2] = r2;
+ r2--;
+ }
+
+ while (r3) {
+ total3[r3] = r3;
+ r3--;
+ }
+
+ while (r4) {
+ total4[r4] = r4;
+ r4--;
+ }
+
+ while (r5) {
+ total5[r5] = r5;
+ r5--;
+ }
+}
+
+extern void abort (void);
+
+int main() {
+ stackclean();
+ foo("abcdefgh");
+ if (len != 8)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/i386/pr58218.c b/gcc/testsuite/gcc.target/i386/pr58218.c
new file mode 100644
index 00000000000..4145242059f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr58218.c
@@ -0,0 +1,5 @@
+/* PR target/58218 */
+/* { dg-do assemble { target lp64 } } */
+/* { dg-options "-mcmodel=medium" } */
+
+struct { float x[16385]; } a = { { 0.f, } };
diff --git a/gcc/testsuite/gfortran.dg/inline_sum_5.f90 b/gcc/testsuite/gfortran.dg/inline_sum_5.f90
new file mode 100644
index 00000000000..bda73fd99a3
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/inline_sum_5.f90
@@ -0,0 +1,33 @@
+! { dg-do run }
+!
+! PR fortran/57798
+! The call to sum used to be inlined into a loop with an uninitialized bound
+!
+! Original testcase by Stephan Kramer <stephan.kramer@imperial.ac.uk>
+
+program test
+ implicit none
+
+ call sub(2, 11)
+
+ contains
+
+ function func(m, n)
+ integer, intent(in):: m,n
+ real, dimension(m, n):: func
+
+ func = 1.0
+
+ end function func
+
+ subroutine sub(m, n)
+ integer, intent(in):: m, n
+ real, dimension(m,n):: y
+
+ y = 1.0
+ if (any(sum(y*func(m,n), dim=1) /= m)) call abort
+
+ end subroutine sub
+
+end program test
+
diff --git a/gcc/testsuite/gfortran.dg/select_type_34.f90 b/gcc/testsuite/gfortran.dg/select_type_34.f90
new file mode 100644
index 00000000000..e75a7abd56e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/select_type_34.f90
@@ -0,0 +1,10 @@
+! { dg-do compile }
+!
+! PR 58185: [4.8/4.9 Regression] [OOP] ICE when selector in SELECT TYPE is non-polymorphic
+!
+! Contributed by John <jwmwalrus@gmail.com>
+
+ integer :: array
+ select type (a => array) ! { dg-error "Selector shall be polymorphic" }
+ end select
+end
diff --git a/gcc/testsuite/gfortran.dg/transfer_intrinsic_6.f90 b/gcc/testsuite/gfortran.dg/transfer_intrinsic_6.f90
new file mode 100644
index 00000000000..e76bc49aeda
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/transfer_intrinsic_6.f90
@@ -0,0 +1,20 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+!
+! PR 58058: [4.7/4.8/4.9 Regression] Memory leak with transfer function
+!
+! Contributed by Thomas Jourdan <thomas.jourdan@orange.fr>
+
+ implicit none
+
+ integer, dimension(3) :: t1
+ character(len=64) :: str
+
+ t1 = (/1,2,3/)
+
+ str = transfer(t1,str)
+
+end
+
+! { dg-final { scan-tree-dump-times "__builtin_free" 1 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/pr57396.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/pr57396.f90
new file mode 100644
index 00000000000..8ea92924ad8
--- /dev/null
+++ b/gcc/testsuite/gfortran.fortran-torture/execute/pr57396.f90
@@ -0,0 +1,33 @@
+module testmod
+ implicit none
+
+ contains
+
+ subroutine foo(n)
+ integer, intent(in) :: n
+ real :: r(0:n,-n:n), a(0:n,-n:n), dj
+ integer :: k, j
+
+ ! initialize with some dummy values
+ do j = -n, n
+ a(:, j) = j
+ r(:,j) = j + 1
+ end do
+
+ ! here be dragons
+ do k = 0, n
+ dj = r(k, k - 2) * a(k, k - 2)
+ r(k,k) = a(k, k - 1) * dj
+ enddo
+
+ if (r(0,0) .ne. -2.) call abort
+
+ end subroutine
+
+end module
+
+program test
+ use testmod
+ implicit none
+ call foo(5)
+end program
diff --git a/gcc/testsuite/gnat.dg/loop_optimization16.adb b/gcc/testsuite/gnat.dg/loop_optimization16.adb
new file mode 100644
index 00000000000..b9f2b70bb45
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/loop_optimization16.adb
@@ -0,0 +1,24 @@
+-- { dg-do run }
+
+with Loop_Optimization16_Pkg; use Loop_Optimization16_Pkg;
+
+procedure Loop_Optimization16 is
+
+ Counter : Natural := 0;
+
+ C : constant Natural := F;
+
+ subtype Index_T is Index_Base range 1 .. Index_Base (C);
+
+begin
+
+ for I in Index_T'First .. Index_T'Last loop
+ Counter := Counter + 1;
+ exit when Counter > 200;
+ end loop;
+
+ if Counter > 200 then
+ raise Program_Error;
+ end if;
+
+end Loop_Optimization16;
diff --git a/gcc/testsuite/gnat.dg/loop_optimization16_pkg.adb b/gcc/testsuite/gnat.dg/loop_optimization16_pkg.adb
new file mode 100644
index 00000000000..e4142f6e6a1
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/loop_optimization16_pkg.adb
@@ -0,0 +1,8 @@
+package body Loop_Optimization16_Pkg is
+
+ function F return Natural is
+ begin
+ return Natural (Index_Base'Last);
+ end;
+
+end Loop_Optimization16_Pkg;
diff --git a/gcc/testsuite/gnat.dg/loop_optimization16_pkg.ads b/gcc/testsuite/gnat.dg/loop_optimization16_pkg.ads
new file mode 100644
index 00000000000..abeecfb646f
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/loop_optimization16_pkg.ads
@@ -0,0 +1,7 @@
+package Loop_Optimization16_Pkg is
+
+ type Index_Base is range 0 .. 127;
+
+ function F return Natural;
+
+end Loop_Optimization16_Pkg;
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug086.go b/gcc/testsuite/go.test/test/fixedbugs/bug086.go
index fc69e0e3fc7..40d23620669 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug086.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug086.go
@@ -6,12 +6,12 @@
package main
-func f() int { // ERROR "return|control"
+func f() int {
if false {
return 0;
}
// we should not be able to return successfully w/o a return statement
-}
+} // ERROR "return"
func main() {
print(f(), "\n");
diff --git a/gcc/tree-affine.c b/gcc/tree-affine.c
index 0ee5eaa9db6..46a183a07b4 100644
--- a/gcc/tree-affine.c
+++ b/gcc/tree-affine.c
@@ -736,11 +736,10 @@ free_affine_expand_cache (struct pointer_map_t **cache)
}
/* If VAL != CST * DIV for any constant CST, returns false.
- Otherwise, if VAL != 0 (and hence CST != 0), and *MULT_SET is true,
- additionally compares CST and MULT, and if they are different,
- returns false. Finally, if neither of these two cases occur,
- true is returned, and if CST != 0, CST is stored to MULT and
- MULT_SET is set to true. */
+ Otherwise, if *MULT_SET is true, additionally compares CST and MULT,
+ and if they are different, returns false. Finally, if neither of these
+ two cases occur, true is returned, and CST is stored to MULT and MULT_SET
+ is set to true. */
static bool
double_int_constant_multiple_p (double_int val, double_int div,
@@ -749,7 +748,13 @@ double_int_constant_multiple_p (double_int val, double_int div,
double_int rem, cst;
if (val.is_zero ())
- return true;
+ {
+ if (*mult_set && !mult->is_zero ())
+ return false;
+ *mult_set = true;
+ *mult = double_int_zero;
+ return true;
+ }
if (div.is_zero ())
return false;
diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c
index 9b6186e3393..f145f1752c9 100644
--- a/gcc/tree-call-cdce.c
+++ b/gcc/tree-call-cdce.c
@@ -726,15 +726,28 @@ shrink_wrap_one_built_in_call (gimple bi_call)
return false and do not do any transformation for
the call. */
if (nconds == 0)
- return false;
+ {
+ conds.release ();
+ return false;
+ }
bi_call_bb = gimple_bb (bi_call);
- /* Now find the join target bb -- split
- bi_call_bb if needed. */
- bi_call_bsi = gsi_for_stmt (bi_call);
+ /* Now find the join target bb -- split bi_call_bb if needed. */
+ if (stmt_ends_bb_p (bi_call))
+ {
+ /* If the call must be the last in the bb, don't split the block,
+ it could e.g. have EH edges. */
+ join_tgt_in_edge_from_call = find_fallthru_edge (bi_call_bb->succs);
+ if (join_tgt_in_edge_from_call == NULL)
+ {
+ conds.release ();
+ return false;
+ }
+ }
+ else
+ join_tgt_in_edge_from_call = split_block (bi_call_bb, bi_call);
- join_tgt_in_edge_from_call = split_block (bi_call_bb, bi_call);
bi_call_bsi = gsi_for_stmt (bi_call);
join_tgt_bb = join_tgt_in_edge_from_call->dest;
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index d7b846ae79b..9d2c3ca3b41 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -478,9 +478,12 @@ take_address_of (tree obj, tree type, edge entry, htab_t decl_address,
if (gsi == NULL)
return NULL;
addr = TREE_OPERAND (*var_p, 0);
- name = make_temp_ssa_name (TREE_TYPE (addr), NULL,
- get_name (TREE_OPERAND
- (TREE_OPERAND (*var_p, 0), 0)));
+ const char *obj_name
+ = get_name (TREE_OPERAND (TREE_OPERAND (*var_p, 0), 0));
+ if (obj_name)
+ name = make_temp_ssa_name (TREE_TYPE (addr), NULL, obj_name);
+ else
+ name = make_ssa_name (TREE_TYPE (addr), NULL);
stmt = gimple_build_assign (name, addr);
gsi_insert_on_edge_immediate (entry, stmt);
@@ -679,6 +682,12 @@ eliminate_local_variables_stmt (edge entry, gimple_stmt_iterator *gsi,
dta.changed = true;
}
}
+ else if (gimple_clobber_p (stmt))
+ {
+ stmt = gimple_build_nop ();
+ gsi_replace (gsi, stmt, false);
+ dta.changed = true;
+ }
else
{
dta.gsi = gsi;
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index bb04fd74446..627fadc66a6 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -1440,6 +1440,7 @@ build_ref_for_offset (location_t loc, tree base, HOST_WIDE_INT offset,
{
tree prev_base = base;
tree off;
+ tree mem_ref;
HOST_WIDE_INT base_offset;
unsigned HOST_WIDE_INT misalign;
unsigned int align;
@@ -1490,7 +1491,12 @@ build_ref_for_offset (location_t loc, tree base, HOST_WIDE_INT offset,
if (align < TYPE_ALIGN (exp_type))
exp_type = build_aligned_type (exp_type, align);
- return fold_build2_loc (loc, MEM_REF, exp_type, base, off);
+ mem_ref = fold_build2_loc (loc, MEM_REF, exp_type, base, off);
+ if (TREE_THIS_VOLATILE (prev_base))
+ TREE_THIS_VOLATILE (mem_ref) = 1;
+ if (TREE_SIDE_EFFECTS (prev_base))
+ TREE_SIDE_EFFECTS (mem_ref) = 1;
+ return mem_ref;
}
/* Construct a memory reference to a part of an aggregate BASE at the given
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index 090e114c36d..f5629306e4b 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -552,10 +552,18 @@ number_of_iterations_ne_max (mpz_t bnd, bool no_overflow, tree c, tree s,
{
double_int max;
mpz_t d;
+ tree type = TREE_TYPE (c);
bool bnds_u_valid = ((no_overflow && exit_must_be_taken)
|| mpz_sgn (bnds->below) >= 0);
- if (multiple_of_p (TREE_TYPE (c), c, s))
+ if (integer_onep (s)
+ || (TREE_CODE (c) == INTEGER_CST
+ && TREE_CODE (s) == INTEGER_CST
+ && tree_to_double_int (c).mod (tree_to_double_int (s),
+ TYPE_UNSIGNED (type),
+ EXACT_DIV_EXPR).is_zero ())
+ || (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (c))
+ && multiple_of_p (type, c, s)))
{
/* If C is an exact multiple of S, then its value will be reached before
the induction variable overflows (unless the loop is exited in some
@@ -572,16 +580,15 @@ number_of_iterations_ne_max (mpz_t bnd, bool no_overflow, tree c, tree s,
the whole # of iterations analysis will fail). */
if (!no_overflow)
{
- max = double_int::mask (TYPE_PRECISION (TREE_TYPE (c))
- - tree_low_cst (num_ending_zeros (s), 1));
+ max = double_int::mask (TYPE_PRECISION (type)
+ - tree_low_cst (num_ending_zeros (s), 1));
mpz_set_double_int (bnd, max, true);
return;
}
/* Now we know that the induction variable does not overflow, so the loop
iterates at most (range of type / S) times. */
- mpz_set_double_int (bnd, double_int::mask (TYPE_PRECISION (TREE_TYPE (c))),
- true);
+ mpz_set_double_int (bnd, double_int::mask (TYPE_PRECISION (type)), true);
/* If the induction variable is guaranteed to reach the value of C before
overflow, ... */
@@ -1311,7 +1318,8 @@ number_of_iterations_cond (struct loop *loop,
}
/* If the loop exits immediately, there is nothing to do. */
- if (integer_zerop (fold_build2 (code, boolean_type_node, iv0->base, iv1->base)))
+ tree tem = fold_binary (code, boolean_type_node, iv0->base, iv1->base);
+ if (tem && integer_zerop (tem))
{
niter->niter = build_int_cst (unsigned_type_for (type), 0);
niter->max = double_int_zero;
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 58fe903e74f..016a5d1bad3 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -1062,7 +1062,7 @@ vn_reference_fold_indirect (vec<vn_reference_op_s> *ops,
addr_base = get_addr_base_and_unit_offset (TREE_OPERAND (op->op0, 0),
&addr_offset);
gcc_checking_assert (addr_base && TREE_CODE (addr_base) != MEM_REF);
- if (addr_base != op->op0)
+ if (addr_base != TREE_OPERAND (op->op0, 0))
{
double_int off = tree_to_double_int (mem_op->op0);
off = off.sext (TYPE_PRECISION (TREE_TYPE (mem_op->op0)));
@@ -2555,6 +2555,7 @@ static inline bool
set_ssa_val_to (tree from, tree to)
{
tree currval = SSA_VAL (from);
+ HOST_WIDE_INT toff, coff;
if (from != to)
{
@@ -2590,7 +2591,17 @@ set_ssa_val_to (tree from, tree to)
print_generic_expr (dump_file, to, 0);
}
- if (currval != to && !operand_equal_p (currval, to, OEP_PURE_SAME))
+ if (currval != to
+ && !operand_equal_p (currval, to, 0)
+ /* ??? For addresses involving volatile objects or types operand_equal_p
+ does not reliably detect ADDR_EXPRs as equal. We know we are only
+ getting invariant gimple addresses here, so can use
+ get_addr_base_and_unit_offset to do this comparison. */
+ && !(TREE_CODE (currval) == ADDR_EXPR
+ && TREE_CODE (to) == ADDR_EXPR
+ && (get_addr_base_and_unit_offset (TREE_OPERAND (currval, 0), &coff)
+ == get_addr_base_and_unit_offset (TREE_OPERAND (to, 0), &toff))
+ && coff == toff))
{
VN_INFO (from)->valnum = to;
if (dump_file && (dump_flags & TDF_DETAILS))
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
index fcb4ab890f6..dbad4a80d86 100644
--- a/gcc/tree-ssa-strlen.c
+++ b/gcc/tree-ssa-strlen.c
@@ -1890,6 +1890,28 @@ strlen_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
int count_vdef = 100;
do_invalidate (dombb, phi, visited, &count_vdef);
BITMAP_FREE (visited);
+ if (count_vdef == 0)
+ {
+ /* If there were too many vdefs in between immediate
+ dominator and current bb, invalidate everything.
+ If stridx_to_strinfo has been unshared, we need
+ to free it, otherwise just set it to NULL. */
+ if (!strinfo_shared ())
+ {
+ unsigned int i;
+ strinfo si;
+
+ for (i = 1;
+ vec_safe_iterate (stridx_to_strinfo, i, &si);
+ ++i)
+ {
+ free_strinfo (si);
+ (*stridx_to_strinfo)[i] = NULL;
+ }
+ }
+ else
+ stridx_to_strinfo = NULL;
+ }
break;
}
}
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index c6581dcedcd..b1b5f967325 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -328,8 +328,10 @@ process_assignment (gimple stmt, gimple_stmt_iterator call, tree *m,
case NEGATE_EXPR:
if (FLOAT_TYPE_P (TREE_TYPE (op0)))
*m = build_real (TREE_TYPE (op0), dconstm1);
- else
+ else if (INTEGRAL_TYPE_P (TREE_TYPE (op0)))
*m = build_int_cst (TREE_TYPE (op0), -1);
+ else
+ return false;
*ass_var = dest;
return true;
@@ -341,8 +343,10 @@ process_assignment (gimple stmt, gimple_stmt_iterator call, tree *m,
{
if (FLOAT_TYPE_P (TREE_TYPE (non_ass_var)))
*m = build_real (TREE_TYPE (non_ass_var), dconstm1);
- else
+ else if (INTEGRAL_TYPE_P (TREE_TYPE (non_ass_var)))
*m = build_int_cst (TREE_TYPE (non_ass_var), -1);
+ else
+ return false;
*a = fold_build1 (NEGATE_EXPR, TREE_TYPE (non_ass_var), non_ass_var);
}
@@ -570,6 +574,11 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
if (!tail_recursion && (m || a))
return;
+ /* For pointers don't allow additions or multiplications. */
+ if ((m || a)
+ && POINTER_TYPE_P (TREE_TYPE (DECL_RESULT (current_function_decl))))
+ return;
+
nw = XNEW (struct tailcall);
nw->call_gsi = gsi;