summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-06-26 11:54:58 -0700
committerH.J. Lu <hjl.tools@gmail.com>2012-06-26 11:54:58 -0700
commit241abac138d2b3bd184cbc9d5bf53cde3857a7a4 (patch)
tree50e18f41c302adc6a4d490cad98365f60c9465c1
parente7e782527af100a7802b6903b15524fac6cd5da2 (diff)
parent24fe62c79a89d579257790e268b0b9ea87940a89 (diff)
downloadgcc-hjl/x32/gcc-4_6-branch+mx32.tar.gz
Merge branch 'hjl/x32/gcc-4_6-branch' into hjl/x32/gcc-4_6-branch+mx32hjl/x32/gcc-4_6-branch+mx32
-rw-r--r--gcc/ChangeLog253
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/ada/ChangeLog9
-rw-r--r--gcc/ada/gcc-interface/decl.c23
-rw-r--r--gcc/c-typeck.c5
-rw-r--r--gcc/config.gcc2
-rw-r--r--gcc/config/alpha/alpha.c28
-rw-r--r--gcc/config/alpha/linux-unwind.h4
-rw-r--r--gcc/config/arm/arm.c5
-rw-r--r--gcc/config/arm/arm.h3
-rw-r--r--gcc/config/avr/avr-stdint.h66
-rw-r--r--gcc/config/bfin/linux-unwind.h6
-rw-r--r--gcc/config/i386/driver-i386.c15
-rw-r--r--gcc/config/i386/i386.c22
-rw-r--r--gcc/config/i386/i386.h9
-rw-r--r--gcc/config/i386/i386.md13
-rw-r--r--gcc/config/i386/linux-unwind.h7
-rw-r--r--gcc/config/i386/sse.md53
-rw-r--r--gcc/config/ia64/linux-unwind.h6
-rw-r--r--gcc/config/mips/linux-unwind.h5
-rw-r--r--gcc/config/pa/linux-unwind.h4
-rw-r--r--gcc/config/pa/pa.c29
-rw-r--r--gcc/config/pa/pa.h9
-rw-r--r--gcc/config/rs6000/altivec.md16
-rw-r--r--gcc/config/rs6000/rs6000.c28
-rw-r--r--gcc/config/rs6000/rs6000.h9
-rw-r--r--gcc/config/rs6000/rs6000.md52
-rw-r--r--gcc/config/sh/linux-unwind.h9
-rw-r--r--gcc/config/sh/sh.c11
-rw-r--r--gcc/config/sh/sh.opt2
-rw-r--r--gcc/config/xtensa/linux-unwind.h4
-rwxr-xr-xgcc/configure2
-rw-r--r--gcc/convert.c5
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/typeck.c2
-rw-r--r--gcc/fortran/ChangeLog33
-rw-r--r--gcc/fortran/decl.c5
-rw-r--r--gcc/fortran/expr.c6
-rw-r--r--gcc/fortran/resolve.c3
-rw-r--r--gcc/fortran/trans-array.c5
-rw-r--r--gcc/fortran/trans.c14
-rw-r--r--gcc/gcov-iov.c12
-rw-r--r--gcc/gimple.c40
-rw-r--r--gcc/gthr-posix.h9
-rw-r--r--gcc/lto/ChangeLog9
-rw-r--r--gcc/lto/lto.c19
-rw-r--r--gcc/testsuite/ChangeLog130
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nullptr28.C16
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic-value1.C2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr53418-1.c5
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr53418-2.c5
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20120427-1.c36
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr53084.c18
-rw-r--r--gcc/testsuite/gcc.dg/pr52862.c9
-rw-r--r--gcc/testsuite/gcc.dg/stack-usage-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr51071-2.c38
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr51071.c33
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr52407.c33
-rw-r--r--gcc/testsuite/gcc.target/i386/avx256-unaligned-load-1.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/avx256-unaligned-load-2.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/avx256-unaligned-load-3.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/avx256-unaligned-store-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/avx256-unaligned-store-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/avx256-unaligned-store-3.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/avx256-unaligned-store-4.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/pr53416.c17
-rw-r--r--gcc/testsuite/gcc.target/powerpc/cell_builtin-1.c48
-rw-r--r--gcc/testsuite/gcc.target/powerpc/cell_builtin-2.c48
-rw-r--r--gcc/testsuite/gcc.target/powerpc/cell_builtin-3.c48
-rw-r--r--gcc/testsuite/gcc.target/powerpc/cell_builtin-4.c48
-rw-r--r--gcc/testsuite/gcc.target/powerpc/cell_builtin-5.c48
-rw-r--r--gcc/testsuite/gcc.target/powerpc/cell_builtin-6.c48
-rw-r--r--gcc/testsuite/gcc.target/powerpc/cell_builtin-7.c48
-rw-r--r--gcc/testsuite/gcc.target/powerpc/cell_builtin-8.c48
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr52775.c16
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr53199.c50
-rw-r--r--gcc/testsuite/gfortran.dg/init_flag_10.f9043
-rw-r--r--gcc/testsuite/gfortran.dg/pointer_intent_6.f9019
-rw-r--r--gcc/testsuite/gfortran.dg/realloc_on_assign_15.f9040
-rw-r--r--gcc/testsuite/gfortran.dg/save_4.f9013
-rw-r--r--gcc/tree-pretty-print.c4
-rw-r--r--gcc/varasm.c12
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/intrinsics/eoshift2.c12
-rw-r--r--libstdc++-v3/ChangeLog7
-rw-r--r--libstdc++-v3/config/os/bsd/netbsd/ctype_base.h6
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype_base/53678.cc28
88 files changed, 1628 insertions, 261 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3733e426ef4..740f812e498 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,256 @@
+2012-06-22 Richard Guenther <rguenther@suse.de>
+
+ * gcov-iov.c: Include bconfig.h and system.h.
+
+2012-06-22 Richard Guenther <rguenther@suse.de>
+
+ PR gcov-profile/53744
+ * gcov-iov.c (main): Treat "" and "prerelease" the same.
+
+2012-06-19 Joey Ye <joey.ye@arm.com>
+
+ Backported from mainline
+ 2011-10-14 David Alan Gilbert <david.gilbert@linaro.org>
+
+ * config/arm/arm.h (TARGET_HAVE_DMB_MCR): MCR Not available in Thumb1.
+
+2012-06-18 Joey Ye <joey.ye@arm.com>
+
+ Backported from mainline
+ 2011-10-14 David Alan Gilbert <david.gilbert@linaro.org>
+
+ PR target/48126
+ * config/arm/arm.c (arm_output_sync_loop): Move label before barrier.
+
+2012-06-17 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline:
+ 2012-06-17 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/sse.md (vcvtph2ps): Fix vec_select selector.
+
+2012-06-16 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ Backport from mainline:
+ 2012-06-03 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * config/pa/pa.h (MAX_PCREL17F_OFFSET): Define.
+ * config/pa/pa.c (pa_attr_length_millicode_call): Use
+ MAX_PCREL17F_OFFSET instead of fixed offset.
+ (pa_attr_length_call): Likewise.
+ (pa_attr_length_indirect_call): Likewise.
+
+2012-06-12 Christian Bruel <christian.bruel@st.com>
+
+ PR target/53621
+ * config/sh/sh.c (sh_option_override): Don't force
+ flag_omit_frame_pointer and maccumulate_outgoing_args.
+ * config/sh/sh.opt (maccumulate-outgoing-args): Init as Var.
+
+2012-06-05 Peter Bergner <bergner@vnet.ibm.com>
+
+ Backport from mainline
+ 2011-08-29 Jakub Jelinek <jakub@redhat.com>
+
+ * gthr-posix.h (__gthread_active_p): Do not use preprocessor
+ conditionals and comments inside macro arguments.
+
+2012-06-04 Edmar Wienskoski <edmar@freescale.com>
+
+ PR target/53559
+ * config/rs6000/altivec.md (altivec_stvlx): Change machine mode of
+ operands.
+ (altivec_stvlxl): Ditto.
+ (altivec_stvrx): Ditto.
+ (altivec_stvrxl): Ditto.
+
+2012-06-04 Georg-Johann Lay <avr@gjlay.de>
+
+ Backport from 2012-06-04 mainline r188172
+
+ PR target/46261
+ * config/avr/avr-stdint.h: New file.
+ * config.gcc (avr-*-*,tm_file): Use avr/avr-stdint.h instead of
+ newlib-stdint.h
+
+2012-06-03 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR target/52999
+ * config/pa/pa.c (TARGET_SECTION_TYPE_FLAGS): Define.
+ (pa_section_type_flags): New.
+ * config/pa/pa.h (LEGITIMATE_CONSTANT_P): Revert previous change.
+
+2012-05-31 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/53541
+ * tree-pretty-print.c (dump_generic_node): Guard against
+ NULL_TREE TREE_TYPE when dumping MEM_REF offset type.
+
+2012-05-24 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2012-05-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR target/53385
+ * config/rs6000/rs6000.c (print_operand): Revise code that unsafely
+ relied on signed overflow behavior.
+
+2012-05-22 Richard Guenther <rguenther@suse.de>
+
+ Backport from mainline
+ 2011-11-10 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/51071
+ * gimple.c (gimple_has_side_effects): Remove checking code
+ that doesn't belong here.
+
+2012-05-22 Richard Guenther <rguenther@suse.de>
+
+ Backport from mainline
+ 2012-02-28 Richard Guenther <rguenther@suse.de>
+
+ PR target/52407
+ * config/i386/i386.c (ix86_expand_vector_set): Fix element
+ ordering for the VEC_CONCAT for two element vectors for
+ V2SFmode, V2SImode and V2DImode.
+
+2012-05-22 Richard Guenther <rguenther@suse.de>
+
+ Backport from mainline
+ 2012-04-12 Richard Guenther <rguenther@suse.de>
+
+ PR c/52862
+ * convert.c (convert_to_pointer): Remove special-casing of zero.
+
+2012-05-21 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/53418
+ * c-typeck.c (build_conditional_expr): Remove C_MAYBE_CONST_EXPR
+ from folded operands before wrapping another around the
+ conditional expression.
+
+2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ Backport from mainline
+ 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/53416
+ * config/i386/i386.md (UNSPEC_RDRAND): Renamed to ...
+ (UNSPECV_RDRAND): This.
+ (rdrand<mode>_1): Updated.
+
+2012-05-20 H.J. Lu <hongjiu.lu@intel.com>
+
+ Backport from mainline
+ 2012-05-20 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/driver-i386.c (host_detect_local_cpu): Support
+ RDRND, F16C and FSGSBASE.
+
+2012-05-16 Eric Botcazou <ebotcazou@adacore.com>
+
+ * configure: Regenerate.
+
+2012-05-14 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/46098
+ * config/i386/i386.c (ix86_expand_special_args_builtin): Always
+ generate target register for "load" class builtins.
+
+ Revert:
+ 2010-10-22 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/46098
+ * config/i386/sse.md (*avx_movu<ssemodesuffix><avxmodesuffix>):
+ Rename from avx_movu<ssemodesuffix><avxmodesuffix>.
+ (avx_movu<ssemodesuffix><avxmodesuffix>): New expander.
+ (*<sse>_movu<ssemodesuffix>): Rename from <sse>_movu<ssemodesuffix>.
+ (<sse>_movu<ssemodesuffix>): New expander.
+ (*avx_movdqu<avxmodesuffix>): Rename from avx_movdqu<avxmodesuffix>.
+ (avx_movdqu<avxmodesuffix>): New expander.
+ (*sse2_movdqu): Rename from sse2_movdqu.
+ (sse2_movdqu): New expander.
+
+2012-05-13 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2012-05-12 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/alpha/alpha.c (alpha_emit_conditional_branch): Handle
+ ORDERED and UNORDERED conditions.
+
+2012-05-06 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR target/52999
+ * config/pa/pa.h (LEGITIMATE_CONSTANT_P): Don't put function labels
+ in constant pool.
+
+2012-05-04 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2012-05-04 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/53228
+ * config/i386/i386.h (X86_ARCH_CMOV): Rename from X86_ARCH_CMOVE.
+ (TARGET_CMOV): Rename from TARGET_CMOVE.
+ (TARGET_CMOVE): New define.
+ * config/i386/i386.c (ix86_option_override_internal): Use TARGET_CMOV.
+ Do not set TARGET_CMOVE here.
+
+2012-05-03 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Backport from the mainline
+ 2012-05-03 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/53199
+ * config/rs6000/rs6000.md (bswapdi splitters): If
+ -mavoid-indexed-addresses (or -mcpu=power6 which sets it by
+ default) is used, generate an alternate sequence that does not
+ depend on using indexed addressing.
+
+2012-04-30 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2012-04-27 Paolo Bonzini <bonzini@gnu.org>
+
+ PR target/53138
+ * config/i386/i386.md (x86_mov<mode>cc_0_m1_neg): Add clobber.
+
+2012-04-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/53084
+ * varasm.c (compute_reloc_for_constant): Handle ADDR_EXPR of MEM_REF.
+ (output_addressed_constants): Likewise.
+
+2012-04-20 Thomas Schwinge <thomas@codesourcery.com>
+
+ struct siginfo vs. siginfo_t
+
+ Backport from trunk (but apply to gcc/):
+
+ 2012-04-20 Thomas Schwinge <thomas@codesourcery.com>
+
+ * config/alpha/linux-unwind.h (alpha_fallback_frame_state): Use
+ siginfo_t instead of struct siginfo.
+ * config/bfin/linux-unwind.h (bfin_fallback_frame_state): Likewise.
+ * config/i386/linux-unwind.h (x86_fallback_frame_state): Likewise.
+ * config/ia64/linux-unwind.h (ia64_fallback_frame_state)
+ (ia64_handle_unwabi): Likewise.
+ * config/mips/linux-unwind.h (mips_fallback_frame_state): Likewise.
+ * config/pa/linux-unwind.h (pa32_fallback_frame_state): Likewise.
+ * config/sh/linux-unwind.h (shmedia_fallback_frame_state)
+ (sh_fallback_frame_state): Likewise.
+ * config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Likewise.
+
+2012-04-13 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2012-04-12 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/52775
+ * config/rs6000/rs6000.h (TARGET_FCFID): Add TARGET_PPC_GPOPT to
+ the list of options to enable the FCFID instruction.
+
2012-04-12 Richard Earnshaw <rearnsha@arm.com>
PR target/49448
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 905321ceb78..1ed50cddbb3 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20120413
+20120626
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index f3c535fd1ba..ec6af72bd9c 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,12 @@
+2012-05-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (variant_desc): Rename 'record' to 'new_type'.
+ (build_variant_list): Adjust to above renaming.
+ (gnat_to_gnu_entity) <E_Record_Subtype>: Likewise. Give a unique name
+ to the type of the variant containers.
+ (create_variant_part_from): Likewise. Give a unique name to the type
+ of the variant part.
+
2012-03-01 Release Manager
* GCC 4.6.3 released.
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 9c6831013f8..2394834252f 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -120,8 +120,8 @@ typedef struct variant_desc_d {
/* The value of the qualifier. */
tree qual;
- /* The record associated with this variant. */
- tree record;
+ /* The type of the variant after transformation. */
+ tree new_type;
} variant_desc;
DEF_VEC_O(variant_desc);
@@ -3157,11 +3157,16 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
{
tree old_variant = v->type;
tree new_variant = make_node (RECORD_TYPE);
+ tree suffix
+ = concat_name (DECL_NAME (gnu_variant_part),
+ IDENTIFIER_POINTER
+ (DECL_NAME (v->field)));
TYPE_NAME (new_variant)
- = DECL_NAME (TYPE_NAME (old_variant));
+ = concat_name (TYPE_NAME (gnu_type),
+ IDENTIFIER_POINTER (suffix));
copy_and_substitute_in_size (new_variant, old_variant,
gnu_subst_list);
- v->record = new_variant;
+ v->new_type = new_variant;
}
}
else
@@ -3265,7 +3270,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
if (selected_variant)
gnu_cont_type = gnu_type;
else
- gnu_cont_type = v->record;
+ gnu_cont_type = v->new_type;
}
else
/* The front-end may pass us "ghost" components if
@@ -7704,7 +7709,7 @@ build_variant_list (tree qual_union_type, VEC(subst_pair,heap) *subst_list,
v->type = variant_type;
v->field = gnu_field;
v->qual = qual;
- v->record = NULL_TREE;
+ v->new_type = NULL_TREE;
/* Recurse on the variant subpart of the variant, if any. */
variant_subpart = get_variant_part (variant_type);
@@ -8457,7 +8462,9 @@ create_variant_part_from (tree old_variant_part,
/* First create the type of the variant part from that of the old one. */
new_union_type = make_node (QUAL_UNION_TYPE);
- TYPE_NAME (new_union_type) = DECL_NAME (TYPE_NAME (old_union_type));
+ TYPE_NAME (new_union_type)
+ = concat_name (TYPE_NAME (record_type),
+ IDENTIFIER_POINTER (DECL_NAME (old_variant_part)));
/* If the position of the variant part is constant, subtract it from the
size of the type of the parent to get the new size. This manual CSE
@@ -8491,7 +8498,7 @@ create_variant_part_from (tree old_variant_part,
continue;
/* Retrieve the list of fields already added to the new variant. */
- new_variant = v->record;
+ new_variant = v->new_type;
field_list = TYPE_FIELDS (new_variant);
/* If the old variant had a variant subpart, we need to create a new
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index cd68a05a6cf..22d93a041c2 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -4315,6 +4315,11 @@ build_conditional_expr (location_t colon_loc, tree ifexp, bool ifexp_bcp,
ret = fold_build3_loc (colon_loc, COND_EXPR, result_type, ifexp, op1, op2);
else
{
+ if (int_operands)
+ {
+ op1 = remove_c_maybe_const_expr (op1);
+ op2 = remove_c_maybe_const_expr (op2);
+ }
ret = build3 (COND_EXPR, result_type, ifexp, op1, op2);
if (int_operands)
ret = note_integer_operands (ret);
diff --git a/gcc/config.gcc b/gcc/config.gcc
index dd13613c5b3..0a7038324f6 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -946,7 +946,7 @@ avr-*-rtems*)
extra_objs="avr-devices.o"
;;
avr-*-*)
- tm_file="avr/avr.h dbxelf.h newlib-stdint.h"
+ tm_file="avr/avr.h dbxelf.h avr/avr-stdint.h"
use_gcc_stdint=wrap
extra_gcc_objs="driver-avr.o avr-devices.o"
extra_objs="avr-devices.o"
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 34ec9674727..2f4873eb6c2 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -2469,7 +2469,7 @@ alpha_emit_conditional_branch (rtx operands[], enum machine_mode cmp_mode)
{
case EQ: case LE: case LT: case LEU: case LTU:
case UNORDERED:
- /* We have these compares: */
+ /* We have these compares. */
cmp_code = code, branch_code = NE;
break;
@@ -2706,13 +2706,15 @@ alpha_emit_conditional_move (rtx cmp, enum machine_mode mode)
switch (code)
{
case EQ: case LE: case LT: case LEU: case LTU:
+ case UNORDERED:
/* We have these compares. */
cmp_code = code, code = NE;
break;
case NE:
- /* This must be reversed. */
- cmp_code = EQ, code = EQ;
+ case ORDERED:
+ /* These must be reversed. */
+ cmp_code = reverse_condition (code), code = EQ;
break;
case GE: case GT: case GEU: case GTU:
@@ -2732,6 +2734,14 @@ alpha_emit_conditional_move (rtx cmp, enum machine_mode mode)
gcc_unreachable ();
}
+ if (cmp_mode == DImode)
+ {
+ if (!reg_or_0_operand (op0, DImode))
+ op0 = force_reg (DImode, op0);
+ if (!reg_or_8bit_operand (op1, DImode))
+ op1 = force_reg (DImode, op1);
+ }
+
tem = gen_reg_rtx (cmp_mode);
emit_insn (gen_rtx_SET (VOIDmode, tem,
gen_rtx_fmt_ee (cmp_code, cmp_mode,
@@ -2743,6 +2753,14 @@ alpha_emit_conditional_move (rtx cmp, enum machine_mode mode)
local_fast_math = 1;
}
+ if (cmp_mode == DImode)
+ {
+ if (!reg_or_0_operand (op0, DImode))
+ op0 = force_reg (DImode, op0);
+ if (!reg_or_8bit_operand (op1, DImode))
+ op1 = force_reg (DImode, op1);
+ }
+
/* We may be able to use a conditional move directly.
This avoids emitting spurious compares. */
if (signed_comparison_operator (cmp, VOIDmode)
@@ -2761,11 +2779,13 @@ alpha_emit_conditional_move (rtx cmp, enum machine_mode mode)
switch (code)
{
case EQ: case LE: case LT: case LEU: case LTU:
+ case UNORDERED:
/* We have these compares: */
break;
case NE:
- /* This must be reversed. */
+ case ORDERED:
+ /* These must be reversed. */
code = reverse_condition (code);
cmov_code = EQ;
break;
diff --git a/gcc/config/alpha/linux-unwind.h b/gcc/config/alpha/linux-unwind.h
index 4c811dca4bf..8c04b3b415f 100644
--- a/gcc/config/alpha/linux-unwind.h
+++ b/gcc/config/alpha/linux-unwind.h
@@ -1,5 +1,5 @@
/* DWARF2 EH unwinding support for Alpha Linux.
- Copyright (C) 2004, 2005, 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2009, 2011, 2012 Free Software Foundation, Inc.
This file is part of GCC.
@@ -49,7 +49,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
else if (pc[1] == 0x201f015f) /* lda $0,NR_rt_sigreturn */
{
struct rt_sigframe {
- struct siginfo info;
+ siginfo_t info;
struct ucontext uc;
} *rt_ = context->cfa;
sc = &rt_->uc.uc_mcontext;
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index a5edf04b9ed..db2d723ba97 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -23423,8 +23423,11 @@ arm_output_sync_loop (emit_f emit,
}
}
- arm_process_output_memory_barrier (emit, NULL);
+ /* Note: label is before barrier so that in cmp failure case we still get
+ a barrier to stop subsequent loads floating upwards past the ldrex
+ PR target/48126. */
arm_output_asm_insn (emit, 1, operands, "%sLSYB%%=:", LOCAL_LABEL_PREFIX);
+ arm_process_output_memory_barrier (emit, NULL);
}
static rtx
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 151d3141381..292b48f96de 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -294,7 +294,8 @@ extern void (*arm_lang_output_object_attributes_hook)(void);
#define TARGET_HAVE_DMB (arm_arch7)
/* Nonzero if this chip implements a memory barrier via CP15. */
-#define TARGET_HAVE_DMB_MCR (arm_arch6k && ! TARGET_HAVE_DMB)
+#define TARGET_HAVE_DMB_MCR (arm_arch6 && ! TARGET_HAVE_DMB \
+ && ! TARGET_THUMB1)
/* Nonzero if this chip implements a memory barrier instruction. */
#define TARGET_HAVE_MEMORY_BARRIER (TARGET_HAVE_DMB || TARGET_HAVE_DMB_MCR)
diff --git a/gcc/config/avr/avr-stdint.h b/gcc/config/avr/avr-stdint.h
new file mode 100644
index 00000000000..c3ec3ce9fd5
--- /dev/null
+++ b/gcc/config/avr/avr-stdint.h
@@ -0,0 +1,66 @@
+/* Definitions for <stdint.h> types on systems using newlib.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+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/>. */
+
+/*
+ The intention of this file is to supply definitions that work with
+ avr-gcc's -mint8 that sets int to an 8-bit type.
+
+ This file is intended to yield the same results as newlib-stdint.h,
+ but there are some differences to newlib-stdint.h:
+
+ - AVR is an 8-bit architecture that cannot access 16-bit values
+ atomically, this SIG_ATOMIC_TYPE is "char".
+
+ - For the same reason, [u]int_fast8_t is defined as 8-bit type.
+
+*/
+
+#define SIG_ATOMIC_TYPE "char"
+
+#define INT8_TYPE "signed char"
+#define INT16_TYPE (INT_TYPE_SIZE == 16 ? "short int" : "long int")
+#define INT32_TYPE (INT_TYPE_SIZE == 16 ? "long int" : "long long int")
+#define INT64_TYPE (INT_TYPE_SIZE == 16 ? "long long int" : 0)
+#define UINT8_TYPE "unsigned char"
+#define UINT16_TYPE (INT_TYPE_SIZE == 16 ? "short unsigned int" : "long unsigned int")
+#define UINT32_TYPE (INT_TYPE_SIZE == 16 ? "long unsigned int" : "long long unsigned int")
+#define UINT64_TYPE (INT_TYPE_SIZE == 16 ? "long long unsigned int" : 0)
+
+#define INT_LEAST8_TYPE INT8_TYPE
+#define INT_LEAST16_TYPE INT16_TYPE
+#define INT_LEAST32_TYPE INT32_TYPE
+#define INT_LEAST64_TYPE INT64_TYPE
+#define UINT_LEAST8_TYPE UINT8_TYPE
+#define UINT_LEAST16_TYPE UINT16_TYPE
+#define UINT_LEAST32_TYPE UINT32_TYPE
+#define UINT_LEAST64_TYPE UINT64_TYPE
+
+#define INT_FAST8_TYPE INT8_TYPE
+#define INT_FAST16_TYPE (INT_TYPE_SIZE == 16 ? "int" : INT16_TYPE)
+#define INT_FAST32_TYPE INT32_TYPE
+#define INT_FAST64_TYPE INT64_TYPE
+#define UINT_FAST8_TYPE UINT8_TYPE
+#define UINT_FAST16_TYPE (INT_TYPE_SIZE == 16 ? "unsigned int" : UINT16_TYPE)
+#define UINT_FAST32_TYPE UINT32_TYPE
+#define UINT_FAST64_TYPE UINT64_TYPE
+
+#define INTPTR_TYPE PTRDIFF_TYPE
+#ifndef UINTPTR_TYPE
+#define UINTPTR_TYPE SIZE_TYPE
+#endif
diff --git a/gcc/config/bfin/linux-unwind.h b/gcc/config/bfin/linux-unwind.h
index 88c8285632d..15bb2f12b69 100644
--- a/gcc/config/bfin/linux-unwind.h
+++ b/gcc/config/bfin/linux-unwind.h
@@ -1,5 +1,5 @@
/* DWARF2 EH unwinding support for Blackfin.
- Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009, 2012 Free Software Foundation, Inc.
This file is part of GCC.
@@ -48,10 +48,10 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
{
struct rt_sigframe {
int sig;
- struct siginfo *pinfo;
+ siginfo_t *pinfo;
void *puc;
char retcode[8];
- struct siginfo info;
+ siginfo_t info;
struct ucontext uc;
} *rt_ = context->cfa;
diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c
index 0b5fd99d4d0..1871ae48504 100644
--- a/gcc/config/i386/driver-i386.c
+++ b/gcc/config/i386/driver-i386.c
@@ -397,6 +397,7 @@ const char *host_detect_local_cpu (int argc, const char **argv)
unsigned int has_pclmul = 0, has_abm = 0, has_lwp = 0;
unsigned int has_fma = 0, has_fma4 = 0, has_xop = 0;
unsigned int has_bmi = 0, has_tbm = 0;
+ unsigned int has_rdrnd = 0, has_f16c = 0, has_fsgsbase = 0;
bool arch;
@@ -444,6 +445,8 @@ const char *host_detect_local_cpu (int argc, const char **argv)
has_aes = ecx & bit_AES;
has_pclmul = ecx & bit_PCLMUL;
has_fma = ecx & bit_FMA;
+ has_f16c = ecx & bit_F16C;
+ has_rdrnd = ecx & bit_RDRND;
has_cmpxchg8b = edx & bit_CMPXCHG8B;
has_cmov = edx & bit_CMOV;
@@ -451,6 +454,13 @@ const char *host_detect_local_cpu (int argc, const char **argv)
has_sse = edx & bit_SSE;
has_sse2 = edx & bit_SSE2;
+ if (max_level >= 7)
+ {
+ __cpuid_count (7, 0, eax, ebx, ecx, edx);
+
+ has_fsgsbase = ebx & bit_FSGSBASE;
+ }
+
/* Check cpuid level of extended features. */
__cpuid (0x80000000, ext_level, ebx, ecx, edx);
@@ -711,10 +721,13 @@ const char *host_detect_local_cpu (int argc, const char **argv)
const char *avx = has_avx ? " -mavx" : " -mno-avx";
const char *sse4_2 = has_sse4_2 ? " -msse4.2" : " -mno-sse4.2";
const char *sse4_1 = has_sse4_1 ? " -msse4.1" : " -mno-sse4.1";
+ const char *rdrnd = has_rdrnd ? " -mrdrnd" : " -mno-rdrnd";
+ const char *f16c = has_f16c ? " -mf16c" : " -mno-f16c";
+ const char *fsgsbase = has_fsgsbase ? " -mfsgsbase" : " -mno-fsgsbase";
options = concat (options, cx16, sahf, movbe, ase, pclmul,
popcnt, abm, lwp, fma, fma4, xop, bmi, tbm,
- avx, sse4_2, sse4_1, NULL);
+ avx, sse4_2, sse4_1, rdrnd, f16c, fsgsbase, NULL);
}
done:
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index e98c4dd2dcc..aa51739c884 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -2095,7 +2095,7 @@ unsigned char ix86_arch_features[X86_ARCH_LAST];
/* Feature tests against the various architecture variations, used to create
ix86_arch_features based on the processor mask. */
static unsigned int initial_ix86_arch_features[X86_ARCH_LAST] = {
- /* X86_ARCH_CMOVE: Conditional move was added for pentiumpro. */
+ /* X86_ARCH_CMOV: Conditional move was added for pentiumpro. */
~(m_386 | m_486 | m_PENT | m_K6),
/* X86_ARCH_CMPXCHG: Compare and exchange was added for 80486. */
@@ -3884,7 +3884,7 @@ ix86_option_override_internal (bool main_args_p)
-mtune (rather than -march) points us to a processor that has them.
However, the VIA C3 gives a SIGILL, so we only do that for i686 and
higher processors. */
- if (TARGET_CMOVE
+ if (TARGET_CMOV
&& (processor_alias_table[i].flags & (PTA_PREFETCH_SSE | PTA_SSE)))
x86_prefetch_sse = true;
break;
@@ -4254,12 +4254,6 @@ ix86_option_override_internal (bool main_args_p)
target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS;
}
- /* For sane SSE instruction set generation we need fcomi instruction.
- It is safe to enable all CMOVE instructions. Also, RDRAND intrinsic
- expands to a sequence that includes conditional move. */
- if (TARGET_SSE || TARGET_RDRND)
- TARGET_CMOVE = 1;
-
/* Figure out what ASM_GENERATE_INTERNAL_LABEL builds as a prefix. */
{
char *p;
@@ -27446,8 +27440,8 @@ ix86_expand_special_args_builtin (const struct builtin_description *d,
arg_adjust = 0;
if (optimize
|| target == 0
- || GET_MODE (target) != tmode
- || !insn_p->operand[0].predicate (target, tmode))
+ || !register_operand (target, tmode)
+ || GET_MODE (target) != tmode)
target = gen_reg_rtx (tmode);
}
@@ -31646,9 +31640,9 @@ ix86_expand_vector_set (bool mmx_ok, rtx target, rtx val, int elt)
tmp = gen_reg_rtx (GET_MODE_INNER (mode));
ix86_expand_vector_extract (true, tmp, target, 1 - elt);
if (elt == 0)
- tmp = gen_rtx_VEC_CONCAT (mode, tmp, val);
- else
tmp = gen_rtx_VEC_CONCAT (mode, val, tmp);
+ else
+ tmp = gen_rtx_VEC_CONCAT (mode, tmp, val);
emit_insn (gen_rtx_SET (VOIDmode, target, tmp));
return;
}
@@ -31662,9 +31656,9 @@ ix86_expand_vector_set (bool mmx_ok, rtx target, rtx val, int elt)
tmp = gen_reg_rtx (GET_MODE_INNER (mode));
ix86_expand_vector_extract (false, tmp, target, 1 - elt);
if (elt == 0)
- tmp = gen_rtx_VEC_CONCAT (mode, tmp, val);
- else
tmp = gen_rtx_VEC_CONCAT (mode, val, tmp);
+ else
+ tmp = gen_rtx_VEC_CONCAT (mode, tmp, val);
emit_insn (gen_rtx_SET (VOIDmode, target, tmp));
return;
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 030b72d0b58..67cae2cc85b 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -426,7 +426,7 @@ extern unsigned char ix86_tune_features[X86_TUNE_LAST];
/* Feature tests against the various architecture variations. */
enum ix86_arch_indices {
- X86_ARCH_CMOVE, /* || TARGET_SSE */
+ X86_ARCH_CMOV,
X86_ARCH_CMPXCHG,
X86_ARCH_CMPXCHG8B,
X86_ARCH_XADD,
@@ -437,12 +437,17 @@ enum ix86_arch_indices {
extern unsigned char ix86_arch_features[X86_ARCH_LAST];
-#define TARGET_CMOVE ix86_arch_features[X86_ARCH_CMOVE]
+#define TARGET_CMOV ix86_arch_features[X86_ARCH_CMOV]
#define TARGET_CMPXCHG ix86_arch_features[X86_ARCH_CMPXCHG]
#define TARGET_CMPXCHG8B ix86_arch_features[X86_ARCH_CMPXCHG8B]
#define TARGET_XADD ix86_arch_features[X86_ARCH_XADD]
#define TARGET_BSWAP ix86_arch_features[X86_ARCH_BSWAP]
+/* For sane SSE instruction set generation we need fcomi instruction.
+ It is safe to enable all CMOVE instructions. Also, RDRAND intrinsic
+ expands to a sequence that includes conditional move. */
+#define TARGET_CMOVE (TARGET_CMOV || TARGET_SSE || TARGET_RDRND)
+
#define TARGET_FISTTP (TARGET_SSE3 && TARGET_80387)
extern int x86_prefetch_sse;
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 3010977075c..1251458658f 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -233,9 +233,6 @@
;; For BMI support
UNSPEC_BEXTR
-
- ;; For RDRAND support
- UNSPEC_RDRAND
])
(define_c_enum "unspecv" [
@@ -270,6 +267,9 @@
UNSPECV_WRFSBASE
UNSPECV_WRGSBASE
UNSPECV_SPLIT_STACK_RETURN
+
+ ;; For RDRAND support
+ UNSPECV_RDRAND
])
;; Constants to represent pcomtrue/pcomfalse variants
@@ -16407,7 +16407,8 @@
(define_insn "*x86_mov<mode>cc_0_m1_neg"
[(set (match_operand:SWI48 0 "register_operand" "=r")
(neg:SWI48 (match_operator 1 "ix86_carry_flag_operator"
- [(reg FLAGS_REG) (const_int 0)])))]
+ [(reg FLAGS_REG) (const_int 0)])))
+ (clobber (reg:CC FLAGS_REG))]
""
"sbb{<imodesuffix>}\t%0, %0"
[(set_attr "type" "alu")
@@ -18415,9 +18416,9 @@
(define_insn "rdrand<mode>_1"
[(set (match_operand:SWI248 0 "register_operand" "=r")
- (unspec:SWI248 [(const_int 0)] UNSPEC_RDRAND))
+ (unspec_volatile:SWI248 [(const_int 0)] UNSPECV_RDRAND))
(set (reg:CCC FLAGS_REG)
- (unspec:CCC [(const_int 0)] UNSPEC_RDRAND))]
+ (unspec_volatile:CCC [(const_int 0)] UNSPECV_RDRAND))]
"TARGET_RDRND"
"rdrand\t%0"
[(set_attr "type" "other")
diff --git a/gcc/config/i386/linux-unwind.h b/gcc/config/i386/linux-unwind.h
index c5f7ea0e873..9e4be80109b 100644
--- a/gcc/config/i386/linux-unwind.h
+++ b/gcc/config/i386/linux-unwind.h
@@ -1,5 +1,6 @@
/* DWARF2 EH unwinding support for AMD x86-64 and x86.
- Copyright (C) 2004, 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006, 2009, 2010, 2012 Free Software Foundation,
+ Inc.
This file is part of GCC.
@@ -133,9 +134,9 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
{
struct rt_sigframe {
int sig;
- struct siginfo *pinfo;
+ siginfo_t *pinfo;
void *puc;
- struct siginfo info;
+ siginfo_t info;
struct ucontext uc;
} *rt_ = context->cfa;
/* The void * cast is necessary to avoid an aliasing warning.
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 1c61dbb3ade..938c073df90 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -392,18 +392,7 @@
DONE;
})
-(define_expand "avx_movu<ssemodesuffix><avxmodesuffix>"
- [(set (match_operand:AVXMODEF2P 0 "nonimmediate_operand" "")
- (unspec:AVXMODEF2P
- [(match_operand:AVXMODEF2P 1 "nonimmediate_operand" "")]
- UNSPEC_MOVU))]
- "AVX_VEC_FLOAT_MODE_P (<MODE>mode)"
-{
- if (MEM_P (operands[0]) && MEM_P (operands[1]))
- operands[1] = force_reg (<MODE>mode, operands[1]);
-})
-
-(define_insn "*avx_movu<ssemodesuffix><avxmodesuffix>"
+(define_insn "avx_movu<ssemodesuffix><avxmodesuffix>"
[(set (match_operand:AVXMODEF2P 0 "nonimmediate_operand" "=x,m")
(unspec:AVXMODEF2P
[(match_operand:AVXMODEF2P 1 "nonimmediate_operand" "xm,x")]
@@ -429,18 +418,7 @@
(set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
-(define_expand "<sse>_movu<ssemodesuffix>"
- [(set (match_operand:SSEMODEF2P 0 "nonimmediate_operand" "")
- (unspec:SSEMODEF2P
- [(match_operand:SSEMODEF2P 1 "nonimmediate_operand" "")]
- UNSPEC_MOVU))]
- "SSE_VEC_FLOAT_MODE_P (<MODE>mode)"
-{
- if (MEM_P (operands[0]) && MEM_P (operands[1]))
- operands[1] = force_reg (<MODE>mode, operands[1]);
-})
-
-(define_insn "*<sse>_movu<ssemodesuffix>"
+(define_insn "<sse>_movu<ssemodesuffix>"
[(set (match_operand:SSEMODEF2P 0 "nonimmediate_operand" "=x,m")
(unspec:SSEMODEF2P
[(match_operand:SSEMODEF2P 1 "nonimmediate_operand" "xm,x")]
@@ -452,18 +430,7 @@
(set_attr "movu" "1")
(set_attr "mode" "<MODE>")])
-(define_expand "avx_movdqu<avxmodesuffix>"
- [(set (match_operand:AVXMODEQI 0 "nonimmediate_operand" "")
- (unspec:AVXMODEQI
- [(match_operand:AVXMODEQI 1 "nonimmediate_operand" "")]
- UNSPEC_MOVU))]
- "TARGET_AVX"
-{
- if (MEM_P (operands[0]) && MEM_P (operands[1]))
- operands[1] = force_reg (<MODE>mode, operands[1]);
-})
-
-(define_insn "*avx_movdqu<avxmodesuffix>"
+(define_insn "avx_movdqu<avxmodesuffix>"
[(set (match_operand:AVXMODEQI 0 "nonimmediate_operand" "=x,m")
(unspec:AVXMODEQI
[(match_operand:AVXMODEQI 1 "nonimmediate_operand" "xm,x")]
@@ -475,17 +442,7 @@
(set_attr "prefix" "vex")
(set_attr "mode" "<avxvecmode>")])
-(define_expand "sse2_movdqu"
- [(set (match_operand:V16QI 0 "nonimmediate_operand" "")
- (unspec:V16QI [(match_operand:V16QI 1 "nonimmediate_operand" "")]
- UNSPEC_MOVU))]
- "TARGET_SSE2"
-{
- if (MEM_P (operands[0]) && MEM_P (operands[1]))
- operands[1] = force_reg (V16QImode, operands[1]);
-})
-
-(define_insn "*sse2_movdqu"
+(define_insn "sse2_movdqu"
[(set (match_operand:V16QI 0 "nonimmediate_operand" "=x,m")
(unspec:V16QI [(match_operand:V16QI 1 "nonimmediate_operand" "xm,x")]
UNSPEC_MOVU))]
@@ -12095,7 +12052,7 @@
(unspec:V8SF [(match_operand:V8HI 1 "register_operand" "x")]
UNSPEC_VCVTPH2PS)
(parallel [(const_int 0) (const_int 1)
- (const_int 1) (const_int 2)])))]
+ (const_int 2) (const_int 3)])))]
"TARGET_F16C"
"vcvtph2ps\t{%1, %0|%0, %1}"
[(set_attr "type" "ssecvt")
diff --git a/gcc/config/ia64/linux-unwind.h b/gcc/config/ia64/linux-unwind.h
index 93f762de573..da31259782b 100644
--- a/gcc/config/ia64/linux-unwind.h
+++ b/gcc/config/ia64/linux-unwind.h
@@ -1,5 +1,5 @@
/* DWARF2 EH unwinding support for IA64 Linux.
- Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2009, 2012 Free Software Foundation, Inc.
This file is part of GCC.
@@ -47,7 +47,7 @@ ia64_fallback_frame_state (struct _Unwind_Context *context,
struct sigframe {
char scratch[16];
unsigned long sig_number;
- struct siginfo *info;
+ siginfo_t *info;
struct sigcontext *sc;
} *frame_ = (struct sigframe *)context->psp;
struct sigcontext *sc = frame_->sc;
@@ -137,7 +137,7 @@ ia64_handle_unwabi (struct _Unwind_Context *context, _Unwind_FrameState *fs)
struct sigframe {
char scratch[16];
unsigned long sig_number;
- struct siginfo *info;
+ siginfo_t *info;
struct sigcontext *sc;
} *frame = (struct sigframe *)context->psp;
struct sigcontext *sc = frame->sc;
diff --git a/gcc/config/mips/linux-unwind.h b/gcc/config/mips/linux-unwind.h
index 02f7cd54c5a..094ff58cb03 100644
--- a/gcc/config/mips/linux-unwind.h
+++ b/gcc/config/mips/linux-unwind.h
@@ -1,5 +1,6 @@
/* DWARF2 EH unwinding support for MIPS Linux.
- Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2012 Free Software
+ Foundation, Inc.
This file is part of GCC.
@@ -75,7 +76,7 @@ mips_fallback_frame_state (struct _Unwind_Context *context,
struct rt_sigframe {
u_int32_t ass[4]; /* Argument save space for o32. */
u_int32_t trampoline[2];
- struct siginfo info;
+ siginfo_t info;
_sig_ucontext_t uc;
} *rt_ = context->cfa;
sc = &rt_->uc.uc_mcontext;
diff --git a/gcc/config/pa/linux-unwind.h b/gcc/config/pa/linux-unwind.h
index a0560e97445..38b4eda7aee 100644
--- a/gcc/config/pa/linux-unwind.h
+++ b/gcc/config/pa/linux-unwind.h
@@ -1,5 +1,5 @@
/* DWARF2 EH unwinding support for PA Linux.
- Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2009, 2012 Free Software Foundation, Inc.
This file is part of GCC.
@@ -63,7 +63,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
int i;
struct sigcontext *sc;
struct rt_sigframe {
- struct siginfo info;
+ siginfo_t info;
struct ucontext uc;
} *frame;
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 5e5a0f05b79..83e6e859e78 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -185,6 +185,7 @@ static bool pa_can_eliminate (const int, const int);
static void pa_conditional_register_usage (void);
static enum machine_mode pa_c_mode_for_suffix (char);
static section *pa_function_section (tree, enum node_frequency, bool, bool);
+static unsigned int pa_section_type_flags (tree, const char *, int);
/* The following extra sections are only used for SOM. */
static GTY(()) section *som_readonly_data_section;
@@ -400,6 +401,9 @@ static const struct default_options pa_option_optimization_table[] =
#undef TARGET_ASM_FUNCTION_SECTION
#define TARGET_ASM_FUNCTION_SECTION pa_function_section
+#undef TARGET_SECTION_TYPE_FLAGS
+#define TARGET_SECTION_TYPE_FLAGS pa_section_type_flags
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Parse the -mfixed-range= option string. */
@@ -7540,7 +7544,7 @@ attr_length_millicode_call (rtx insn)
return 24;
else
{
- if (!TARGET_LONG_CALLS && distance < 240000)
+ if (!TARGET_LONG_CALLS && distance < MAX_PCREL17F_OFFSET)
return 8;
if (TARGET_LONG_ABS_CALL && !flag_pic)
@@ -7753,7 +7757,7 @@ attr_length_call (rtx insn, int sibcall)
/* pc-relative branch. */
if (!TARGET_LONG_CALLS
&& ((TARGET_PA_20 && !sibcall && distance < 7600000)
- || distance < 240000))
+ || distance < MAX_PCREL17F_OFFSET))
length += 8;
/* 64-bit plabel sequence. */
@@ -8112,7 +8116,7 @@ attr_length_indirect_call (rtx insn)
if (TARGET_FAST_INDIRECT_CALLS
|| (!TARGET_PORTABLE_RUNTIME
&& ((TARGET_PA_20 && !TARGET_SOM && distance < 7600000)
- || distance < 240000)))
+ || distance < MAX_PCREL17F_OFFSET)))
return 8;
if (flag_pic)
@@ -10431,4 +10435,23 @@ pa_function_section (tree decl, enum node_frequency freq,
return default_function_section (decl, freq, startup, exit);
}
+/* Implement TARGET_SECTION_TYPE_FLAGS. */
+
+static unsigned int
+pa_section_type_flags (tree decl, const char *name, int reloc)
+{
+ unsigned int flags;
+
+ flags = default_section_type_flags (decl, name, reloc);
+
+ /* Function labels are placed in the constant pool. This can
+ cause a section conflict if decls are put in ".data.rel.ro"
+ or ".data.rel.ro.local" using the __attribute__ construct. */
+ if (strcmp (name, ".data.rel.ro") == 0
+ || strcmp (name, ".data.rel.ro.local") == 0)
+ flags |= SECTION_WRITE | SECTION_RELRO;
+
+ return flags;
+}
+
#include "gt-pa.h"
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 012186854de..e59cd5d4578 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -1563,3 +1563,12 @@ do { \
#undef TARGET_HAVE_TLS
#define TARGET_HAVE_TLS true
#endif
+
+/* The maximum offset in bytes for a PA 1.X pc-relative call to the
+ head of the preceding stub table. The selected offsets have been
+ chosen so that approximately one call stub is allocated for every
+ 86.7 instructions. A long branch stub is two instructions when
+ not generating PIC code. For HP-UX and ELF targets, PIC stubs are
+ seven and four instructions, respectively. */
+#define MAX_PCREL17F_OFFSET \
+ (flag_pic ? (TARGET_HPUX ? 198164 : 221312) : 240000)
diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md
index 80e82cc9c29..9fbced17365 100644
--- a/gcc/config/rs6000/altivec.md
+++ b/gcc/config/rs6000/altivec.md
@@ -2394,8 +2394,8 @@
(define_insn "altivec_stvlx"
[(parallel
- [(set (match_operand:V4SI 0 "memory_operand" "=Z")
- (match_operand:V4SI 1 "register_operand" "v"))
+ [(set (match_operand:V16QI 0 "memory_operand" "=Z")
+ (match_operand:V16QI 1 "register_operand" "v"))
(unspec [(const_int 0)] UNSPEC_STVLX)])]
"TARGET_ALTIVEC && rs6000_cpu == PROCESSOR_CELL"
"stvlx %1,%y0"
@@ -2403,8 +2403,8 @@
(define_insn "altivec_stvlxl"
[(parallel
- [(set (match_operand:V4SI 0 "memory_operand" "=Z")
- (match_operand:V4SI 1 "register_operand" "v"))
+ [(set (match_operand:V16QI 0 "memory_operand" "=Z")
+ (match_operand:V16QI 1 "register_operand" "v"))
(unspec [(const_int 0)] UNSPEC_STVLXL)])]
"TARGET_ALTIVEC && rs6000_cpu == PROCESSOR_CELL"
"stvlxl %1,%y0"
@@ -2412,8 +2412,8 @@
(define_insn "altivec_stvrx"
[(parallel
- [(set (match_operand:V4SI 0 "memory_operand" "=Z")
- (match_operand:V4SI 1 "register_operand" "v"))
+ [(set (match_operand:V16QI 0 "memory_operand" "=Z")
+ (match_operand:V16QI 1 "register_operand" "v"))
(unspec [(const_int 0)] UNSPEC_STVRX)])]
"TARGET_ALTIVEC && rs6000_cpu == PROCESSOR_CELL"
"stvrx %1,%y0"
@@ -2421,8 +2421,8 @@
(define_insn "altivec_stvrxl"
[(parallel
- [(set (match_operand:V4SI 0 "memory_operand" "=Z")
- (match_operand:V4SI 1 "register_operand" "v"))
+ [(set (match_operand:V16QI 0 "memory_operand" "=Z")
+ (match_operand:V16QI 1 "register_operand" "v"))
(unspec [(const_int 0)] UNSPEC_STVRXL)])]
"TARGET_ALTIVEC && rs6000_cpu == PROCESSOR_CELL"
"stvrxl %1,%y0"
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 5c101a51aff..36aba430eb9 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -15822,7 +15822,6 @@ void
print_operand (FILE *file, rtx x, int code)
{
int i;
- HOST_WIDE_INT val;
unsigned HOST_WIDE_INT uval;
switch (code)
@@ -16263,34 +16262,17 @@ print_operand (FILE *file, rtx x, int code)
case 'W':
/* MB value for a PowerPC64 rldic operand. */
- val = (GET_CODE (x) == CONST_INT
- ? INTVAL (x) : CONST_DOUBLE_HIGH (x));
-
- if (val < 0)
- i = -1;
- else
- for (i = 0; i < HOST_BITS_PER_WIDE_INT; i++)
- if ((val <<= 1) < 0)
- break;
+ i = clz_hwi (GET_CODE (x) == CONST_INT
+ ? INTVAL (x) : CONST_DOUBLE_HIGH (x));
#if HOST_BITS_PER_WIDE_INT == 32
- if (GET_CODE (x) == CONST_INT && i >= 0)
+ if (GET_CODE (x) == CONST_INT && i > 0)
i += 32; /* zero-extend high-part was all 0's */
else if (GET_CODE (x) == CONST_DOUBLE && i == 32)
- {
- val = CONST_DOUBLE_LOW (x);
-
- gcc_assert (val);
- if (val < 0)
- --i;
- else
- for ( ; i < 64; i++)
- if ((val <<= 1) < 0)
- break;
- }
+ i = clz_hwi (CONST_DOUBLE_LOW (x)) + 32;
#endif
- fprintf (file, "%d", i + 1);
+ fprintf (file, "%d", i);
return;
case 'x':
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index a8d42398ec5..0eae3265a0f 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -469,10 +469,11 @@ extern int rs6000_vector_align[];
/* ISA 2.01 allowed FCFID to be done in 32-bit, previously it was 64-bit only.
Enable 32-bit fcfid's on any of the switches for newer ISA machines or
XILINX. */
-#define TARGET_FCFID (TARGET_POWERPC64 \
- || TARGET_POPCNTB /* ISA 2.02 */ \
- || TARGET_CMPB /* ISA 2.05 */ \
- || TARGET_POPCNTD /* ISA 2.06 */ \
+#define TARGET_FCFID (TARGET_POWERPC64 \
+ || TARGET_PPC_GPOPT /* 970/power4 */ \
+ || TARGET_POPCNTB /* ISA 2.02 */ \
+ || TARGET_CMPB /* ISA 2.05 */ \
+ || TARGET_POPCNTD /* ISA 2.06 */ \
|| TARGET_XILINX_FPU)
#define TARGET_FCTIDZ TARGET_FCFID
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 16be86c27a4..7befb56a378 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -2524,7 +2524,18 @@
if (GET_CODE (addr1) == PLUS)
{
emit_insn (gen_add3_insn (op2, XEXP (addr1, 0), GEN_INT (4)));
- addr2 = gen_rtx_PLUS (Pmode, op2, XEXP (addr1, 1));
+ if (TARGET_AVOID_XFORM)
+ {
+ emit_insn (gen_add3_insn (op2, XEXP (addr1, 1), op2));
+ addr2 = op2;
+ }
+ else
+ addr2 = gen_rtx_PLUS (Pmode, op2, XEXP (addr1, 1));
+ }
+ else if (TARGET_AVOID_XFORM)
+ {
+ emit_insn (gen_add3_insn (op2, addr1, GEN_INT (4)));
+ addr2 = op2;
}
else
{
@@ -2574,7 +2585,18 @@
if (GET_CODE (addr1) == PLUS)
{
emit_insn (gen_add3_insn (op2, XEXP (addr1, 0), GEN_INT (4)));
- addr2 = gen_rtx_PLUS (Pmode, op2, XEXP (addr1, 1));
+ if (TARGET_AVOID_XFORM)
+ {
+ emit_insn (gen_add3_insn (op2, XEXP (addr1, 1), op2));
+ addr2 = op2;
+ }
+ else
+ addr2 = gen_rtx_PLUS (Pmode, op2, XEXP (addr1, 1));
+ }
+ else if (TARGET_AVOID_XFORM)
+ {
+ emit_insn (gen_add3_insn (op2, addr1, GEN_INT (4)));
+ addr2 = op2;
}
else
{
@@ -2655,7 +2677,18 @@
if (GET_CODE (addr1) == PLUS)
{
emit_insn (gen_add3_insn (op2, XEXP (addr1, 0), GEN_INT (4)));
- addr2 = gen_rtx_PLUS (SImode, op2, XEXP (addr1, 1));
+ if (TARGET_AVOID_XFORM)
+ {
+ emit_insn (gen_add3_insn (op2, XEXP (addr1, 1), op2));
+ addr2 = op2;
+ }
+ else
+ addr2 = gen_rtx_PLUS (SImode, op2, XEXP (addr1, 1));
+ }
+ else if (TARGET_AVOID_XFORM)
+ {
+ emit_insn (gen_add3_insn (op2, addr1, GEN_INT (4)));
+ addr2 = op2;
}
else
{
@@ -2700,7 +2733,18 @@
if (GET_CODE (addr1) == PLUS)
{
emit_insn (gen_add3_insn (op2, XEXP (addr1, 0), GEN_INT (4)));
- addr2 = gen_rtx_PLUS (SImode, op2, XEXP (addr1, 1));
+ if (TARGET_AVOID_XFORM)
+ {
+ emit_insn (gen_add3_insn (op2, XEXP (addr1, 1), op2));
+ addr2 = op2;
+ }
+ else
+ addr2 = gen_rtx_PLUS (SImode, op2, XEXP (addr1, 1));
+ }
+ else if (TARGET_AVOID_XFORM)
+ {
+ emit_insn (gen_add3_insn (op2, addr1, GEN_INT (4)));
+ addr2 = op2;
}
else
{
diff --git a/gcc/config/sh/linux-unwind.h b/gcc/config/sh/linux-unwind.h
index 94ed95d55e1..5a78e3172aa 100644
--- a/gcc/config/sh/linux-unwind.h
+++ b/gcc/config/sh/linux-unwind.h
@@ -1,5 +1,6 @@
/* DWARF2 EH unwinding support for SH Linux.
- Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006, 2007, 2009, 2012 Free Software Foundation,
+ Inc.
This file is part of GCC.
@@ -80,9 +81,9 @@ shmedia_fallback_frame_state (struct _Unwind_Context *context,
&& (*(unsigned long *) (pc+11) == 0x6ff0fff0))
{
struct rt_sigframe {
- struct siginfo *pinfo;
+ siginfo_t *pinfo;
void *puc;
- struct siginfo info;
+ siginfo_t info;
struct ucontext uc;
} *rt_ = context->cfa;
/* The void * cast is necessary to avoid an aliasing warning.
@@ -179,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
&& (*(unsigned short *) (pc+14) == 0x00ad))))
{
struct rt_sigframe {
- struct siginfo info;
+ siginfo_t info;
struct ucontext uc;
} *rt_ = context->cfa;
/* The void * cast is necessary to avoid an aliasing warning.
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 6ac593e839e..39ef00d265c 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -911,8 +911,6 @@ sh_option_override (void)
if (! VALID_REGISTER_P (ADDREGNAMES_REGNO (regno)))
sh_additional_register_names[regno][0] = '\0';
- flag_omit_frame_pointer = (PREFERRED_DEBUGGING_TYPE == DWARF2_DEBUG);
-
if ((flag_pic && ! TARGET_PREFERGOT)
|| (TARGET_SHMEDIA && !TARGET_PT_FIXED))
flag_no_function_cse = 1;
@@ -944,22 +942,17 @@ sh_option_override (void)
flag_schedule_insns = 0;
}
- if ((target_flags_explicit & MASK_ACCUMULATE_OUTGOING_ARGS) == 0)
- target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS;
-
/* Unwind info is not correct around the CFG unless either a frame
pointer is present or M_A_O_A is set. Fixing this requires rewriting
unwind info generation to be aware of the CFG and propagating states
around edges. */
if ((flag_unwind_tables || flag_asynchronous_unwind_tables
|| flag_exceptions || flag_non_call_exceptions)
- && flag_omit_frame_pointer
- && !(target_flags & MASK_ACCUMULATE_OUTGOING_ARGS))
+ && flag_omit_frame_pointer && !TARGET_ACCUMULATE_OUTGOING_ARGS)
{
- if (target_flags_explicit & MASK_ACCUMULATE_OUTGOING_ARGS)
warning (0, "unwind tables currently require either a frame pointer "
"or -maccumulate-outgoing-args for correctness");
- target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS;
+ TARGET_ACCUMULATE_OUTGOING_ARGS = 1;
}
/* Unwinding with -freorder-blocks-and-partition does not work on this
diff --git a/gcc/config/sh/sh.opt b/gcc/config/sh/sh.opt
index e94f53a5cbd..99a6373e20e 100644
--- a/gcc/config/sh/sh.opt
+++ b/gcc/config/sh/sh.opt
@@ -202,7 +202,7 @@ Target RejectNegative Condition(SUPPORT_SH5_32MEDIA_NOFPU)
Generate FPU-less SHcompact code
maccumulate-outgoing-args
-Target Report Mask(ACCUMULATE_OUTGOING_ARGS)
+Target Report Var(TARGET_ACCUMULATE_OUTGOING_ARGS) Init(1)
Reserve space for outgoing arguments in the function prologue
madjust-unroll
diff --git a/gcc/config/xtensa/linux-unwind.h b/gcc/config/xtensa/linux-unwind.h
index 32e93497287..24564972820 100644
--- a/gcc/config/xtensa/linux-unwind.h
+++ b/gcc/config/xtensa/linux-unwind.h
@@ -1,5 +1,5 @@
/* DWARF2 EH unwinding support for Xtensa.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009, 2012 Free Software Foundation, Inc.
This file is part of GCC.
@@ -62,7 +62,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
struct sigcontext *sc;
struct rt_sigframe {
- struct siginfo info;
+ siginfo_t info;
struct ucontext uc;
} *rt_;
diff --git a/gcc/configure b/gcc/configure
index 5b848b6f2d8..9365d052371 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -4842,7 +4842,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_cc_gcc_supports_ada" >&5
$as_echo "$acx_cv_cc_gcc_supports_ada" >&6; }
-if test x$GNATBIND != xno && test x$GNATMAKE != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then
+if test "x$GNATBIND" != xno && test "x$GNATMAKE" != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then
have_gnat=yes
else
have_gnat=no
diff --git a/gcc/convert.c b/gcc/convert.c
index 21d09c157eb..765c542dbdb 100644
--- a/gcc/convert.c
+++ b/gcc/convert.c
@@ -44,11 +44,6 @@ convert_to_pointer (tree type, tree expr)
if (TREE_TYPE (expr) == type)
return expr;
- /* Propagate overflow to the NULL pointer. */
- if (integer_zerop (expr))
- return force_fit_type_double (type, double_int_zero, 0,
- TREE_OVERFLOW (expr));
-
switch (TREE_CODE (TREE_TYPE (expr)))
{
case POINTER_TYPE:
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 87870dfcf74..c5387511679 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2012-06-25 Jason Merrill <jason@redhat.com>
+
+ PR c++/52988
+ * typeck.c (decay_conversion): Don't discard side-effects from
+ expressions of nullptr_t.
+
2012-04-04 Steve Ellcey <sje@cup.hp.com>
Backported from mainline.
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index deb895111b6..b2a08a3b9e8 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -1822,7 +1822,7 @@ decay_conversion (tree exp)
if (error_operand_p (exp))
return error_mark_node;
- if (NULLPTR_TYPE_P (type))
+ if (NULLPTR_TYPE_P (type) && !TREE_SIDE_EFFECTS (exp))
return nullptr_node;
/* build_c_cast puts on a NOP_EXPR to make the result not an lvalue.
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index f78663e6dd1..b752efb264d 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,36 @@
+2012-06-14 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/53597
+ * decl.c (match_attr_spec): Only mark module variables
+ as SAVE_IMPLICIT for Fortran 2008 and later.
+
+2012-06-05 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/50619
+ * resolve.c (build_default_init_expr): Don't initialize
+ ASSOCIATE names.
+
+2012-06-01 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/53521
+ * trans.c (gfc_deallocate_scalar_with_status): Properly
+ handle the case size == 0.
+
+2012-05-23 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/53389
+ * trans-array.c (gfc_add_loop_ss_code): Don't evaluate
+ expression, if ss->is_alloc_lhs is set.
+
+2012-05-02 Tobias Burnus <burnus@net-b.de>
+
+ Backport from mainline
+ 2012-04-12 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/52864
+ * expr.c (gfc_check_vardef_context): Fix assignment check for
+ pointer components.
+
2012-03-10 Tobias Burnus <burnus@net-b.de>
PR fortran/52469
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 90693a4b858..26bffb78baf 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -3623,8 +3623,9 @@ match_attr_spec (void)
}
}
- /* Module variables implicitly have the SAVE attribute. */
- if (gfc_current_state () == COMP_MODULE && !current_attr.save)
+ /* Since Fortran 2008 module variables implicitly have the SAVE attribute. */
+ if (gfc_current_state () == COMP_MODULE && !current_attr.save
+ && (gfc_option.allow_std & GFC_STD_F2008) != 0)
current_attr.save = SAVE_IMPLICIT;
colon_seen = 1;
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index a4da37c20dc..3330cc89313 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -4474,7 +4474,11 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, const char* context)
if (ptr_component && ref->type == REF_COMPONENT)
check_intentin = false;
if (ref->type == REF_COMPONENT && ref->u.c.component->attr.pointer)
- ptr_component = true;
+ {
+ ptr_component = true;
+ if (!pointer)
+ check_intentin = false;
+ }
}
if (check_intentin && sym->attr.intent == INTENT_IN)
{
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 4ee70932bc8..3e795ce1639 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -9700,7 +9700,8 @@ build_default_init_expr (gfc_symbol *sym)
|| sym->attr.data
|| sym->module
|| sym->attr.cray_pointee
- || sym->attr.cray_pointer)
+ || sym->attr.cray_pointer
+ || sym->assoc)
return NULL;
/* Now we'll try to build an initializer expression. */
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index a4be6e7b165..d0d0900eb1d 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -2056,6 +2056,11 @@ gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript,
gfc_se se;
int n;
+ /* Don't evaluate the arguments for realloc_lhs_loop_for_fcn_call; otherwise,
+ arguments could get evaluated multiple times. */
+ if (ss->is_alloc_lhs)
+ return;
+
/* TODO: This can generate bad code if there are ordering dependencies,
e.g., a callee allocated function and an unknown size constructor. */
gcc_assert (ss != NULL);
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index 27a352ab3bd..0dc82409833 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -1005,15 +1005,12 @@ internal_realloc (void *mem, size_t size)
if (!res && size != 0)
_gfortran_os_error ("Allocation would exceed memory limit");
- if (size == 0)
- return NULL;
-
return res;
} */
tree
gfc_call_realloc (stmtblock_t * block, tree mem, tree size)
{
- tree msg, res, nonzero, zero, null_result, tmp;
+ tree msg, res, nonzero, null_result, tmp;
tree type = TREE_TYPE (mem);
size = gfc_evaluate_now (size, block);
@@ -1044,15 +1041,6 @@ gfc_call_realloc (stmtblock_t * block, tree mem, tree size)
build_empty_stmt (input_location));
gfc_add_expr_to_block (block, tmp);
- /* if (size == 0) then the result is NULL. */
- tmp = fold_build2_loc (input_location, MODIFY_EXPR, type, res,
- build_int_cst (type, 0));
- zero = fold_build1_loc (input_location, TRUTH_NOT_EXPR, boolean_type_node,
- nonzero);
- tmp = fold_build3_loc (input_location, COND_EXPR, void_type_node, zero, tmp,
- build_empty_stmt (input_location));
- gfc_add_expr_to_block (block, tmp);
-
return res;
}
diff --git a/gcc/gcov-iov.c b/gcc/gcov-iov.c
index 9a73cd5b2b2..59109c1f912 100644
--- a/gcc/gcov-iov.c
+++ b/gcc/gcov-iov.c
@@ -19,8 +19,8 @@ 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/>. */
-#include <stdio.h>
-#include <stdlib.h>
+#include "bconfig.h"
+#include "system.h"
/* Command line arguments are the base GCC version and the development
phase (the latter may be an empty string). */
@@ -48,8 +48,14 @@ main (int argc, char **argv)
if (*ptr == '.')
minor = strtoul (ptr + 1, 0, 10);
+ /* For releases the development phase is an empty string, for
+ prerelease versions on a release branch it is "prerelease".
+ Consider both equal as patch-level releases do not change
+ the GCOV version either.
+ On the trunk the development phase is "experimental". */
phase = argv[2][0];
- if (phase == '\0')
+ if (phase == '\0'
+ || strcmp (argv[2], "prerelease") == 0)
phase = '*';
v[0] = (major < 10 ? '0' : 'A' - 10) + major;
diff --git a/gcc/gimple.c b/gcc/gimple.c
index bf8cc07e490..12ff7f63995 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -2275,8 +2275,6 @@ gimple_set_modified (gimple s, bool modifiedp)
bool
gimple_has_side_effects (const_gimple s)
{
- unsigned i;
-
if (is_gimple_debug (s))
return false;
@@ -2292,45 +2290,15 @@ gimple_has_side_effects (const_gimple s)
if (is_gimple_call (s))
{
- unsigned nargs = gimple_call_num_args (s);
+ int flags = gimple_call_flags (s);
- if (!(gimple_call_flags (s) & (ECF_CONST | ECF_PURE)))
- return true;
- else if (gimple_call_flags (s) & ECF_LOOPING_CONST_OR_PURE)
- /* An infinite loop is considered a side effect. */
+ /* An infinite loop is considered a side effect. */
+ if (!(flags & (ECF_CONST | ECF_PURE))
+ || (flags & ECF_LOOPING_CONST_OR_PURE))
return true;
- if (gimple_call_lhs (s)
- && TREE_SIDE_EFFECTS (gimple_call_lhs (s)))
- {
- gcc_checking_assert (gimple_has_volatile_ops (s));
- return true;
- }
-
- if (TREE_SIDE_EFFECTS (gimple_call_fn (s)))
- return true;
-
- for (i = 0; i < nargs; i++)
- if (TREE_SIDE_EFFECTS (gimple_call_arg (s, i)))
- {
- gcc_checking_assert (gimple_has_volatile_ops (s));
- return true;
- }
-
return false;
}
- else
- {
- for (i = 0; i < gimple_num_ops (s); i++)
- {
- tree op = gimple_op (s, i);
- if (op && TREE_SIDE_EFFECTS (op))
- {
- gcc_checking_assert (gimple_has_volatile_ops (s));
- return true;
- }
- }
- }
return false;
}
diff --git a/gcc/gthr-posix.h b/gcc/gthr-posix.h
index ecb06e2f4cb..1de5f4dc2f6 100644
--- a/gcc/gthr-posix.h
+++ b/gcc/gthr-posix.h
@@ -239,16 +239,15 @@ __gthread_active_p (void)
static inline int
__gthread_active_p (void)
{
- static void *const __gthread_active_ptr
- = __extension__ (void *) &__gthrw_(
/* Android's C library does not provide pthread_cancel, check for
`pthread_create' instead. */
#ifndef __BIONIC__
- pthread_cancel
+ static void *const __gthread_active_ptr
+ = __extension__ (void *) &__gthrw_(pthread_cancel);
#else
- pthread_create
+ static void *const __gthread_active_ptr
+ = __extension__ (void *) &__gthrw_(pthread_create);
#endif
- );
return __gthread_active_ptr != 0;
}
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index cd87ddfde3d..95778973f62 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,12 @@
+2012-04-23 Peter Bergner <bergner@vnet.ibm.com>
+
+ Backport from mainline
+ 2011-06-11 Jan Hubicka <jh@suse.cz>
+
+ PR lto/48246
+ * lto.c (lto_1_to_1_map): Don't create empty partitions.
+ (lto_balanced_map): Likewise.
+
2012-03-01 Release Manager
* GCC 4.6.3 released.
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 3d699c4f84b..64139717b18 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -893,7 +893,8 @@ lto_1_to_1_map (void)
for (node = cgraph_nodes; node; node = node->next)
{
- if (!partition_cgraph_node_p (node))
+ if (!partition_cgraph_node_p (node)
+ || node->aux)
continue;
file_data = node->local.lto_file_data;
@@ -923,13 +924,13 @@ lto_1_to_1_map (void)
npartitions++;
}
- if (!node->aux)
- add_cgraph_node_to_partition (partition, node);
+ add_cgraph_node_to_partition (partition, node);
}
for (vnode = varpool_nodes; vnode; vnode = vnode->next)
{
- if (!partition_varpool_node_p (vnode))
+ if (!partition_varpool_node_p (vnode)
+ || vnode->aux)
continue;
file_data = vnode->lto_file_data;
slot = pointer_map_contains (pmap, file_data);
@@ -943,8 +944,7 @@ lto_1_to_1_map (void)
npartitions++;
}
- if (!vnode->aux)
- add_varpool_node_to_partition (partition, vnode);
+ add_varpool_node_to_partition (partition, vnode);
}
for (node = cgraph_nodes; node; node = node->next)
node->aux = NULL;
@@ -1050,8 +1050,9 @@ lto_balanced_map (void)
for (i = 0; i < n_nodes; i++)
{
- if (!order[i]->aux)
- add_cgraph_node_to_partition (partition, order[i]);
+ if (order[i]->aux)
+ continue;
+ add_cgraph_node_to_partition (partition, order[i]);
total_size -= order[i]->global.size;
/* Once we added a new node to the partition, we also want to add
@@ -1231,6 +1232,8 @@ lto_balanced_map (void)
}
i = best_i;
/* When we are finished, avoid creating empty partition. */
+ while (i < n_nodes - 1 && order[i + 1]->aux)
+ i++;
if (i == n_nodes - 1)
break;
partition = new_partition ("");
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a3a5f18e118..33920f8651a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,133 @@
+2012-06-25 Jason Merrill <jason@redhat.com>
+
+ PR c++/52988
+ * g++.dg/cpp0x/nullptr28.C: New.
+
+2012-06-19 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * gcc.dg/stack-usage-1.c: Remove dg-options line for sh targets
+ and add __sh__ case.
+
+2012-06-14 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/53597
+ * gfortran.dg/save_4.f90: New.
+
+2012-06-13 Christian Bruel <christian.bruel@st.com>
+
+ PR target/53621
+ * gcc.dg/stack-usage-1.c: Force -fomit-frame-pointer on SH.
+
+2012-06-05 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/50619
+ * gfortran.dg/init_flag_10.f90: New.
+
+2012-06-04 Edmar Wienskoski <edmar@freescale.com>
+
+ PR target/53559
+ * gcc.target/powerpc/cell_builtin_1.c: New test case.
+ * gcc.target/powerpc/cell_builtin_2.c: Ditto.
+ * gcc.target/powerpc/cell_builtin_3.c: Ditto.
+ * gcc.target/powerpc/cell_builtin_4.c: Ditto.
+ * gcc.target/powerpc/cell_builtin_5.c: Ditto.
+ * gcc.target/powerpc/cell_builtin_6.c: Ditto.
+ * gcc.target/powerpc/cell_builtin_7.c: Ditto.
+ * gcc.target/powerpc/cell_builtin_8.c: Ditto.
+
+2012-05-23 Michael Hope <michael.hope@linaro.org>
+
+ PR c++/52796
+ * g++.dg/cpp0x/variadic-value1.C: Change selector for explicit
+ options.
+
+2012-05-23 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/53389
+ * gfortran.dg/realloc_on_assign_15.f90: New.
+
+2012-05-22 Richard Guenther <rguenther@suse.de>
+
+ Backport from mainline
+ 2011-11-10 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/51071
+ * gcc.dg/torture/pr51071.c: New testcase.
+ * gcc.dg/torture/pr51071-2.c: Likewise.
+
+2012-05-22 Richard Guenther <rguenther@suse.de>
+
+ Backport from mainline
+ 2012-02-28 Richard Guenther <rguenther@suse.de>
+
+ PR target/52407
+ * gcc.dg/torture/pr52407.c: New testcase.
+
+2012-05-22 Richard Guenther <rguenther@suse.de>
+
+ Backport from mainline
+ 2012-04-12 Richard Guenther <rguenther@suse.de>
+
+ PR c/52862
+ * gcc.dg/pr52862.c: New testcase.
+
+2012-05-21 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/53418
+ * gcc.c-torture/compile/pr53418-1.c,
+ gcc.c-torture/compile/pr53418-2.c: New tests.
+
+2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ Backport from mainline
+ 2012-05-21 Uros Bizjak <ubizjak@gmail.com>
+ H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/53416
+ * gcc.target/i386/pr53416.c: New file.
+
+2012-05-14 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.target/i386/avx256-unaligned-load-[1234].c: Update scan strings.
+ * gcc.target/i386/avx256-unaligned-store-[1234].c: Ditto.
+
+2012-05-03 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2012-05-03 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/53199
+ * gcc.target/powwerpc/pr53199.c: New file.
+
+2012-05-02 Tobias Burnus <burnus@net-b.de>
+
+ Backport from mainline
+ 2012-04-16 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/52864
+ * gfortran.dg/pointer_intent_6.f90: New.
+
+2012-04-30 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2012-04-27 Paolo Bonzini <bonzini@gnu.org>
+
+ PR target/53138
+ * gcc.c-torture/execute/20120427-1.c: New testcase.
+
+2012-04-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/53084
+ * gcc.c-torture/execute/pr53084.c: New test.
+
+2012-04-13 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2012-04-12 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/52775
+ * gcc.target/powerpc/pr52775.c: New file.
+
2012-04-03 Jason Merrill <jason@redhat.com>
PR c++/52796
diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr28.C b/gcc/testsuite/g++.dg/cpp0x/nullptr28.C
new file mode 100644
index 00000000000..05fbe57b197
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nullptr28.C
@@ -0,0 +1,16 @@
+// { dg-do run { target c++11 } }
+
+typedef decltype(nullptr) nullptr_t;
+
+int i;
+nullptr_t n;
+const nullptr_t& f() { ++i; return n; }
+
+nullptr_t g() { return f(); }
+
+int main()
+{
+ g();
+ if (i != 1)
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-value1.C b/gcc/testsuite/g++.dg/cpp0x/variadic-value1.C
index 179919a5bc7..301bd54631c 100644
--- a/gcc/testsuite/g++.dg/cpp0x/variadic-value1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic-value1.C
@@ -1,5 +1,5 @@
// PR c++/52796
-// { dg-do run { target c++11 } }
+// { dg-options "-std=c++0x -pedantic-errors" }
inline void *operator new(__SIZE_TYPE__ s, void *p) { return p; }
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr53418-1.c b/gcc/testsuite/gcc.c-torture/compile/pr53418-1.c
new file mode 100644
index 00000000000..721b02d7878
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr53418-1.c
@@ -0,0 +1,5 @@
+void
+f (void)
+{
+ int i = (0 ? 1 : 0U / 0);
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr53418-2.c b/gcc/testsuite/gcc.c-torture/compile/pr53418-2.c
new file mode 100644
index 00000000000..a437b6a0e62
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr53418-2.c
@@ -0,0 +1,5 @@
+void
+f (void)
+{
+ int i = (1 ? 0U / 0 : 1);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20120427-1.c b/gcc/testsuite/gcc.c-torture/execute/20120427-1.c
new file mode 100644
index 00000000000..46ed76ae943
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20120427-1.c
@@ -0,0 +1,36 @@
+typedef struct sreal
+{
+ unsigned sig; /* Significant. */
+ int exp; /* Exponent. */
+} sreal;
+
+sreal_compare (sreal *a, sreal *b)
+{
+ if (a->exp > b->exp)
+ return 1;
+ if (a->exp < b->exp)
+ return -1;
+ if (a->sig > b->sig)
+ return 1;
+ return -(a->sig < b->sig);
+}
+
+sreal a[] = {
+ { 0, 0 },
+ { 1, 0 },
+ { 0, 1 },
+ { 1, 1 }
+};
+
+int main()
+{
+ int i, j;
+ for (i = 0; i <= 3; i++) {
+ for (j = 0; j < 3; j++) {
+ if (i < j && sreal_compare(&a[i], &a[j]) != -1) abort();
+ if (i == j && sreal_compare(&a[i], &a[j]) != 0) abort();
+ if (i > j && sreal_compare(&a[i], &a[j]) != 1) abort();
+ }
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr53084.c b/gcc/testsuite/gcc.c-torture/execute/pr53084.c
new file mode 100644
index 00000000000..1afc016dfc4
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr53084.c
@@ -0,0 +1,18 @@
+/* PR middle-end/53084 */
+
+extern void abort (void);
+
+__attribute__((noinline, noclone)) void
+bar (const char *p)
+{
+ if (p[0] != 'o' || p[1] != 'o' || p[2])
+ abort ();
+}
+
+int
+main ()
+{
+ static const char *const foo[] = {"foo" + 1};
+ bar (foo[0]);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr52862.c b/gcc/testsuite/gcc.dg/pr52862.c
new file mode 100644
index 00000000000..febe7a8289b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr52862.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+void ASMAtomicWritePtrVoid(const void *pv);
+void rtThreadDestroy(void)
+{
+ void * const pvTypeChecked = ((void *)0);
+ ASMAtomicWritePtrVoid((void *)(pvTypeChecked));
+}
diff --git a/gcc/testsuite/gcc.dg/stack-usage-1.c b/gcc/testsuite/gcc.dg/stack-usage-1.c
index 1d03a8dc994..7de282df26a 100644
--- a/gcc/testsuite/gcc.dg/stack-usage-1.c
+++ b/gcc/testsuite/gcc.dg/stack-usage-1.c
@@ -41,6 +41,8 @@
# define SIZE 160 /* 256 - 96 bytes for register save area */
#elif defined (__SPU__)
# define SIZE 224
+#elif defined (__sh__)
+# define SIZE 252
#else
# define SIZE 256
#endif
diff --git a/gcc/testsuite/gcc.dg/torture/pr51071-2.c b/gcc/testsuite/gcc.dg/torture/pr51071-2.c
new file mode 100644
index 00000000000..f66a89f3958
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr51071-2.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-delete-null-pointer-checks" } */
+
+extern struct module __this_module;
+static inline void
+trace_module_get (struct module *mod, unsigned long ip) { }
+struct module;
+static inline __attribute__((no_instrument_function))
+int try_module_get(struct module *module)
+{
+ int ret = 1;
+ if (module)
+ {
+ if (module_is_live(module))
+ {
+ __label__ __here;
+ asm("");
+ __here:
+ trace_module_get(module, (unsigned long)&&__here);
+ }
+ else
+ ret = 0;
+ }
+ return ret;
+}
+struct net_device;
+struct net_device_ops {
+ int (*ndo_open)(struct net_device *dev);
+};
+int t3e3_open(struct net_device *dev)
+{
+ int ret = hdlc_open(dev);
+ if (ret)
+ return ret;
+ try_module_get((&__this_module));
+ return 0;
+}
+const struct net_device_ops t3e3_ops = { .ndo_open = t3e3_open };
diff --git a/gcc/testsuite/gcc.dg/torture/pr51071.c b/gcc/testsuite/gcc.dg/torture/pr51071.c
new file mode 100644
index 00000000000..99af9587d05
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr51071.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+
+void foo (void);
+void bar (void *);
+extern int t;
+
+static void kmalloc_large (int size, int flags)
+{
+ (void) size;
+ (void) flags;
+ foo ();
+ bar (({__here:&&__here;}));
+}
+
+static void kmalloc (int size, int flags)
+{
+ if (size)
+ {
+ if ((unsigned long) size > 0x1000)
+ kmalloc_large (size, flags);
+
+ if (flags)
+ bar (({__here:&&__here;}));
+ }
+}
+
+void compress_file_range (int i, int j, int k)
+{
+ int nr_pages = ({j < k;});
+
+ if (i || t)
+ kmalloc (0x1000UL * nr_pages, 0x40UL);
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr52407.c b/gcc/testsuite/gcc.dg/torture/pr52407.c
new file mode 100644
index 00000000000..bb95e51f25b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr52407.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+typedef long long T;
+typedef T vl_t __attribute__((vector_size(2 * sizeof (T))));
+
+vl_t ul[4], vl[4] = { { 1, 2 }, { 3, 4 }, { 5, 6 }, { 7, 8 } };
+
+static void
+mul_vl_l(vl_t *u, vl_t *v, T x, int m)
+{
+ vl_t w;
+ T *p = (T *)&w;
+ p[0] = p[1] = x;
+ while (m--)
+ *u++ = *v++ * w;
+}
+
+int
+main(int argc, char *argv[])
+{
+ int i;
+ T *pl;
+
+ pl = (T *) &ul;
+ mul_vl_l(ul, vl, 2, 4);
+ for (i = 0; i < 8; i++)
+ if (pl[i] != 2 * (i + 1))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-1.c b/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-1.c
index 023e859b6c1..c1c7517d711 100644
--- a/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-1.c
@@ -14,6 +14,6 @@ avx_test (void)
c[i] = a[i] * b[i+3];
}
-/* { dg-final { scan-assembler-not "\\*avx_movups256/1" } } */
-/* { dg-final { scan-assembler "\\*avx_movups/1" } } */
+/* { dg-final { scan-assembler-not "avx_movups256/1" } } */
+/* { dg-final { scan-assembler "avx_movups/1" } } */
/* { dg-final { scan-assembler "vinsertf128" } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-2.c b/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-2.c
index 8394e27197b..319cf5e0a01 100644
--- a/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-2.c
+++ b/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-2.c
@@ -24,6 +24,6 @@ avx_test (void)
}
}
-/* { dg-final { scan-assembler-not "\\*avx_movdqu256/1" } } */
-/* { dg-final { scan-assembler "\\*avx_movdqu/1" } } */
+/* { dg-final { scan-assembler-not "avx_movdqu256/1" } } */
+/* { dg-final { scan-assembler "avx_movdqu/1" } } */
/* { dg-final { scan-assembler "vinsertf128" } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-3.c b/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-3.c
index ec7d59d53cc..6ac579aa77c 100644
--- a/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-3.c
+++ b/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-3.c
@@ -14,6 +14,6 @@ avx_test (void)
c[i] = a[i] * b[i+3];
}
-/* { dg-final { scan-assembler-not "\\*avx_movupd256/1" } } */
-/* { dg-final { scan-assembler "\\*avx_movupd/1" } } */
+/* { dg-final { scan-assembler-not "avx_movupd256/1" } } */
+/* { dg-final { scan-assembler "avx_movupd/1" } } */
/* { dg-final { scan-assembler "vinsertf128" } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c b/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c
index 0d3ef333120..7c015a8b90a 100644
--- a/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c
+++ b/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c
@@ -14,6 +14,6 @@ avx_test (void)
b[i] = a[i+3] * 2;
}
-/* { dg-final { scan-assembler "\\*avx_movups256/1" } } */
-/* { dg-final { scan-assembler-not "\\*avx_movups/1" } } */
+/* { dg-final { scan-assembler "avx_movups256/1" } } */
+/* { dg-final { scan-assembler-not "avx_movups/1" } } */
/* { dg-final { scan-assembler-not "vinsertf128" } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-1.c b/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-1.c
index 99db55c9d0a..cf1944acab2 100644
--- a/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-1.c
@@ -17,6 +17,6 @@ avx_test (void)
d[i] = c[i] * 20.0;
}
-/* { dg-final { scan-assembler-not "\\*avx_movups256/2" } } */
+/* { dg-final { scan-assembler-not "avx_movups256/2" } } */
/* { dg-final { scan-assembler "movups.*\\*avx_movv4sf_internal/3" } } */
/* { dg-final { scan-assembler "vextractf128" } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-2.c b/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-2.c
index 38ee9e2a45c..5a10ec3a7fb 100644
--- a/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-2.c
+++ b/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-2.c
@@ -24,6 +24,6 @@ avx_test (void)
}
}
-/* { dg-final { scan-assembler-not "\\*avx_movdqu256/2" } } */
+/* { dg-final { scan-assembler-not "avx_movdqu256/2" } } */
/* { dg-final { scan-assembler "movdqu.*\\*avx_movv16qi_internal/3" } } */
/* { dg-final { scan-assembler "vextractf128" } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-3.c b/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-3.c
index eaab6fd775b..daea7b0ea81 100644
--- a/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-3.c
+++ b/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-3.c
@@ -17,6 +17,6 @@ avx_test (void)
d[i] = c[i] * 20.0;
}
-/* { dg-final { scan-assembler-not "\\*avx_movupd256/2" } } */
+/* { dg-final { scan-assembler-not "avx_movupd256/2" } } */
/* { dg-final { scan-assembler "movupd.*\\*avx_movv2df_internal/3" } } */
/* { dg-final { scan-assembler "vextractf128" } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-4.c b/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-4.c
index 96cca66ae9c..39b6f3bef16 100644
--- a/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-4.c
+++ b/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-4.c
@@ -14,7 +14,7 @@ avx_test (void)
b[i+3] = a[i] * c[i];
}
-/* { dg-final { scan-assembler "\\*avx_movups256/2" } } */
-/* { dg-final { scan-assembler-not "\\*avx_movups/2" } } */
+/* { dg-final { scan-assembler "avx_movups256/2" } } */
+/* { dg-final { scan-assembler-not "avx_movups/2" } } */
/* { dg-final { scan-assembler-not "\\*avx_movv4sf_internal/3" } } */
/* { dg-final { scan-assembler-not "vextractf128" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr53416.c b/gcc/testsuite/gcc.target/i386/pr53416.c
new file mode 100644
index 00000000000..68abe8bddbc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr53416.c
@@ -0,0 +1,17 @@
+/* PR target/53416 */
+/* { dg-options "-O2 -mrdrnd" } */
+
+int test (void)
+{
+ unsigned int number = 0;
+ int result0, result1, result2, result3;
+
+ result0 = __builtin_ia32_rdrand32_step (&number);
+ result1 = __builtin_ia32_rdrand32_step (&number);
+ result2 = __builtin_ia32_rdrand32_step (&number);
+ result3 = __builtin_ia32_rdrand32_step (&number);
+
+ return result0 + result1 +result2 + result3;
+}
+
+/* { dg-final { scan-assembler-times "rdrand" 4 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/cell_builtin-1.c b/gcc/testsuite/gcc.target/powerpc/cell_builtin-1.c
new file mode 100644
index 00000000000..f2bc7ffb3c4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/cell_builtin-1.c
@@ -0,0 +1,48 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-O2 -maltivec -mcpu=cell" } */
+/* { dg-final { scan-assembler-times "lvlx" 19 } } */
+
+#include <altivec.h>
+
+typedef __vector signed char vsc;
+typedef __vector signed short vss;
+typedef __vector signed int vsi;
+typedef __vector unsigned char vuc;
+typedef __vector unsigned short vus;
+typedef __vector unsigned int vui;
+typedef __vector bool char vbc;
+typedef __vector bool short vbs;
+typedef __vector bool int vbi;
+typedef __vector float vsf;
+typedef __vector pixel vp;
+typedef signed char sc;
+typedef signed short ss;
+typedef signed int si;
+typedef signed long sl;
+typedef unsigned char uc;
+typedef unsigned short us;
+typedef unsigned int ui;
+typedef unsigned long ul;
+typedef float sf;
+
+vsc lc1(long a, void *p) { return __builtin_altivec_lvlx (a,p); }
+vsf llx01(long a, vsf *p) { return __builtin_vec_lvlx (a,p); }
+vsf llx02(long a, sf *p) { return __builtin_vec_lvlx (a,p); }
+vbi llx03(long a, vbi *p) { return __builtin_vec_lvlx (a,p); }
+vsi llx04(long a, vsi *p) { return __builtin_vec_lvlx (a,p); }
+vsi llx05(long a, si *p) { return __builtin_vec_lvlx (a,p); }
+vui llx06(long a, vui *p) { return __builtin_vec_lvlx (a,p); }
+vui llx07(long a, ui *p) { return __builtin_vec_lvlx (a,p); }
+vbs llx08(long a, vbs *p) { return __builtin_vec_lvlx (a,p); }
+vp llx09(long a, vp *p) { return __builtin_vec_lvlx (a,p); }
+vss llx10(long a, vss *p) { return __builtin_vec_lvlx (a,p); }
+vss llx11(long a, ss *p) { return __builtin_vec_lvlx (a,p); }
+vus llx12(long a, vus *p) { return __builtin_vec_lvlx (a,p); }
+vus llx13(long a, us *p) { return __builtin_vec_lvlx (a,p); }
+vbc llx14(long a, vbc *p) { return __builtin_vec_lvlx (a,p); }
+vsc llx15(long a, vsc *p) { return __builtin_vec_lvlx (a,p); }
+vsc llx16(long a, sc *p) { return __builtin_vec_lvlx (a,p); }
+vuc llx17(long a, vuc *p) { return __builtin_vec_lvlx (a,p); }
+vuc llx18(long a, uc *p) { return __builtin_vec_lvlx (a,p); }
diff --git a/gcc/testsuite/gcc.target/powerpc/cell_builtin-2.c b/gcc/testsuite/gcc.target/powerpc/cell_builtin-2.c
new file mode 100644
index 00000000000..220be571659
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/cell_builtin-2.c
@@ -0,0 +1,48 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-O2 -maltivec -mcpu=cell" } */
+/* { dg-final { scan-assembler-times "lvlxl" 19 } } */
+
+#include <altivec.h>
+
+typedef __vector signed char vsc;
+typedef __vector signed short vss;
+typedef __vector signed int vsi;
+typedef __vector unsigned char vuc;
+typedef __vector unsigned short vus;
+typedef __vector unsigned int vui;
+typedef __vector bool char vbc;
+typedef __vector bool short vbs;
+typedef __vector bool int vbi;
+typedef __vector float vsf;
+typedef __vector pixel vp;
+typedef signed char sc;
+typedef signed short ss;
+typedef signed int si;
+typedef signed long sl;
+typedef unsigned char uc;
+typedef unsigned short us;
+typedef unsigned int ui;
+typedef unsigned long ul;
+typedef float sf;
+
+vsc lc2(long a, void *p) { return __builtin_altivec_lvlxl (a,p); }
+vsf llxl01(long a, vsf *p) { return __builtin_vec_lvlxl (a,p); }
+vsf llxl02(long a, sf *p) { return __builtin_vec_lvlxl (a,p); }
+vbi llxl03(long a, vbi *p) { return __builtin_vec_lvlxl (a,p); }
+vsi llxl04(long a, vsi *p) { return __builtin_vec_lvlxl (a,p); }
+vsi llxl05(long a, si *p) { return __builtin_vec_lvlxl (a,p); }
+vui llxl06(long a, vui *p) { return __builtin_vec_lvlxl (a,p); }
+vui llxl07(long a, ui *p) { return __builtin_vec_lvlxl (a,p); }
+vbs llxl08(long a, vbs *p) { return __builtin_vec_lvlxl (a,p); }
+vp llxl09(long a, vp *p) { return __builtin_vec_lvlxl (a,p); }
+vss llxl10(long a, vss *p) { return __builtin_vec_lvlxl (a,p); }
+vss llxl11(long a, ss *p) { return __builtin_vec_lvlxl (a,p); }
+vus llxl12(long a, vus *p) { return __builtin_vec_lvlxl (a,p); }
+vus llxl13(long a, us *p) { return __builtin_vec_lvlxl (a,p); }
+vbc llxl14(long a, vbc *p) { return __builtin_vec_lvlxl (a,p); }
+vsc llxl15(long a, vsc *p) { return __builtin_vec_lvlxl (a,p); }
+vsc llxl16(long a, sc *p) { return __builtin_vec_lvlxl (a,p); }
+vuc llxl17(long a, vuc *p) { return __builtin_vec_lvlxl (a,p); }
+vuc llxl18(long a, uc *p) { return __builtin_vec_lvlxl (a,p); }
diff --git a/gcc/testsuite/gcc.target/powerpc/cell_builtin-3.c b/gcc/testsuite/gcc.target/powerpc/cell_builtin-3.c
new file mode 100644
index 00000000000..4b437291ea5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/cell_builtin-3.c
@@ -0,0 +1,48 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-O2 -maltivec -mcpu=cell" } */
+/* { dg-final { scan-assembler-times "lvrx" 19 } } */
+
+#include <altivec.h>
+
+typedef __vector signed char vsc;
+typedef __vector signed short vss;
+typedef __vector signed int vsi;
+typedef __vector unsigned char vuc;
+typedef __vector unsigned short vus;
+typedef __vector unsigned int vui;
+typedef __vector bool char vbc;
+typedef __vector bool short vbs;
+typedef __vector bool int vbi;
+typedef __vector float vsf;
+typedef __vector pixel vp;
+typedef signed char sc;
+typedef signed short ss;
+typedef signed int si;
+typedef signed long sl;
+typedef unsigned char uc;
+typedef unsigned short us;
+typedef unsigned int ui;
+typedef unsigned long ul;
+typedef float sf;
+
+vsc lc3(long a, void *p) { return __builtin_altivec_lvrx (a,p); }
+vsf lrx01(long a, vsf *p) { return __builtin_vec_lvrx (a,p); }
+vsf lrx02(long a, sf *p) { return __builtin_vec_lvrx (a,p); }
+vbi lrx03(long a, vbi *p) { return __builtin_vec_lvrx (a,p); }
+vsi lrx04(long a, vsi *p) { return __builtin_vec_lvrx (a,p); }
+vsi lrx05(long a, si *p) { return __builtin_vec_lvrx (a,p); }
+vui lrx06(long a, vui *p) { return __builtin_vec_lvrx (a,p); }
+vui lrx07(long a, ui *p) { return __builtin_vec_lvrx (a,p); }
+vbs lrx08(long a, vbs *p) { return __builtin_vec_lvrx (a,p); }
+vp lrx09(long a, vp *p) { return __builtin_vec_lvrx (a,p); }
+vss lrx10(long a, vss *p) { return __builtin_vec_lvrx (a,p); }
+vss lrx11(long a, ss *p) { return __builtin_vec_lvrx (a,p); }
+vus lrx12(long a, vus *p) { return __builtin_vec_lvrx (a,p); }
+vus lrx13(long a, us *p) { return __builtin_vec_lvrx (a,p); }
+vbc lrx14(long a, vbc *p) { return __builtin_vec_lvrx (a,p); }
+vsc lrx15(long a, vsc *p) { return __builtin_vec_lvrx (a,p); }
+vsc lrx16(long a, sc *p) { return __builtin_vec_lvrx (a,p); }
+vuc lrx17(long a, vuc *p) { return __builtin_vec_lvrx (a,p); }
+vuc lrx18(long a, uc *p) { return __builtin_vec_lvrx (a,p); }
diff --git a/gcc/testsuite/gcc.target/powerpc/cell_builtin-4.c b/gcc/testsuite/gcc.target/powerpc/cell_builtin-4.c
new file mode 100644
index 00000000000..d73328ac43e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/cell_builtin-4.c
@@ -0,0 +1,48 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-O2 -maltivec -mcpu=cell" } */
+/* { dg-final { scan-assembler-times "lvrxl" 19 } } */
+
+#include <altivec.h>
+
+typedef __vector signed char vsc;
+typedef __vector signed short vss;
+typedef __vector signed int vsi;
+typedef __vector unsigned char vuc;
+typedef __vector unsigned short vus;
+typedef __vector unsigned int vui;
+typedef __vector bool char vbc;
+typedef __vector bool short vbs;
+typedef __vector bool int vbi;
+typedef __vector float vsf;
+typedef __vector pixel vp;
+typedef signed char sc;
+typedef signed short ss;
+typedef signed int si;
+typedef signed long sl;
+typedef unsigned char uc;
+typedef unsigned short us;
+typedef unsigned int ui;
+typedef unsigned long ul;
+typedef float sf;
+
+vsc lc4(long a, void *p) { return __builtin_altivec_lvrxl (a,p); }
+vsf lrxl01(long a, vsf *p) { return __builtin_vec_lvrxl (a,p); }
+vsf lrxl02(long a, sf *p) { return __builtin_vec_lvrxl (a,p); }
+vbi lrxl03(long a, vbi *p) { return __builtin_vec_lvrxl (a,p); }
+vsi lrxl04(long a, vsi *p) { return __builtin_vec_lvrxl (a,p); }
+vsi lrxl05(long a, si *p) { return __builtin_vec_lvrxl (a,p); }
+vui lrxl06(long a, vui *p) { return __builtin_vec_lvrxl (a,p); }
+vui lrxl07(long a, ui *p) { return __builtin_vec_lvrxl (a,p); }
+vbs lrxl08(long a, vbs *p) { return __builtin_vec_lvrxl (a,p); }
+vp lrxl09(long a, vp *p) { return __builtin_vec_lvrxl (a,p); }
+vss lrxl10(long a, vss *p) { return __builtin_vec_lvrxl (a,p); }
+vss lrxl11(long a, ss *p) { return __builtin_vec_lvrxl (a,p); }
+vus lrxl12(long a, vus *p) { return __builtin_vec_lvrxl (a,p); }
+vus lrxl13(long a, us *p) { return __builtin_vec_lvrxl (a,p); }
+vbc lrxl14(long a, vbc *p) { return __builtin_vec_lvrxl (a,p); }
+vsc lrxl15(long a, vsc *p) { return __builtin_vec_lvrxl (a,p); }
+vsc lrxl16(long a, sc *p) { return __builtin_vec_lvrxl (a,p); }
+vuc lrxl17(long a, vuc *p) { return __builtin_vec_lvrxl (a,p); }
+vuc lrxl18(long a, uc *p) { return __builtin_vec_lvrxl (a,p); }
diff --git a/gcc/testsuite/gcc.target/powerpc/cell_builtin-5.c b/gcc/testsuite/gcc.target/powerpc/cell_builtin-5.c
new file mode 100644
index 00000000000..cc6adba8050
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/cell_builtin-5.c
@@ -0,0 +1,48 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-O2 -maltivec -mcpu=cell" } */
+/* { dg-final { scan-assembler-times "stvlx" 19 } } */
+
+#include <altivec.h>
+
+typedef __vector signed char vsc;
+typedef __vector signed short vss;
+typedef __vector signed int vsi;
+typedef __vector unsigned char vuc;
+typedef __vector unsigned short vus;
+typedef __vector unsigned int vui;
+typedef __vector bool char vbc;
+typedef __vector bool short vbs;
+typedef __vector bool int vbi;
+typedef __vector float vsf;
+typedef __vector pixel vp;
+typedef signed char sc;
+typedef signed short ss;
+typedef signed int si;
+typedef signed long sl;
+typedef unsigned char uc;
+typedef unsigned short us;
+typedef unsigned int ui;
+typedef unsigned long ul;
+typedef float sf;
+
+void sc1(vsc v, long a, void *p) { __builtin_altivec_stvlx (v,a,p); }
+void slx01(vsf v, long a, vsf *p) { __builtin_vec_stvlx (v,a,p); }
+void slx02(vsf v, long a, sf *p) { __builtin_vec_stvlx (v,a,p); }
+void slx03(vbi v, long a, vbi *p) { __builtin_vec_stvlx (v,a,p); }
+void slx04(vsi v, long a, vsi *p) { __builtin_vec_stvlx (v,a,p); }
+void slx05(vsi v, long a, si *p) { __builtin_vec_stvlx (v,a,p); }
+void slx06(vui v, long a, vui *p) { __builtin_vec_stvlx (v,a,p); }
+void slx07(vui v, long a, ui *p) { __builtin_vec_stvlx (v,a,p); }
+void slx08(vbs v, long a, vbs *p) { __builtin_vec_stvlx (v,a,p); }
+void slx09(vp v, long a, vp *p) { __builtin_vec_stvlx (v,a,p); }
+void slx10(vss v, long a, vss *p) { __builtin_vec_stvlx (v,a,p); }
+void slx11(vss v, long a, ss *p) { __builtin_vec_stvlx (v,a,p); }
+void slx12(vus v, long a, vus *p) { __builtin_vec_stvlx (v,a,p); }
+void slx13(vus v, long a, us *p) { __builtin_vec_stvlx (v,a,p); }
+void slx14(vbc v, long a, vbc *p) { __builtin_vec_stvlx (v,a,p); }
+void slx15(vsc v, long a, vsc *p) { __builtin_vec_stvlx (v,a,p); }
+void slx16(vsc v, long a, sc *p) { __builtin_vec_stvlx (v,a,p); }
+void slx17(vuc v, long a, vuc *p) { __builtin_vec_stvlx (v,a,p); }
+void slx18(vuc v, long a, uc *p) { __builtin_vec_stvlx (v,a,p); }
diff --git a/gcc/testsuite/gcc.target/powerpc/cell_builtin-6.c b/gcc/testsuite/gcc.target/powerpc/cell_builtin-6.c
new file mode 100644
index 00000000000..9c748d973d8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/cell_builtin-6.c
@@ -0,0 +1,48 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-O2 -maltivec -mcpu=cell" } */
+/* { dg-final { scan-assembler-times "stvlxl" 19 } } */
+
+#include <altivec.h>
+
+typedef __vector signed char vsc;
+typedef __vector signed short vss;
+typedef __vector signed int vsi;
+typedef __vector unsigned char vuc;
+typedef __vector unsigned short vus;
+typedef __vector unsigned int vui;
+typedef __vector bool char vbc;
+typedef __vector bool short vbs;
+typedef __vector bool int vbi;
+typedef __vector float vsf;
+typedef __vector pixel vp;
+typedef signed char sc;
+typedef signed short ss;
+typedef signed int si;
+typedef signed long sl;
+typedef unsigned char uc;
+typedef unsigned short us;
+typedef unsigned int ui;
+typedef unsigned long ul;
+typedef float sf;
+
+void sc2(vsc v, long a, void *p) { __builtin_altivec_stvlxl (v,a,p); }
+void slxl01(vsf v, long a, vsf *p) { __builtin_vec_stvlxl (v,a,p); }
+void slxl02(vsf v, long a, sf *p) { __builtin_vec_stvlxl (v,a,p); }
+void slxl03(vbi v, long a, vbi *p) { __builtin_vec_stvlxl (v,a,p); }
+void slxl04(vsi v, long a, vsi *p) { __builtin_vec_stvlxl (v,a,p); }
+void slxl05(vsi v, long a, si *p) { __builtin_vec_stvlxl (v,a,p); }
+void slxl06(vui v, long a, vui *p) { __builtin_vec_stvlxl (v,a,p); }
+void slxl07(vui v, long a, ui *p) { __builtin_vec_stvlxl (v,a,p); }
+void slxl08(vbs v, long a, vbs *p) { __builtin_vec_stvlxl (v,a,p); }
+void slxl09(vp v, long a, vp *p) { __builtin_vec_stvlxl (v,a,p); }
+void slxl10(vss v, long a, vss *p) { __builtin_vec_stvlxl (v,a,p); }
+void slxl11(vss v, long a, ss *p) { __builtin_vec_stvlxl (v,a,p); }
+void slxl12(vus v, long a, vus *p) { __builtin_vec_stvlxl (v,a,p); }
+void slxl13(vus v, long a, us *p) { __builtin_vec_stvlxl (v,a,p); }
+void slxl14(vbc v, long a, vbc *p) { __builtin_vec_stvlxl (v,a,p); }
+void slxl15(vsc v, long a, vsc *p) { __builtin_vec_stvlxl (v,a,p); }
+void slxl16(vsc v, long a, sc *p) { __builtin_vec_stvlxl (v,a,p); }
+void slxl17(vuc v, long a, vuc *p) { __builtin_vec_stvlxl (v,a,p); }
+void slxl18(vuc v, long a, uc *p) { __builtin_vec_stvlxl (v,a,p); }
diff --git a/gcc/testsuite/gcc.target/powerpc/cell_builtin-7.c b/gcc/testsuite/gcc.target/powerpc/cell_builtin-7.c
new file mode 100644
index 00000000000..abdb3b0caf1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/cell_builtin-7.c
@@ -0,0 +1,48 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-O2 -maltivec -mcpu=cell" } */
+/* { dg-final { scan-assembler-times "stvrx" 19 } } */
+
+#include <altivec.h>
+
+typedef __vector signed char vsc;
+typedef __vector signed short vss;
+typedef __vector signed int vsi;
+typedef __vector unsigned char vuc;
+typedef __vector unsigned short vus;
+typedef __vector unsigned int vui;
+typedef __vector bool char vbc;
+typedef __vector bool short vbs;
+typedef __vector bool int vbi;
+typedef __vector float vsf;
+typedef __vector pixel vp;
+typedef signed char sc;
+typedef signed short ss;
+typedef signed int si;
+typedef signed long sl;
+typedef unsigned char uc;
+typedef unsigned short us;
+typedef unsigned int ui;
+typedef unsigned long ul;
+typedef float sf;
+
+void sc3(vsc v, long a, void *p) { __builtin_altivec_stvrx (v,a,p); }
+void srx01(vsf v, long a, vsf *p) { __builtin_vec_stvrx (v,a,p); }
+void srx02(vsf v, long a, sf *p) { __builtin_vec_stvrx (v,a,p); }
+void srx03(vbi v, long a, vbi *p) { __builtin_vec_stvrx (v,a,p); }
+void srx04(vsi v, long a, vsi *p) { __builtin_vec_stvrx (v,a,p); }
+void srx05(vsi v, long a, si *p) { __builtin_vec_stvrx (v,a,p); }
+void srx06(vui v, long a, vui *p) { __builtin_vec_stvrx (v,a,p); }
+void srx07(vui v, long a, ui *p) { __builtin_vec_stvrx (v,a,p); }
+void srx08(vbs v, long a, vbs *p) { __builtin_vec_stvrx (v,a,p); }
+void srx09(vp v, long a, vp *p) { __builtin_vec_stvrx (v,a,p); }
+void srx10(vss v, long a, vss *p) { __builtin_vec_stvrx (v,a,p); }
+void srx11(vss v, long a, ss *p) { __builtin_vec_stvrx (v,a,p); }
+void srx12(vus v, long a, vus *p) { __builtin_vec_stvrx (v,a,p); }
+void srx13(vus v, long a, us *p) { __builtin_vec_stvrx (v,a,p); }
+void srx14(vbc v, long a, vbc *p) { __builtin_vec_stvrx (v,a,p); }
+void srx15(vsc v, long a, vsc *p) { __builtin_vec_stvrx (v,a,p); }
+void srx16(vsc v, long a, sc *p) { __builtin_vec_stvrx (v,a,p); }
+void srx17(vuc v, long a, vuc *p) { __builtin_vec_stvrx (v,a,p); }
+void srx18(vuc v, long a, uc *p) { __builtin_vec_stvrx (v,a,p); }
diff --git a/gcc/testsuite/gcc.target/powerpc/cell_builtin-8.c b/gcc/testsuite/gcc.target/powerpc/cell_builtin-8.c
new file mode 100644
index 00000000000..ec7fc3031b4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/cell_builtin-8.c
@@ -0,0 +1,48 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-O2 -maltivec -mcpu=cell" } */
+/* { dg-final { scan-assembler-times "stvrxl" 19 } } */
+
+#include <altivec.h>
+
+typedef __vector signed char vsc;
+typedef __vector signed short vss;
+typedef __vector signed int vsi;
+typedef __vector unsigned char vuc;
+typedef __vector unsigned short vus;
+typedef __vector unsigned int vui;
+typedef __vector bool char vbc;
+typedef __vector bool short vbs;
+typedef __vector bool int vbi;
+typedef __vector float vsf;
+typedef __vector pixel vp;
+typedef signed char sc;
+typedef signed short ss;
+typedef signed int si;
+typedef signed long sl;
+typedef unsigned char uc;
+typedef unsigned short us;
+typedef unsigned int ui;
+typedef unsigned long ul;
+typedef float sf;
+
+void sc4(vsc v, long a, void *p) { __builtin_altivec_stvrxl (v,a,p); }
+void srxl01(vsf v, long a, vsf *p) { __builtin_vec_stvrxl (v,a,p); }
+void srxl02(vsf v, long a, sf *p) { __builtin_vec_stvrxl (v,a,p); }
+void srxl03(vbi v, long a, vbi *p) { __builtin_vec_stvrxl (v,a,p); }
+void srxl04(vsi v, long a, vsi *p) { __builtin_vec_stvrxl (v,a,p); }
+void srxl05(vsi v, long a, si *p) { __builtin_vec_stvrxl (v,a,p); }
+void srxl06(vui v, long a, vui *p) { __builtin_vec_stvrxl (v,a,p); }
+void srxl07(vui v, long a, ui *p) { __builtin_vec_stvrxl (v,a,p); }
+void srxl08(vbs v, long a, vbs *p) { __builtin_vec_stvrxl (v,a,p); }
+void srxl09(vp v, long a, vp *p) { __builtin_vec_stvrxl (v,a,p); }
+void srxl10(vss v, long a, vss *p) { __builtin_vec_stvrxl (v,a,p); }
+void srxl11(vss v, long a, ss *p) { __builtin_vec_stvrxl (v,a,p); }
+void srxl12(vus v, long a, vus *p) { __builtin_vec_stvrxl (v,a,p); }
+void srxl13(vus v, long a, us *p) { __builtin_vec_stvrxl (v,a,p); }
+void srxl14(vbc v, long a, vbc *p) { __builtin_vec_stvrxl (v,a,p); }
+void srxl15(vsc v, long a, vsc *p) { __builtin_vec_stvrxl (v,a,p); }
+void srxl16(vsc v, long a, sc *p) { __builtin_vec_stvrxl (v,a,p); }
+void srxl17(vuc v, long a, vuc *p) { __builtin_vec_stvrxl (v,a,p); }
+void srxl18(vuc v, long a, uc *p) { __builtin_vec_stvrxl (v,a,p); }
diff --git a/gcc/testsuite/gcc.target/powerpc/pr52775.c b/gcc/testsuite/gcc.target/powerpc/pr52775.c
new file mode 100644
index 00000000000..4027819ee63
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr52775.c
@@ -0,0 +1,16 @@
+/* { dg-do compile { target { powerpc*-*-* && ilp32 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-options "-O1 -mcpu=power4" } */
+/* { dg-final { scan-assembler-times "fcfid" 2 } } */
+
+double
+int_to_double (int *p)
+{
+ return (double)*p;
+}
+
+double
+long_long_to_double (long long *p)
+{
+ return (double)*p;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr53199.c b/gcc/testsuite/gcc.target/powerpc/pr53199.c
new file mode 100644
index 00000000000..89a0cad06fe
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr53199.c
@@ -0,0 +1,50 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-options "-O2 -mcpu=power6 -mavoid-indexed-addresses" } */
+/* { dg-final { scan-assembler-times "lwbrx" 6 } } */
+/* { dg-final { scan-assembler-times "stwbrx" 6 } } */
+
+/* PR 51399: bswap gets an error if -mavoid-indexed-addresses was used in
+ creating the two lwbrx instructions. */
+
+long long
+load64_reverse_1 (long long *p)
+{
+ return __builtin_bswap64 (*p);
+}
+
+long long
+load64_reverse_2 (long long *p)
+{
+ return __builtin_bswap64 (p[1]);
+}
+
+long long
+load64_reverse_3 (long long *p, int i)
+{
+ return __builtin_bswap64 (p[i]);
+}
+
+void
+store64_reverse_1 (long long *p, long long x)
+{
+ *p = __builtin_bswap64 (x);
+}
+
+void
+store64_reverse_2 (long long *p, long long x)
+{
+ p[1] = __builtin_bswap64 (x);
+}
+
+void
+store64_reverse_3 (long long *p, long long x, int i)
+{
+ p[i] = __builtin_bswap64 (x);
+}
+
+long long
+reg_reverse (long long x)
+{
+ return __builtin_bswap64 (x);
+}
diff --git a/gcc/testsuite/gfortran.dg/init_flag_10.f90 b/gcc/testsuite/gfortran.dg/init_flag_10.f90
new file mode 100644
index 00000000000..826a34b81ea
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/init_flag_10.f90
@@ -0,0 +1,43 @@
+! { dg-do run }
+! { dg-options "-finit-real=NAN" }
+! { dg-add-options ieee }
+! { dg-skip-if "NaN not supported" { spu-*-* } { "*" } { "" } }
+!
+! PR fortran/50619
+!
+! Contributed by Fred Krogh
+!
+! The NaN initialization used to set the associate name to NaN!
+!
+
+module testa2
+type, public :: test_ty
+ real :: rmult = 1.0e0
+end type test_ty
+
+contains
+ subroutine test(e, var1)
+ type(test_ty) :: e
+ real :: var1, var2 ! Should get NaN initialized
+
+ ! Should be the default value
+ if (e%rmult /= 1.0) call abort ()
+
+ ! Check that NaN initialization is really turned on
+ if (var1 == var1) call abort ()
+ if (var2 == var2) call abort ()
+
+ ! The following was failing:
+ associate (rmult=>e%rmult)
+ if (e%rmult /= 1.0) call abort ()
+ end associate
+ end subroutine test
+end module testa2
+
+program testa1
+ use testa2
+ type(test_ty) :: e
+ real :: var1 ! Should get NaN initialized
+ call test(e, var1)
+ stop
+end program testa1
diff --git a/gcc/testsuite/gfortran.dg/pointer_intent_6.f90 b/gcc/testsuite/gfortran.dg/pointer_intent_6.f90
new file mode 100644
index 00000000000..56c7de5ebba
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pointer_intent_6.f90
@@ -0,0 +1,19 @@
+! { dg-do compile }
+!
+! PR fortran/52864
+!
+! Assigning to an intent(in) pointer (which is valid).
+!
+ program test
+ type PoisFFT_Solver3D
+ complex, dimension(:,:,:), &
+ pointer :: work => null()
+ end type PoisFFT_Solver3D
+ contains
+ subroutine PoisFFT_Solver3D_FullPeriodic(D, p)
+ type(PoisFFT_Solver3D), intent(in) :: D
+ real, intent(in), pointer :: p(:)
+ D%work(i,j,k) = 0.0
+ p = 0.0
+ end subroutine
+ end
diff --git a/gcc/testsuite/gfortran.dg/realloc_on_assign_15.f90 b/gcc/testsuite/gfortran.dg/realloc_on_assign_15.f90
new file mode 100644
index 00000000000..2a0e5be9101
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/realloc_on_assign_15.f90
@@ -0,0 +1,40 @@
+! { dg-do run }
+!
+! PR fortran/53389
+!
+! The program was leaking memory before due to
+! realloc on assignment and nested functions.
+!
+module foo
+ implicit none
+ contains
+
+ function filler(array, val)
+ real, dimension(:), intent(in):: array
+ real, dimension(size(array)):: filler
+ real, intent(in):: val
+
+ filler=val
+
+ end function filler
+end module
+
+program test
+ use foo
+ implicit none
+
+ real, dimension(:), allocatable:: x, y
+ integer, parameter:: N=1000 !*1000
+ integer:: i
+
+! allocate( x(N) )
+ allocate( y(N) )
+ y=0.0
+
+ do i=1, N
+! print *,i
+ x=filler(filler(y, real(2*i)), real(i))
+ y=y+x
+ end do
+
+end program test
diff --git a/gcc/testsuite/gfortran.dg/save_4.f90 b/gcc/testsuite/gfortran.dg/save_4.f90
new file mode 100644
index 00000000000..74ea6e83531
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/save_4.f90
@@ -0,0 +1,13 @@
+! { dg-do compile }
+! { dg-options "-std=f2003" }
+!
+! PR fortran/53597
+!
+MODULE somemodule
+ IMPLICIT NONE
+ TYPE sometype
+ INTEGER :: i
+ DOUBLE PRECISION, POINTER, DIMENSION(:,:) :: coef => NULL()
+ END TYPE sometype
+ TYPE(sometype) :: somevariable ! { dg-error "Fortran 2008: Implied SAVE for module variable 'somevariable' at .1., needed due to the default initialization" }
+END MODULE somemodule
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index 12ef38817eb..b9e39af9159 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -805,6 +805,8 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
infer them and MEM_ATTR caching will share MEM_REFs
with differently-typed op0s. */
&& TREE_CODE (TREE_OPERAND (node, 0)) != INTEGER_CST
+ /* Released SSA_NAMES have no TREE_TYPE. */
+ && TREE_TYPE (TREE_OPERAND (node, 0)) != NULL_TREE
/* Same pointer types, but ignoring POINTER_TYPE vs.
REFERENCE_TYPE. */
&& (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 0)))
@@ -1171,6 +1173,8 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
can't infer them and MEM_ATTR caching will share
MEM_REFs with differently-typed op0s. */
&& TREE_CODE (TREE_OPERAND (op0, 0)) != INTEGER_CST
+ /* Released SSA_NAMES have no TREE_TYPE. */
+ && TREE_TYPE (TREE_OPERAND (op0, 0)) != NULL_TREE
/* Same pointer types, but ignoring POINTER_TYPE vs.
REFERENCE_TYPE. */
&& (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0, 0)))
diff --git a/gcc/varasm.c b/gcc/varasm.c
index d9748887d89..977ca40a088 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1,7 +1,7 @@
/* Output variables, constants and external declarations, for GNU compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010, 2011 Free Software Foundation, Inc.
+ 2010, 2011, 2012 Free Software Foundation, Inc.
This file is part of GCC.
@@ -3944,6 +3944,13 @@ compute_reloc_for_constant (tree exp)
tem = TREE_OPERAND (tem, 0))
;
+ if (TREE_CODE (tem) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (tem, 0)) == ADDR_EXPR)
+ {
+ reloc = compute_reloc_for_constant (TREE_OPERAND (tem, 0));
+ break;
+ }
+
if (TREE_PUBLIC (tem))
reloc |= 2;
else
@@ -4012,6 +4019,9 @@ output_addressed_constants (tree exp)
if (CONSTANT_CLASS_P (tem) || TREE_CODE (tem) == CONSTRUCTOR)
output_constant_def (tem, 0);
+
+ if (TREE_CODE (tem) == MEM_REF)
+ output_addressed_constants (TREE_OPERAND (tem, 0));
break;
case PLUS_EXPR:
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 31e5895f410..3921f72a63c 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-12 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/53310
+ * intrinsics/eoshift2.c (eoshift2): Do not leak
+ memory by allocating it in the loop.
+
2012-03-01 Release Manager
* GCC 4.6.3 released.
diff --git a/libgfortran/intrinsics/eoshift2.c b/libgfortran/intrinsics/eoshift2.c
index 2fbf62e118c..fe38d058b02 100644
--- a/libgfortran/intrinsics/eoshift2.c
+++ b/libgfortran/intrinsics/eoshift2.c
@@ -77,6 +77,12 @@ eoshift2 (gfc_array_char *ret, const gfc_array_char *array,
ret->offset = 0;
ret->dtype = array->dtype;
+
+ if (arraysize > 0)
+ ret->data = internal_malloc_size (size * arraysize);
+ else
+ ret->data = internal_malloc_size (1);
+
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
{
index_type ub, str;
@@ -90,12 +96,6 @@ eoshift2 (gfc_array_char *ret, const gfc_array_char *array,
* GFC_DESCRIPTOR_STRIDE(ret,i-1);
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
-
- if (arraysize > 0)
- ret->data = internal_malloc_size (size * arraysize);
- else
- ret->data = internal_malloc_size (1);
-
}
}
else if (unlikely (compile_options.bounds_check))
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index d8fc4bfbcff..ff20cb1a197 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,10 @@
+2012-06-20 Jörg Sonnenberger <joerg@britannica.bec.de>
+ Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR libstdc++/53678
+ * config/os/bsd/netbsd/ctype_base.h: Check for _CTYPE_U.
+ * testsuite/22_locale/ctype_base/53678.cc: New.
+
2012-04-12 Jeffrey Yasskin <jyasskin@google.com>
PR libstdc++/52822
diff --git a/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h b/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h
index d75cb79aaf6..cd654d685c5 100644
--- a/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h
+++ b/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h
@@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
-// Copyright (C) 2000, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2009, 2011, 2012 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -31,8 +31,6 @@
// anoncvs@anoncvs.netbsd.org:/cvsroot/basesrc/include/ctype.h
// See www.netbsd.org for details of access.
-#include <sys/param.h>
-
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -47,7 +45,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// on the mask type. Because of this, we don't use an enum.
typedef unsigned char mask;
-#if __NetBSD_Version__ < 599004100
+#ifndef _CTYPE_U
static const mask upper = _U;
static const mask lower = _L;
static const mask alpha = _U | _L;
diff --git a/libstdc++-v3/testsuite/22_locale/ctype_base/53678.cc b/libstdc++-v3/testsuite/22_locale/ctype_base/53678.cc
new file mode 100644
index 00000000000..e4a9f071b92
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/ctype_base/53678.cc
@@ -0,0 +1,28 @@
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library 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.
+
+// This library 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 this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+
+// 22.2.1 The ctype category
+
+#include <locale>
+
+// libstdc++/53678
+void test01()
+{
+ bool NetBSD __attribute__((unused)) = true;
+}