diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2009-07-05 07:38:24 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@redhat.com> | 2009-07-05 07:38:24 +0000 |
commit | ef6c0c5f141d809b5f5cce1a492839b9d3becb12 (patch) | |
tree | ea6118ed28ae0d61c97b1f1253617ae33302a757 | |
parent | a97add2ce9430744a2a0c867d9b9ccfb786b693a (diff) |
Merged with gcc-4_4-branch@149247.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/var-tracking-assignments-4_4-branch@149252 138bc75d-0d04-0410-961f-82ee72b054a4
74 files changed, 1698 insertions, 133 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog index c017ff36509..696bb32bf40 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,8 @@ +2009-06-20 Gerald Pfeifer <gerald@pfeifer.com> + + * test_summary: Only include LAST_UPDATED if it exists. + Complete copyright years. + 2009-04-27 Jakub Jelinek <jakub@redhat.com> PR testsuite/39807 diff --git a/contrib/test_summary b/contrib/test_summary index 98664359bc2..9bb06051efd 100755 --- a/contrib/test_summary +++ b/contrib/test_summary @@ -1,6 +1,7 @@ #! /bin/sh -# (C) 1998, 1999, 2000, 2002 Free Software Foundation +# (C) 1998, 1999, 2000, 2002, 2003, 2004, 2007, 2009 +# Free Software Foundation # Originally by Alexandre Oliva <oliva@dcc.unicamp.br> # This script is Free Software, and it can be copied, distributed and @@ -106,9 +107,11 @@ configflags == "" { sub(/^s,@TOPLEVEL_CONFIGURE_ARGUMENTS@,/, "", configflags); srcdir = configflags; sub(/\/configure .*/, "", srcdir); - printf "LAST_UPDATED: "; - system("tail -1 " srcdir "/LAST_UPDATED"); - print ""; + if ( system("test -f " srcdir "/LAST_UPDATED") == 0 ) { + printf "LAST_UPDATED: "; + system("tail -1 " srcdir "/LAST_UPDATED"); + print ""; + } sub(/^[^ ]*\/configure */, " ", configflags); sub(/,;t t $/, " ", configflags); diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 84fe0342d18..73c0c7b295f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,95 @@ +2009-07-03 Vladimir Makarov <vmakarov@redhat.com> + + PR target/40587 + * ira.c (build_insn_chain): Use DF_LR_OUT instead of + df_get_live_out. + +2009-07-02 Richard Guenther <rguenther@suse.de> + + PR middle-end/40585 + * tree-cfg.c (gimple_can_duplicate_bb_p): Disallow duplicating + basic blocks with GIMPLE_RESX. + +2009-07-01 Martin Jambor <mjambor@suse.cz> + + Backport from mainline: + 2009-05-11 Martin Jambor <mjambor@suse.cz> + + * ipa-cp.c (ipcp_cloning_candidate_p): Add missing return false. + +2009-06-30 Jakub Jelinek <jakub@redhat.com> + + PR c++/40566 + * convert.c (convert_to_integer) <case COND_EXPR>: Don't convert + to type arguments that have void type. + +2009-06-30 Ira Rosen <irar@il.ibm.com> + + PR tree-optimization/40542 + * tree-vect-analyze.c (vect_determine_vectorization_factor): Don't + vectorize volatile types. + +2009-06-29 Janis Johnson <janis187@us.ibm.com> + + PR c/39902 + * tree.c (real_zerop, real_onep, real_twop, real_minus_onep): + Special-case decimal float constants. + +2009-06-29 Uros Bizjak <ubizjak@gmail.com> + + * doc/extend.texi (Additional Floating Types): __float128 is also + supported on i386 targets. + +2009-06-29 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/40579 + * tree-vrp.c (vrp_evaluate_conditional): Bail out early if + the IL to simplify has constants that overflowed. + +2009-06-28 Uros Bizjak <ubizjak@gmail.com> + + PR tree-optimization/40550 + * tree-vect-generic.c (expand_vector_operations_1): Compute in + vector_compute_type only when the size of vector_compute_type is + less than the size of type. + +2009-06-27 Kai Tietz <kai.tietz@onevision.com> + + Merged from trunk rev/148061 + 2009-06-01 Jakub Jelinek <jakub@redhat.com> + PR other/40024 + * emutls.c (__emutls_get_address): Change arr->size to mean number + of allocated arr->data entries instead of # of slots + 1. + +2009-06-22 Steven Bosscher <steven@gcc.gnu.org> + Matthias Klose <doko@ubuntu.com> + + PR objc/28050 + * c-parser.c (c_parser_objc_message_args): Return error_mark_node + instead of NULL if a parser error occurs. + +2009-06-18 H.J. Lu <hongjiu.lu@intel.com> + + Backport from mainline: + 2009-06-18 H.J. Lu <hongjiu.lu@intel.com> + + PR target/40470 + * config/i386/i386.h (CLASS_LIKELY_SPILLED_P): Add SSE_FIRST_REG. + +2009-06-17 Richard Guenther <rguenther@suse.de> + + PR middle-end/40460 + * tree-chrec.h (build_polynomial_chrec): If we cannot determine + if there is no evolution of left in the loop bail out. + * tree-chrec.c (chrec_fold_multiply_poly_poly): CSE one + chrec_fold_multiply. + +2009-06-17 Richard Guenther <rguenther@suse.de> + + PR middle-end/40389 + * tree-ssa-operands.c (parse_ssa_operands): Add NRV results + to the addresses taken bitmap. + 2009-06-16 Jakub Jelinek <jakub@redhat.com> PR middle-end/40446 diff --git a/gcc/ChangeLog.vta b/gcc/ChangeLog.vta index a5d4ce507e8..d7a4271cbb3 100644 --- a/gcc/ChangeLog.vta +++ b/gcc/ChangeLog.vta @@ -1,3 +1,7 @@ +2009-07-05 Alexandre Oliva <aoliva@redhat.com> + + Merged with gcc-4_4-branch@149247. + 2009-07-02 Jakub Jelinek <jakub@redhat.com> * dwarf2out.c (mem_loc_descriptor): For SUBREG punt if inner diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 1d49b936678..207804cebd2 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20090617 +20090705 diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index ca84374133c..6d76b99cb61 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,15 @@ +2009-06-30 Eric Botcazou <ebotcazou@adacore.com> + + * gcc-interface/utils2.c (build_binary_op) <MODIFY_EXPR>: Do not use + the type of the left operand if it pads a self-referential type when + the right operand is a constructor. + +2009-06-18 Olivier Hainque <hainque@adacore.com> + + * system-aix64.ads: New file. + * gcc-interface/Makefile.in (aix LIBGNAT_TARGET_PAIRS): Use the + 64bit system.ads for ppc64 multilib variants. + 2009-04-22 Eric Botcazou <ebotcazou@adacore.com> * gcc-interface/utils2.c (build_binary_op) <PLUS_EXPR>: If operation's diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in index c431118608e..d60cbd1dd94 100644 --- a/gcc/ada/gcc-interface/Makefile.in +++ b/gcc/ada/gcc-interface/Makefile.in @@ -1103,7 +1103,7 @@ ifeq ($(strip $(filter-out hppa% hp hpux11%,$(targ))),) endif ifeq ($(strip $(filter-out ibm aix%,$(manu) $(osys))),) - LIBGNAT_TARGET_PAIRS = \ + LIBGNAT_TARGET_PAIRS_COMMON = \ a-intnam.ads<a-intnam-aix.ads \ s-inmaop.adb<s-inmaop-posix.adb \ s-intman.adb<s-intman-posix.adb \ @@ -1112,9 +1112,25 @@ ifeq ($(strip $(filter-out ibm aix%,$(manu) $(osys))),) s-osprim.adb<s-osprim-posix.adb \ s-taprop.adb<s-taprop-posix.adb \ s-taspri.ads<s-taspri-posix.ads \ - s-tpopsp.adb<s-tpopsp-posix.adb \ + s-tpopsp.adb<s-tpopsp-posix.adb + + LIBGNAT_TARGET_PAIRS_32 = \ system.ads<system-aix.ads + LIBGNAT_TARGET_PAIRS_64 = \ + system.ads<system-aix64.ads + + ifeq ($(findstring ppc64, \ + $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) \ + -print-multi-os-directory)), \ + ppc64) + LIBGNAT_TARGET_PAIRS = \ + $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64) + else + LIBGNAT_TARGET_PAIRS = \ + $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32) + endif + THREADSLIB = -lpthreads PREFIX_OBJS=$(PREFIX_REAL_OBJS) diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c index d6b7d684de7..79bd19543e8 100644 --- a/gcc/ada/gcc-interface/utils2.c +++ b/gcc/ada/gcc-interface/utils2.c @@ -697,9 +697,10 @@ build_binary_op (enum tree_code op_code, tree result_type, /* If we are copying between padded objects with compatible types, use the padded view of the objects, this is very likely more efficient. - Likewise for a padded that is assigned a constructor, in order to - avoid putting a VIEW_CONVERT_EXPR on the LHS. But don't do this if - we wouldn't have actually copied anything. */ + Likewise for a padded object that is assigned a constructor, if we + can convert the constructor to the inner type, to avoid putting a + VIEW_CONVERT_EXPR on the LHS. But don't do so if we wouldn't have + actually copied anything. */ else if (TREE_CODE (left_type) == RECORD_TYPE && TYPE_IS_PADDING_P (left_type) && TREE_CONSTANT (TYPE_SIZE (left_type)) @@ -709,9 +710,11 @@ build_binary_op (enum tree_code op_code, tree result_type, && TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (right_operand, 0))) && gnat_types_compatible_p - (left_type, - TREE_TYPE (TREE_OPERAND (right_operand, 0)))) - || TREE_CODE (right_operand) == CONSTRUCTOR) + (left_type, + TREE_TYPE (TREE_OPERAND (right_operand, 0)))) + || (TREE_CODE (right_operand) == CONSTRUCTOR + && !CONTAINS_PLACEHOLDER_P + (DECL_SIZE (TYPE_FIELDS (left_type))))) && !integer_zerop (TYPE_SIZE (right_type))) operation_type = left_type; diff --git a/gcc/ada/system-aix64.ads b/gcc/ada/system-aix64.ads new file mode 100644 index 00000000000..c32125281da --- /dev/null +++ b/gcc/ada/system-aix64.ads @@ -0,0 +1,155 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- S Y S T E M -- +-- -- +-- S p e c -- +-- (PPC/AIX64 Version) -- +-- -- +-- Copyright (C) 2009, Free Software Foundation, Inc. -- +-- -- +-- This specification is derived from the Ada Reference Manual for use with -- +-- GNAT. The copyright notice above, and the license provisions that follow -- +-- apply solely to the contents of the part following the private keyword. -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. -- +-- -- +-- As a special exception under Section 7 of GPL version 3, you are granted -- +-- additional permissions described in the GCC Runtime Library Exception, -- +-- version 3.1, as published by the Free Software Foundation. -- +-- -- +-- You should have received a copy of the GNU General Public License and -- +-- a copy of the GCC Runtime Library Exception along with this program; -- +-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- +-- <http://www.gnu.org/licenses/>. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +package System is + pragma Pure; + -- Note that we take advantage of the implementation permission to make + -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada + -- 2005, this is Pure in any case (AI-362). + + type Name is (SYSTEM_NAME_GNAT); + System_Name : constant Name := SYSTEM_NAME_GNAT; + + -- System-Dependent Named Numbers + + Min_Int : constant := Long_Long_Integer'First; + Max_Int : constant := Long_Long_Integer'Last; + + Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size; + Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1; + + Max_Base_Digits : constant := Long_Long_Float'Digits; + Max_Digits : constant := Long_Long_Float'Digits; + + Max_Mantissa : constant := 63; + Fine_Delta : constant := 2.0 ** (-Max_Mantissa); + + Tick : constant := 0.01; + + -- Storage-related Declarations + + type Address is private; + pragma Preelaborable_Initialization (Address); + Null_Address : constant Address; + + Storage_Unit : constant := 8; + Word_Size : constant := 64; + Memory_Size : constant := 2 ** 64; + + -- Address comparison + + function "<" (Left, Right : Address) return Boolean; + function "<=" (Left, Right : Address) return Boolean; + function ">" (Left, Right : Address) return Boolean; + function ">=" (Left, Right : Address) return Boolean; + function "=" (Left, Right : Address) return Boolean; + + pragma Import (Intrinsic, "<"); + pragma Import (Intrinsic, "<="); + pragma Import (Intrinsic, ">"); + pragma Import (Intrinsic, ">="); + pragma Import (Intrinsic, "="); + + -- Other System-Dependent Declarations + + type Bit_Order is (High_Order_First, Low_Order_First); + Default_Bit_Order : constant Bit_Order := High_Order_First; + pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning + + -- Priority-related Declarations (RM D.1) + + -- 0 .. 126 corresponds to the system priority range 1 .. 127. + -- + -- If the scheduling policy is SCHED_FIFO or SCHED_RR the runtime makes use + -- of the entire range provided by the system. + -- + -- If the scheduling policy is SCHED_OTHER the only valid system priority + -- is 1 and that is the only value ever passed to the system, regardless of + -- how priorities are set by user programs. + + Max_Priority : constant Positive := 125; + Max_Interrupt_Priority : constant Positive := 126; + + subtype Any_Priority is Integer range 0 .. 126; + subtype Priority is Any_Priority range 0 .. 125; + subtype Interrupt_Priority is Any_Priority range 126 .. 126; + + Default_Priority : constant Priority := + (Priority'First + Priority'Last) / 2; + +private + + type Address is mod Memory_Size; + Null_Address : constant Address := 0; + + -------------------------------------- + -- System Implementation Parameters -- + -------------------------------------- + + -- These parameters provide information about the target that is used + -- by the compiler. They are in the private part of System, where they + -- can be accessed using the special circuitry in the Targparm unit + -- whose source should be consulted for more detailed descriptions + -- of the individual switch values. + + Backend_Divide_Checks : constant Boolean := False; + Backend_Overflow_Checks : constant Boolean := True; + Command_Line_Args : constant Boolean := True; + Configurable_Run_Time : constant Boolean := False; + Denorm : constant Boolean := True; + Duration_32_Bits : constant Boolean := False; + Exit_Status_Supported : constant Boolean := True; + Fractional_Fixed_Ops : constant Boolean := False; + Frontend_Layout : constant Boolean := False; + Machine_Overflows : constant Boolean := False; + Machine_Rounds : constant Boolean := True; + Preallocated_Stacks : constant Boolean := False; + Signed_Zeros : constant Boolean := True; + Stack_Check_Default : constant Boolean := False; + Stack_Check_Probes : constant Boolean := True; + Stack_Check_Limits : constant Boolean := False; + Support_64_Bit_Divides : constant Boolean := True; + Support_Aggregates : constant Boolean := True; + Support_Composite_Assign : constant Boolean := True; + Support_Composite_Compare : constant Boolean := True; + Support_Long_Shifts : constant Boolean := True; + Always_Compatible_Rep : constant Boolean := True; + Suppress_Standard_Library : constant Boolean := False; + Use_Ada_Main_Program_Name : constant Boolean := False; + ZCX_By_Default : constant Boolean := False; + GCC_ZCX_Support : constant Boolean := True; -- Post GCC 4 only + +end System; diff --git a/gcc/c-parser.c b/gcc/c-parser.c index ac37a5a9d77..0f047def1cf 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -6564,7 +6564,7 @@ c_parser_objc_message_args (c_parser *parser) { tree keywordexpr; if (!c_parser_require (parser, CPP_COLON, "expected %<:%>")) - return list; + return error_mark_node; keywordexpr = c_parser_objc_keywordexpr (parser); list = chainon (list, build_tree_list (sel, keywordexpr)); sel = c_parser_objc_selector (parser); diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index ff312fd2f2f..0374ac11d34 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -1475,6 +1475,7 @@ enum reg_class || ((CLASS) == AD_REGS) \ || ((CLASS) == SIREG) \ || ((CLASS) == DIREG) \ + || ((CLASS) == SSE_FIRST_REG) \ || ((CLASS) == FP_TOP_REG) \ || ((CLASS) == FP_SECOND_REG)) diff --git a/gcc/convert.c b/gcc/convert.c index e98b6578de9..6a2c817f0d2 100644 --- a/gcc/convert.c +++ b/gcc/convert.c @@ -740,10 +740,16 @@ convert_to_integer (tree type, tree expr) case COND_EXPR: /* It is sometimes worthwhile to push the narrowing down through - the conditional and never loses. */ + the conditional and never loses. A COND_EXPR may have a throw + as one operand, which then has void type. Just leave void + operands as they are. */ return fold_build3 (COND_EXPR, type, TREE_OPERAND (expr, 0), - convert (type, TREE_OPERAND (expr, 1)), - convert (type, TREE_OPERAND (expr, 2))); + VOID_TYPE_P (TREE_TYPE (TREE_OPERAND (expr, 1))) + ? TREE_OPERAND (expr, 1) + : convert (type, TREE_OPERAND (expr, 1)), + VOID_TYPE_P (TREE_TYPE (TREE_OPERAND (expr, 2))) + ? TREE_OPERAND (expr, 2) + : convert (type, TREE_OPERAND (expr, 2))); default: break; diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 307d8831e8b..325066ae94c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,20 @@ +2009-07-04 Jason Merrill <jason@redhat.com> + + PR c++/40619 + * tree.c (cp_tree_equal) [PARM_DECL]: Don't check parm index. + +2009-06-30 Jason Merrill <jason@redhat.com> + + PR c++/40595 + * pt.c (tsubst_pack_expansion): Handle unexpanded packs in an + EXPR_PACK_EXPANSION. + +2009-06-24 Jason Merrill <jason@redhat.com> + + PR c++/40342 + * decl.c (decls_match): Check DECL_TI_TEMPLATE too. + * class.c (resolve_address_of_overloaded_function): Fix typo. + 2009-06-09 Jason Merrill <jason@redhat.com> PR c++/40381 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index ae3f2c4bcde..2d41cd575a8 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -6158,7 +6158,7 @@ resolve_address_of_overloaded_function (tree target_type, fn = TREE_PURPOSE (matches); for (match = TREE_CHAIN (matches); match; match = TREE_CHAIN (match)) - if (!decls_match (fn, TREE_PURPOSE (matches))) + if (!decls_match (fn, TREE_PURPOSE (match))) break; if (match) diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 01d4f121320..730ab9519cc 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -929,6 +929,17 @@ decls_match (tree newdecl, tree olddecl) tree p1 = TYPE_ARG_TYPES (f1); tree p2 = TYPE_ARG_TYPES (f2); + /* Specializations of different templates are different functions + even if they have the same type. */ + tree t1 = (DECL_USE_TEMPLATE (newdecl) + ? DECL_TI_TEMPLATE (newdecl) + : NULL_TREE); + tree t2 = (DECL_USE_TEMPLATE (olddecl) + ? DECL_TI_TEMPLATE (olddecl) + : NULL_TREE); + if (t1 != t2) + return 0; + if (CP_DECL_CONTEXT (newdecl) != CP_DECL_CONTEXT (olddecl) && ! (DECL_EXTERN_C_P (newdecl) && DECL_EXTERN_C_P (olddecl))) diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 0ad4d5b26d9..dc3a02fc240 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -7597,8 +7597,15 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain, and return a PACK_EXPANSION_*. The caller will need to deal with that. */ if (unsubstituted_packs) - return make_pack_expansion (tsubst (pattern, args, complain, - in_decl)); + { + tree new_pat; + if (TREE_CODE (t) == EXPR_PACK_EXPANSION) + new_pat = tsubst_expr (pattern, args, complain, in_decl, + /*integral_constant_expression_p=*/false); + else + new_pat = tsubst (pattern, args, complain, in_decl); + return make_pack_expansion (new_pat); + } /* We could not find any argument packs that work. */ if (len < 0) diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index b4b977ef1a9..b1a65b05218 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1880,8 +1880,7 @@ cp_tree_equal (tree t1, tree t2) case PARM_DECL: /* For comparing uses of parameters in late-specified return types with an out-of-class definition of the function. */ - if (same_type_p (TREE_TYPE (t1), TREE_TYPE (t2)) - && parm_index (t1) == parm_index (t2)) + if (same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))) return true; else return false; diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index fcbc9036a9c..02c2725a5dc 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -914,8 +914,7 @@ typedef _Complex float __attribute__((mode(XC))) _Complex80; @end smallexample Not all targets support additional floating point types. @code{__float80} -is supported on i386, x86_64 and ia64 targets and target @code{__float128} -is supported on x86_64 and ia64 targets. +and @code{__float128} types are supported on i386, x86_64 and ia64 targets. @node Decimal Float @section Decimal Floating Types diff --git a/gcc/emutls.c b/gcc/emutls.c index a9c7cf6954c..b7ee3bdfa7c 100644 --- a/gcc/emutls.c +++ b/gcc/emutls.c @@ -155,23 +155,23 @@ __emutls_get_address (struct __emutls_object *obj) if (__builtin_expect (arr == NULL, 0)) { pointer size = offset + 32; - arr = calloc (size, sizeof (void *)); + arr = calloc (size + 1, sizeof (void *)); if (arr == NULL) abort (); arr->size = size; __gthread_setspecific (emutls_key, (void *) arr); } - else if (__builtin_expect (offset >= arr->size, 0)) + else if (__builtin_expect (offset > arr->size, 0)) { pointer orig_size = arr->size; pointer size = orig_size * 2; - if (offset >= size) + if (offset > size) size = offset + 32; - arr = realloc (arr, size * sizeof (void *)); + arr = realloc (arr, (size + 1) * sizeof (void *)); if (arr == NULL) abort (); arr->size = size; - memset (arr->data + orig_size - 1, 0, + memset (arr->data + orig_size, 0, (size - orig_size) * sizeof (void *)); __gthread_setspecific (emutls_key, (void *) arr); } diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 20b31ecf118..f386650f135 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,37 @@ +2009-07-04 Jakub Jelinek <jakub@redhat.com> + + * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): For integer + maxloc initialize limit to -huge-1 rather than just -huge. + +2009-07-03 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/40638 + * trans-io.c (set_parameter_value): Don't build un-necessary run-time + checks for units of KIND less than 4. + +2009-06-29 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/40443 + * interface.c (gfc_search_interface): Hold back a match to an + elementary procedure until all other possibilities are + exhausted. + +2009-06-20 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/39800 + * resolve.c (is_sym_host_assoc): New function. + (resolve_fl_derived): Call it when checking PRIVATE components + of PUBLIC derived types. Change gfc_error to a gfc_notify_std + with std=f2003. + (resolve_fl_namelist): Call it twice to check for host + association. + +2009-06-20 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/40402 + * resolve.c (next_data_value): It is an error if the value is + not constant. + 2009-06-14 Richard Guenther <rguenther@suse.de> Backport from mainline diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 88638070d3c..01ca2c773c0 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -2502,6 +2502,7 @@ gfc_symbol * gfc_search_interface (gfc_interface *intr, int sub_flag, gfc_actual_arglist **ap) { + gfc_symbol *elem_sym = NULL; for (; intr; intr = intr->next) { if (sub_flag && intr->sym->attr.function) @@ -2510,10 +2511,19 @@ gfc_search_interface (gfc_interface *intr, int sub_flag, continue; if (gfc_arglist_matches_symbol (ap, intr->sym)) - return intr->sym; + { + /* Satisfy 12.4.4.1 such that an elemental match has lower + weight than a non-elemental match. */ + if (intr->sym->attr.elemental) + { + elem_sym = intr->sym; + continue; + } + return intr->sym; + } } - return NULL; + return elem_sym ? elem_sym : NULL; } diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 47f0a7abc8f..bd0018094bd 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -82,6 +82,18 @@ gfc_is_formal_arg (void) return formal_arg_flag; } +/* Is the symbol host associated? */ +static bool +is_sym_host_assoc (gfc_symbol *sym, gfc_namespace *ns) +{ + for (ns = ns->parent; ns; ns = ns->parent) + { + if (sym->ns == ns) + return true; + } + + return false; +} /* Ensure a typespec used is valid; for instance, TYPE(t) is invalid if t is an ABSTRACT derived-type. If where is not NULL, an error message with that @@ -8715,13 +8727,15 @@ resolve_fl_derived (gfc_symbol *sym) if (c->ts.type == BT_DERIVED && sym->component_access != ACCESS_PRIVATE && gfc_check_access (sym->attr.access, sym->ns->default_access) + && !is_sym_host_assoc (c->ts.derived, sym->ns) && !c->ts.derived->attr.use_assoc && !gfc_check_access (c->ts.derived->attr.access, c->ts.derived->ns->default_access)) { - gfc_error ("The component '%s' is a PRIVATE type and cannot be " - "a component of '%s', which is PUBLIC at %L", - c->name, sym->name, &sym->declared_at); + gfc_notify_std (GFC_STD_F2003, "Fortran 2003: the component '%s' " + "is a PRIVATE type and cannot be a component of " + "'%s', which is PUBLIC at %L", c->name, + sym->name, &sym->declared_at); return FAILURE; } @@ -8803,9 +8817,7 @@ resolve_fl_namelist (gfc_symbol *sym) for (nl = sym->namelist; nl; nl = nl->next) { if (!nl->sym->attr.use_assoc - && !(sym->ns->parent == nl->sym->ns) - && !(sym->ns->parent - && sym->ns->parent->parent == nl->sym->ns) + && !is_sym_host_assoc (nl->sym, sym->ns) && !gfc_check_access(nl->sym->attr.access, nl->sym->ns->default_access)) { @@ -8827,7 +8839,7 @@ resolve_fl_namelist (gfc_symbol *sym) /* Types with private components that are defined in the same module. */ if (nl->sym->ts.type == BT_DERIVED - && !(sym->ns->parent == nl->sym->ts.derived->ns) + && !is_sym_host_assoc (nl->sym->ts.derived, sym->ns) && !gfc_check_access (nl->sym->ts.derived->attr.private_comp ? ACCESS_PRIVATE : ACCESS_UNKNOWN, nl->sym->ns->default_access)) @@ -9430,9 +9442,12 @@ values; static gfc_try next_data_value (void) { - while (mpz_cmp_ui (values.left, 0) == 0) { + if (!gfc_is_constant_expr (values.vnode->expr)) + gfc_error ("non-constant DATA value at %L", + &values.vnode->expr->where); + if (values.vnode->next == NULL) return FAILURE; diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index bf5d51086ee..fb1e6cdc6e1 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -2181,12 +2181,12 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, int op) possible value is HUGE in both cases. */ if (op == GT_EXPR) tmp = fold_build1 (NEGATE_EXPR, TREE_TYPE (tmp), tmp); - gfc_add_modify (&se->pre, limit, tmp); - if (op == GT_EXPR && expr->ts.type == BT_INTEGER) tmp = fold_build2 (MINUS_EXPR, TREE_TYPE (tmp), tmp, build_int_cst (type, 1)); + gfc_add_modify (&se->pre, limit, tmp); + /* Initialize the scalarizer. */ gfc_init_loopinfo (&loop); gfc_add_ss_to_loop (&loop, arrayss); diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c index b5749ec89ac..a31eb8fe48d 100644 --- a/gcc/fortran/trans-io.c +++ b/gcc/fortran/trans-io.c @@ -471,7 +471,7 @@ set_parameter_value (stmtblock_t *block, tree var, enum iofield type, gfc_conv_expr_val (&se, e); /* If we're storing a UNIT number, we need to check it first. */ - if (type == IOPARM_common_unit && e->ts.kind != 4) + if (type == IOPARM_common_unit && e->ts.kind > 4) { tree cond, max; int i; diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index f6864bb43fa..e928084aa16 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -466,6 +466,7 @@ ipcp_cloning_candidate_p (struct cgraph_node *node) if (dump_file) fprintf (dump_file, "Not considering %s for cloning; no hot calls.\n", cgraph_node_name (node)); + return false; } if (dump_file) fprintf (dump_file, "Considering %s for cloning.\n", diff --git a/gcc/ira.c b/gcc/ira.c index 3653b1a2798..972cff26ac2 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -2794,14 +2794,14 @@ build_insn_chain (void) CLEAR_REG_SET (live_relevant_regs); memset (live_subregs_used, 0, max_regno * sizeof (int)); - EXECUTE_IF_SET_IN_BITMAP (df_get_live_out (bb), 0, i, bi) + EXECUTE_IF_SET_IN_BITMAP (DF_LR_OUT (bb), 0, i, bi) { if (i >= FIRST_PSEUDO_REGISTER) break; bitmap_set_bit (live_relevant_regs, i); } - EXECUTE_IF_SET_IN_BITMAP (df_get_live_out (bb), + EXECUTE_IF_SET_IN_BITMAP (DF_LR_OUT (bb), FIRST_PSEUDO_REGISTER, i, bi) { if (pseudo_for_reload_consideration_p (i)) diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index 67e41c5b0e2..28b6c7290b1 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,10 @@ +2009-06-22 Steven Bosscher <steven@gcc.gnu.org> + Matthias Klose <doko@ubuntu.com> + + PR objc/28050 + * objc-act.c (objc_build_message_args): Return if ARGS is the + error_mark_node. + 2009-04-21 Release Manager * GCC 4.4.0 released. diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 37b48006f36..bd28583bcce 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -6201,7 +6201,7 @@ objc_build_message_expr (tree mess) #endif tree method_params = NULL_TREE; - if (TREE_CODE (receiver) == ERROR_MARK) + if (TREE_CODE (receiver) == ERROR_MARK || TREE_CODE (args) == ERROR_MARK) return error_mark_node; /* Obtain the full selector name. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2ec1d112a26..99e8bbeaeef 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,146 @@ +2009-07-04 Jakub Jelinek <jakub@redhat.com> + + * gfortran.dg/maxloc_1.f90: New test. + +2009-07-04 H.J. Lu <hongjiu.lu@intel.com> + + Backport from mainline: + 2009-07-03 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/40640 + * gcc.c-torture/compile/pr40640.c: New testcase. + +2009-07-03 Vladimir Makarov <vmakarov@redhat.com> + + PR target/40587 + * gfortran.dg/pr40587.f: New test. + +2009-07-03 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/40638 + * gfortran.dg/unit_1.f90: New test. + +2009-06-30 Jakub Jelinek <jakub@redhat.com> + + PR c++/40566 + * g++.dg/parse/cond5.C: New test. + +2009-06-30 Jason Merrill <jason@redhat.com> + + PR c++/40595 + * g++.dg/cpp0x/variadic94.C: New. + +2009-06-30 H.J. Lu <hongjiu.lu@intel.com> + + Backport from mainline: + 2009-06-30 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/40576 + * gfortran.dg/internal_write_1.f90: New testcase. + + 2009-06-30 Janus Weil <janus@gcc.gnu.org> + + PR fortran/40594 + * gfortran.dg/derived_pointer_recursion_2.f90: New. + +2009-06-30 H.J. Lu <hongjiu.lu@intel.com> + + Backport from mainline: + 2009-06-30 Martin Jambor <mjambor@suse.cz> + + PR tree-optimization/40582 + * gcc.c-torture/compile/pr40582.c: New test. + + 2009-06-29 Jason Merrill <jason@redhat.com> + + PR c++/40274 + * g++.dg/template/debug1.C: New. + + 2009-06-25 Martin Jambor <mjambor@suse.cz> + + PR tree-optimization/40493 + * gcc.c-torture/execute/pr40493.c: New test. + +2009-06-30 Ira Rosen <irar@il.ibm.com> + + PR tree-optimization/40542 + * gcc.dg/vect/pr40542.c: New test. + +2009-06-29 Janis Johnson <janis187@us.ibm.com> + + PR c/39902 + * gcc.dg/dfp/pr39902.c: New test. + +2009-06-29 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/40443 + * gfortran.dg/generic_18.f90: New test. + +2009-06-29 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/40579 + * gcc.c-torture/execute/pr40579.c: New testcase. + +2009-06-28 Uros Bizjak <ubizjak@gmail.com> + + PR tree-optimization/40550 + * gcc.dg/pr40550.c: New test. + +2009-06-24 Jason Merrill <jason@redhat.com> + + PR c++/40342 + * g++.dg/template/overload10.C: New. + +2009-06-22 Matthias Klose <doko@ubuntu.com> + + PR objc/28050 + * pr28050.m: New testcase. + +2009-06-22 H.J. Lu <hongjiu.lu@intel.com> + + Backport from mainline: + 2009-06-22 Martin Jambor <mjambor@suse.cz> + + PR tree-optimization/40492 + * g++.dg/torture/pr40492.C: New test. + +2009-06-20 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/39800 + * gfortran.dg/private_type_13.f90: New test. + * gfortran.dg/private_type_2.f90: Add option -std=f95. + +2009-06-20 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/40402 + * gfortran.dg/data_value_1.f90: New test. + +2009-06-18 H.J. Lu <hongjiu.lu@intel.com> + + Backport from mainline: + 2009-06-18 H.J. Lu <hongjiu.lu@intel.com> + + PR target/40470 + * gcc.dg/torture/pr40470-1.c: New. + * gcc.dg/torture/pr40470-2.c: Likewise. + * gcc.dg/torture/pr40470-3.c: Likewise. + * gcc.dg/torture/pr40470-4.c: Likewise. + +2009-06-17 Richard Guenther <rguenther@suse.de> + + PR middle-end/40404 + * gcc.c-torture/execute/pr40404.c: New testcase. + +2009-06-17 Richard Guenther <rguenther@suse.de> + + PR middle-end/40460 + * g++.dg/torture/pr40460.C: New testcase. + +2009-06-17 Richard Guenther <rguenther@suse.de> + + PR middle-end/40389 + * g++.dg/torture/pr40389.C: New testcase. + 2009-06-16 Jakub Jelinek <jakub@redhat.com> PR middle-end/40446 @@ -160,33 +303,33 @@ * g++.dg/torture/pr34222.C (ptrdiff_t): Likewise. * g++.dg/tree-ssa/pr22444.C (ptrdiff_t): Likewise. (size_t): Use __extension__ and __SIZE_TYPE__. - * gcc.c-torture/compile/20000211-1.c (size_t): Typedef size_t via + * gcc.c-torture/compile/20000211-1.c (size_t): Typedef size_t via __SIZE_TYPE__. - * gcc.c-torture/compile/20010328-1.c (size_t): Likewise, - * gcc.c-torture/compile/20030320-1.c (size_t): Likewise, - * gcc.c-torture/compile/20030405-1.c (size_t): Likewise, - * gcc.c-torture/compile/20030902-1.c (size_t): Likewise, - * gcc.c-torture/compile/20060202-1.c (size_t): Likewise, - * gcc.c-torture/compile/20080613-1.c (size_t): Likewise, - * gcc.c-torture/compile/920428-2.c (size_t): Likewise, - * gcc.c-torture/compile/980329-1.c (size_t): Likewise, - * gcc.c-torture/compile/980816-1.c (size_t): Likewise, - * gcc.c-torture/compile/pr32584.c (size_t): Likewise, - * (__ssize_t): Likewise. - * gcc.c-torture/compile/pr33173.c (size_t): Likewise, - * gcc.c-torture/compile/pr33382.c (size_t): Likewise, - * gcc.c-torture/compile/pr34334.c (size_t): Likewise, - * gcc.c-torture/compile/pr34688.c (size_t): Likewise, - * gcc.c-torture/compile/pr35043.c (size_t): Likewise, - * gcc.c-torture/compile/pr37669.c (size_t): Likewise, - * gcc.dg/20050629-1.c (size_t): Typedef size_t via __SIZE_TYPE__. - * gcc.dg/pr33667.c (size_t): Likewise. - * gcc.dg/prefetch-loop-arrays-1.c (size_t): Likewise. - * gcc.dg/torture/pr39204.c (size_t): Likewise. - * gcc.dg/tree-ssa/20041122-1.c (size_t): Likewise. - * gcc.dg/tree-ssa/pr36908.c (size_t): Likewise. - * gcc.dg/tree-ssa/pr38250.c (size_t): Likewise. - * gcc.dg/tree-ssa/ssa-dse-10.c (size_t): Likewise. + * gcc.c-torture/compile/20010328-1.c (size_t): Likewise, + * gcc.c-torture/compile/20030320-1.c (size_t): Likewise, + * gcc.c-torture/compile/20030405-1.c (size_t): Likewise, + * gcc.c-torture/compile/20030902-1.c (size_t): Likewise, + * gcc.c-torture/compile/20060202-1.c (size_t): Likewise, + * gcc.c-torture/compile/20080613-1.c (size_t): Likewise, + * gcc.c-torture/compile/920428-2.c (size_t): Likewise, + * gcc.c-torture/compile/980329-1.c (size_t): Likewise, + * gcc.c-torture/compile/980816-1.c (size_t): Likewise, + * gcc.c-torture/compile/pr32584.c (size_t): Likewise, + * (__ssize_t): Likewise. + * gcc.c-torture/compile/pr33173.c (size_t): Likewise, + * gcc.c-torture/compile/pr33382.c (size_t): Likewise, + * gcc.c-torture/compile/pr34334.c (size_t): Likewise, + * gcc.c-torture/compile/pr34688.c (size_t): Likewise, + * gcc.c-torture/compile/pr35043.c (size_t): Likewise, + * gcc.c-torture/compile/pr37669.c (size_t): Likewise, + * gcc.dg/20050629-1.c (size_t): Typedef size_t via __SIZE_TYPE__. + * gcc.dg/pr33667.c (size_t): Likewise. + * gcc.dg/prefetch-loop-arrays-1.c (size_t): Likewise. + * gcc.dg/torture/pr39204.c (size_t): Likewise. + * gcc.dg/tree-ssa/20041122-1.c (size_t): Likewise. + * gcc.dg/tree-ssa/pr36908.c (size_t): Likewise. + * gcc.dg/tree-ssa/pr38250.c (size_t): Likewise. + * gcc.dg/tree-ssa/ssa-dse-10.c (size_t): Likewise. 2009-05-27 Kai TIetz <kai.tietz@onevision.com> @@ -759,7 +902,7 @@ 2009-04-06 Laurent GUERBY <laurent@guerby.net> - * lib/gnat.exp: Handle multilib. + * lib/gnat.exp: Handle multilib. 2009-04-06 Jason Merrill <jason@redhat.com> diff --git a/gcc/testsuite/g++.dg/cpp0x/auto16.C b/gcc/testsuite/g++.dg/cpp0x/auto16.C new file mode 100644 index 00000000000..1b4ae8f82b2 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/auto16.C @@ -0,0 +1,7 @@ +// PR c++/40619 +// { dg-options "-std=c++0x" } + +template<typename U> struct X {}; + +template<typename T> auto f(T t) -> X<decltype(t+1)> {} +template<typename T> auto g(T t) -> X<decltype(t+1)> {} diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic94.C b/gcc/testsuite/g++.dg/cpp0x/variadic94.C new file mode 100644 index 00000000000..8420f73a6a6 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic94.C @@ -0,0 +1,33 @@ +// PR c++/40595 +// { dg-options "-std=c++0x" } + +template<int N> +struct S +{ + typedef int type; +}; + +template<typename T> +struct Get +{ + static T get(); +}; + +template<typename F> +struct B +{ + template<typename ... Args> + typename S<sizeof( Get<F>::get() (Get<Args>::get() ...) )>::type + f(Args&& ... a); +}; + +struct X +{ + bool operator()(int) const; +}; + +int main() +{ + B<X> b; + b.f(1); +} diff --git a/gcc/testsuite/g++.dg/parse/cond5.C b/gcc/testsuite/g++.dg/parse/cond5.C new file mode 100644 index 00000000000..7ed9fbe892e --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/cond5.C @@ -0,0 +1,10 @@ +// PR c++/40566 + +void +f (int x, int y) +{ + int c = x ? 23 : throw "bla"; + short d = y ? throw "bla" : 23; + char e = x ? 23 : throw "bla"; + long f = x ? 23 : throw "bla"; +} diff --git a/gcc/testsuite/g++.dg/template/debug1.C b/gcc/testsuite/g++.dg/template/debug1.C new file mode 100644 index 00000000000..a2c1577029b --- /dev/null +++ b/gcc/testsuite/g++.dg/template/debug1.C @@ -0,0 +1,18 @@ +// PR c++/40274 +// { dg-options "-g" } + +template <class T> struct valuelist_types +{ + struct null { }; + template <T V, class next=null> struct list { }; +}; + +template <unsigned D> void foo() +{ + typename valuelist_types<unsigned>::template list<D> v; +} + +void bar() +{ + valuelist_types<unsigned>::list<2> v; +} diff --git a/gcc/testsuite/g++.dg/template/overload10.C b/gcc/testsuite/g++.dg/template/overload10.C new file mode 100644 index 00000000000..088b9d291cb --- /dev/null +++ b/gcc/testsuite/g++.dg/template/overload10.C @@ -0,0 +1,6 @@ +// PR c++40342 + +template <typename T1, typename T2> int f(T1 *, const T2 *); // { dg-error "" } +template <typename T1, typename T2> int f(const T1 *, T2 *); // { dg-error "" } + +int (*p)(const int *, const int *) = f; // { dg-error "ambiguous" } diff --git a/gcc/testsuite/g++.dg/torture/pr40389.C b/gcc/testsuite/g++.dg/torture/pr40389.C new file mode 100644 index 00000000000..e3ceb1238b6 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr40389.C @@ -0,0 +1,84 @@ +/* { dg-do run } */ + +template <typename V> struct S +{ + V *f, *l; + __attribute__ ((noinline)) S (void) { f = 0, l = 0; } + void foo (V *x) + { + if (x->p != 0) + x->p->n = x->n; + else + f = x->n; + if (x->n != 0) + x->n->p = x->p; + else + l = x->p; + } + __attribute__ ((noinline)) void bar (V *x) + { + x->n = 0; + x->p = l; + if (l != 0) + l->n = x; + else + f = x; + l = x; + } +}; + +struct H; + +struct A +{ + S <H> k; +}; + +struct H +{ + A *a; + H *p, *n; + __attribute__ ((noinline)) H (void) { p = 0, n = 0, a = 0; } + __attribute__ ((noinline)) H (A *b) : a (b) + { + p = 0; + n = 0; + if (a != 0) + a->k.bar (this); + } + __attribute__ ((noinline)) H (const H &h) : a (h.a) + { + p = 0; + n = 0; + if (a != 0) + a->k.bar (this); + } + ~H (void) { if (a != 0) a->k.foo (this); } + H &operator= (const H &o) + { + if (a != 0 || &o == this) + __builtin_abort (); + a = o.a; + if (a != 0) + a->k.bar (this); + return *this; + } +}; + +__attribute__ ((noinline)) +H baz (void) +{ + return H (new A); +} + +H g; + +int +main (void) +{ + g = baz (); + if (g.a->k.f != &g) + __builtin_abort (); + return 0; +} + diff --git a/gcc/testsuite/g++.dg/torture/pr40460.C b/gcc/testsuite/g++.dg/torture/pr40460.C new file mode 100644 index 00000000000..1d54df72b57 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr40460.C @@ -0,0 +1,9 @@ +/* { dg-do compile } */ + +void bar(int); +void foo(void) +{ + for (int i = 0; i<1; ++i) + bar (i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i); +} + diff --git a/gcc/testsuite/g++.dg/torture/pr40492.C b/gcc/testsuite/g++.dg/torture/pr40492.C new file mode 100644 index 00000000000..cab9426d010 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr40492.C @@ -0,0 +1,26 @@ +typedef unsigned short ushort; +class QChar { +public: + QChar( const QChar& c ); + ushort ucs; +}; +inline QChar::QChar( const QChar& c ) : ucs( c.ucs ) { }; +class QString { }; +class KoAutoFormat { +public: + struct TypographicQuotes { QChar begin, end; }; + TypographicQuotes getConfigTypographicDoubleQuotes() const { + return m_typographicDoubleQuotes; + } + TypographicQuotes m_typographicDoubleQuotes; +}; +class KoAutoFormatDia { + QChar oDoubleBegin, oDoubleEnd; + KoAutoFormat * m_docAutoFormat; + bool noSignal; + void changeAutoformatLanguage(void); +}; +void KoAutoFormatDia::changeAutoformatLanguage(void) +{ + oDoubleEnd= m_docAutoFormat->getConfigTypographicDoubleQuotes().end; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pr40582.c b/gcc/testsuite/gcc.c-torture/compile/pr40582.c new file mode 100644 index 00000000000..51234da40f2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr40582.c @@ -0,0 +1,18 @@ +struct A +{ + void* q; + short i; +}; + +union U +{ + char* p; + struct A a; +}; + +struct A foo(union U u) +{ + struct A a = { 0, 0 }; + a = u.a; + return a; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pr40640.c b/gcc/testsuite/gcc.c-torture/compile/pr40640.c new file mode 100644 index 00000000000..7dae7ca8190 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr40640.c @@ -0,0 +1,15 @@ +void decode_opic_address(int *); +void sim_io_printf_filtered2 (int, unsigned); +void +hw_opic_io_read_buffer(int index) +{ + unsigned reg = 0; + decode_opic_address(&index); + switch (index) + { + case 0: + reg = 1; + } + sim_io_printf_filtered2 (index, reg); +} + diff --git a/gcc/testsuite/gcc.c-torture/execute/pr40404.c b/gcc/testsuite/gcc.c-torture/execute/pr40404.c new file mode 100644 index 00000000000..a759a3f5c7d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr40404.c @@ -0,0 +1,12 @@ +extern void abort (void); +struct S { + unsigned int ui17 : 17; +} s; +int main() +{ + s.ui17 = 0x1ffff; + if (s.ui17 >= 0xfffffffeu) + abort (); + return 0; +} + diff --git a/gcc/testsuite/gcc.c-torture/execute/pr40493.c b/gcc/testsuite/gcc.c-torture/execute/pr40493.c new file mode 100644 index 00000000000..c30786525ea --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr40493.c @@ -0,0 +1,82 @@ +extern void abort (void); + +typedef union i386_operand_type +{ + struct + { + unsigned int reg8:1; + unsigned int reg16:1; + unsigned int reg32:1; + unsigned int reg64:1; + unsigned int floatreg:1; + unsigned int regmmx:1; + unsigned int regxmm:1; + unsigned int regymm:1; + unsigned int control:1; + unsigned int debug:1; + unsigned int test:1; + unsigned int sreg2:1; + unsigned int sreg3:1; + unsigned int imm1:1; + unsigned int imm8:1; + unsigned int imm8s:1; + unsigned int imm16:1; + unsigned int imm32:1; + unsigned int imm32s:1; + unsigned int imm64:1; + unsigned int disp8:1; + unsigned int disp16:1; + unsigned int disp32:1; + unsigned int disp32s:1; + unsigned int disp64:1; + unsigned int acc:1; + unsigned int floatacc:1; + unsigned int baseindex:1; + unsigned int inoutportreg:1; + unsigned int shiftcount:1; + unsigned int jumpabsolute:1; + unsigned int esseg:1; + unsigned int regmem:1; + unsigned int mem:1; + unsigned int byte:1; + unsigned int word:1; + unsigned int dword:1; + unsigned int fword:1; + unsigned int qword:1; + unsigned int tbyte:1; + unsigned int xmmword:1; + unsigned int ymmword:1; + unsigned int unspecified:1; + unsigned int anysize:1; + } bitfield; + unsigned int array[2]; +} i386_operand_type; + +unsigned int x00, x01, y00, y01; + +int main (int argc, char *argv[]) +{ + i386_operand_type a,b,c,d; + + a.bitfield.reg16 = 1; + a.bitfield.imm16 = 0; + a.array[1] = 22; + + b = a; + x00 = b.array[0]; + x01 = b.array[1]; + + c = b; + y00 = c.array[0]; + y01 = c.array[1]; + + d = c; + if (d.bitfield.reg16 != 1) + abort(); + if (d.bitfield.imm16 != 0) + abort(); + if (d.array[1] != 22) + abort(); + + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/execute/pr40579.c b/gcc/testsuite/gcc.c-torture/execute/pr40579.c new file mode 100644 index 00000000000..7f44af310e7 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr40579.c @@ -0,0 +1,28 @@ +extern void abort (void); +static char * __attribute__((noinline)) +itos(int num) +{ + return (char *)0; +} +static void __attribute__((noinline)) +foo(int i, const char *x) +{ + if (i >= 4) + abort (); +} +int main() +{ + int x = -__INT_MAX__ + 3; + int i; + + for (i = 0; i < 4; ++i) + { + char *p; + --x; + p = itos(x); + foo(i, p); + } + + return 0; +} + diff --git a/gcc/testsuite/gcc.dg/dfp/pr39902.c b/gcc/testsuite/gcc.dg/dfp/pr39902.c new file mode 100644 index 00000000000..8c4e7b24380 --- /dev/null +++ b/gcc/testsuite/gcc.dg/dfp/pr39902.c @@ -0,0 +1,239 @@ +/* { dg-options "--std=gnu99" } */ + +/* Check that optimizations like (x * 1) to x, or (x * -1) to -x, + do not apply to decimal float computations where trailing zeroes + are significant. */ + +extern void abort (void); +int failcnt; + +#ifdef DBG +extern int printf (const char *, ...); +#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } +#else +#define FAILURE abort (); +#endif + +#define COMPARE32(A,B) \ + A.i == B.i + +#define COMPARE64(A,B) \ + A.i[0] == B.i[0] && A.i[1] == B.i[1] + +#define COMPARE128(A,B) \ + A.i[0] == B.i[0] && A.i[1] == B.i[1] && A.i[2] == B.i[2] && A.i[3] == B.i[3] + +typedef union { + _Decimal32 d; + unsigned int i; +} u32; + +typedef union { + _Decimal64 d; + unsigned int i[2]; +} u64; + +typedef union { + _Decimal128 d; + unsigned int i[4]; +} u128; + +volatile u32 p32_1; +volatile u32 p32_1_0; +volatile u32 p32_2_0; +volatile u32 m32_1; +volatile u32 m32_1_0; +volatile u32 m32_2_0; +volatile u32 a32; + +volatile u64 p64_1; +volatile u64 p64_1_0; +volatile u64 p64_2_0; +volatile u64 m64_1; +volatile u64 m64_1_0; +volatile u64 m64_2_0; +volatile u64 a64; + +volatile u128 p128_1; +volatile u128 p128_1_0; +volatile u128 p128_2_0; +volatile u128 m128_1; +volatile u128 m128_1_0; +volatile u128 m128_2_0; +volatile u128 a128; + +void +init32 (void) +{ + p32_1.d = 1.DF; + p32_1_0.d = 1.0DF; + p32_2_0.d = 2.0DF; + m32_1.d = -1.DF; + m32_1_0.d = -1.0DF; + m32_2_0.d = -2.0DF; +} + +void +init64 (void) +{ + p64_1.d = 1.DD; + p64_1_0.d = 1.0DD; + p64_2_0.d = 2.0DD; + m64_1.d = -1.DD; + m64_1_0.d = -1.0DD; + m64_2_0.d = -2.0DD; +} + +void +init128 (void) +{ + p128_1.d = 1.DL; + p128_1_0.d = 1.0DL; + p128_2_0.d = 2.0DL; + m128_1.d = -1.DL; + m128_1_0.d = -1.0DL; + m128_2_0.d = -2.0DL; +} + +void +doit32 (void) +{ + /* Multiplying by a value with no trailing zero should not change the + quantum exponent. */ + + a32.d = p32_2_0.d * p32_1.d; + if (! (COMPARE32 (a32, p32_2_0))) + FAILURE + + a32.d = p32_2_0.d * 1.DF; + if (! (COMPARE32 (a32, p32_2_0))) + FAILURE + + a32.d = p32_2_0.d * m32_1.d; + if (! (COMPARE32 (a32, m32_2_0))) + FAILURE + + a32.d = p32_2_0.d * -1.DF; + if (! (COMPARE32 (a32, m32_2_0))) + FAILURE + + /* Multiplying by a value with a trailing zero should change the + quantum exponent. */ + + a32.d = p32_2_0.d * p32_1_0.d; + if (COMPARE32 (a32, p32_2_0)) + FAILURE + + a32.d = p32_2_0.d * 1.0DF; + if (COMPARE32 (a32, p32_2_0)) + FAILURE + + a32.d = p32_2_0.d * m32_1_0.d; + if (COMPARE32 (a32, m32_2_0)) + FAILURE + + a32.d = p32_2_0.d * -1.0DF; + if (COMPARE32 (a32, m32_2_0)) + FAILURE +} + +void +doit64 (void) +{ + /* Multiplying by a value with no trailing zero should not change the + quantum exponent. */ + + a64.d = p64_2_0.d * p64_1.d; + if (! (COMPARE64 (a64, p64_2_0))) + FAILURE + + a64.d = p64_2_0.d * 1.DD; + if (! (COMPARE64 (a64, p64_2_0))) + FAILURE + + a64.d = p64_2_0.d * m64_1.d; + if (! (COMPARE64 (a64, m64_2_0))) + FAILURE + + a64.d = p64_2_0.d * -1.DD; + if (! (COMPARE64 (a64, m64_2_0))) + FAILURE + + /* Multiplying by a value with a trailing zero should change the + quantum exponent. */ + + a64.d = p64_2_0.d * p64_1_0.d; + if (COMPARE64 (a64, p64_2_0)) + FAILURE + + a64.d = p64_2_0.d * 1.0DD; + if (COMPARE64 (a64, p64_2_0)) + FAILURE + + a64.d = p64_2_0.d * m64_1_0.d; + if (COMPARE64 (a64, m64_2_0)) + FAILURE + + a64.d = p64_2_0.d * -1.0DD; + if (COMPARE64 (a64, m64_2_0)) + FAILURE +} + +void +doit128 (void) +{ + /* Multiplying by a value with no trailing zero should not change the + quantum exponent. */ + + a128.d = p128_2_0.d * p128_1_0.d; + if (COMPARE128 (a128, p128_2_0)) + FAILURE + + a128.d = p128_2_0.d * 1.0DD; + if (COMPARE128 (a128, p128_2_0)) + FAILURE + + a128.d = p128_2_0.d * m128_1_0.d; + if (COMPARE128 (a128, m128_2_0)) + FAILURE + + a128.d = p128_2_0.d * -1.0DD; + if (COMPARE128 (a128, m128_2_0)) + FAILURE + + /* Multiplying by a value with a trailing zero should change the + quantum exponent. */ + + a128.d = p128_2_0.d * p128_1.d; + if (! (COMPARE128 (a128, p128_2_0))) + FAILURE + + a128.d = p128_2_0.d * 1.DD; + if (! (COMPARE128 (a128, p128_2_0))) + FAILURE + + a128.d = p128_2_0.d * m128_1.d; + if (! (COMPARE128 (a128, m128_2_0))) + FAILURE + + a128.d = p128_2_0.d * -1.DD; + if (! (COMPARE128 (a128, m128_2_0))) + FAILURE +} + +int +main (void) +{ + init32 (); + init64 (); + init128 (); + + doit32 (); + doit64 (); + doit128 (); + + if (failcnt != 0) + abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pr40550.c b/gcc/testsuite/gcc.dg/pr40550.c new file mode 100644 index 00000000000..27935ab005a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr40550.c @@ -0,0 +1,34 @@ +/* { dg-do run } */ +/* { dg-options "-msse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ + +#ifdef __i386__ +#include "cpuid.h" +#endif + +typedef float v2sf __attribute__ ((vector_size (2 * sizeof(float)))); + +static void test (void) +{ + v2sf a = {1.0, 0.0}; + v2sf b = {0.0, 1.0}; + v2sf d; + d = a + b; +} + +int main () +{ + +#ifdef __i386__ + unsigned int eax, ebx, ecx, edx; + + if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) + return 0; + + if (!(edx & bit_SSE)) + return 0; +#endif + + test (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr40470-1.c b/gcc/testsuite/gcc.dg/torture/pr40470-1.c new file mode 100644 index 00000000000..cb2510e883b --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr40470-1.c @@ -0,0 +1,22 @@ +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-msse4" } */ +#include <nmmintrin.h> +__m128i load (char *); +char * +foo (char *p1, char *p2, + int bmsk, __m128i mask1, __m128i mask2) +{ + int len = 0; + __m128i frag1, frag2; + int cmp_s; + if( !p2[0]) return p1; + if( !p1[0] ) return NULL; + frag2 = load (p2); + frag1 = load (p1); + frag2 = _mm_blendv_epi8(frag2, mask2, mask1); + frag1 = _mm_blendv_epi8(frag1, mask2, mask1); + cmp_s = _mm_cmpistrs(frag2, frag1, 0x0c); + if( cmp_s ) + __asm("bsfl %[bmsk], %[len]" : [len] "=r" (len) : [bmsk] "r" (bmsk) ); + return p1 + len; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr40470-2.c b/gcc/testsuite/gcc.dg/torture/pr40470-2.c new file mode 100644 index 00000000000..b0414bbea91 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr40470-2.c @@ -0,0 +1,27 @@ +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-msse4" } */ +#include <nmmintrin.h> +__m128i load (char *); +char * +foo (const unsigned char *s1, const unsigned char *s2, + int bmsk, __m128i frag2) +{ + int len = 0; + char *p1 = (char *) s1; + char *p2 = (char *) s2; + __m128i frag1, fruc, mask; + int cmp_c, cmp_s; + if( !p2[0]) return (char *) s1; + if( !p1[0] ) return NULL; + if( p2[1]) frag2 = load (p2); + frag1 = load (p1); + fruc = _mm_loadu_si128 ((__m128i *) s1); + mask = _mm_cmpistrm(fruc, frag2, 0x44); + frag2 = _mm_blendv_epi8(frag2, mask, mask); + frag1 = _mm_blendv_epi8(frag1, mask, mask); + cmp_c = _mm_cmpistrc(frag2, frag1, 0x0c); + cmp_s = _mm_cmpistrs(frag2, frag1, 0x0c); + if( cmp_s & cmp_c ) + __asm("bsfl %[bmsk], %[len]" : [len] "=r" (len) : [bmsk] "r" (bmsk) ); + return p2 + len; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr40470-3.c b/gcc/testsuite/gcc.dg/torture/pr40470-3.c new file mode 100644 index 00000000000..5c4c361de55 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr40470-3.c @@ -0,0 +1,22 @@ +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-msse4" } */ +#include <nmmintrin.h> +__m128i load (char *); +char * +foo (char *p1, char *p2, + int bmsk, __m128i mask1, __m128i mask2) +{ + int len = 0; + __m128i frag1, frag2; + int cmp_s; + if( !p2[0]) return p1; + if( !p1[0] ) return NULL; + frag2 = load (p2); + frag1 = load (p1); + frag2 = _mm_blendv_epi8(frag2, mask2, mask1); + frag1 = _mm_blendv_epi8(frag1, mask1, mask2); + cmp_s = _mm_cmpistrs(frag2, frag1, 0x0c); + if( cmp_s ) + __asm("bsfl %[bmsk], %[len]" : [len] "=r" (len) : [bmsk] "r" (bmsk) ); + return p1 + len; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr40470-4.c b/gcc/testsuite/gcc.dg/torture/pr40470-4.c new file mode 100644 index 00000000000..f9d0e509500 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr40470-4.c @@ -0,0 +1,29 @@ +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-msse4" } */ +#include <nmmintrin.h> +__m128i load (char *); +char * +foo (const unsigned char *s1, const unsigned char *s2, + int bmsk, __m128i frag2) +{ + int len = 0; + char *p1 = (char *) s1; + char *p2 = (char *) s2; + __m128i frag1, fruc1, fruc2, mask1, mask2; + int cmp_c, cmp_s; + if( !p2[0]) return (char *) s1; + if( !p1[0] ) return NULL; + if( p2[1]) frag2 = load (p2); + frag1 = load (p1); + fruc1 = _mm_loadu_si128 ((__m128i *) s1); + fruc2 = _mm_loadu_si128 ((__m128i *) s2); + mask1 = _mm_cmpistrm(fruc1, frag2, 0x44); + mask2 = _mm_cmpistrm(fruc2, frag1, 0x14); + frag2 = _mm_blendv_epi8(frag2, mask1, mask2); + frag1 = _mm_blendv_epi8(frag1, mask2, mask1); + cmp_c = _mm_cmpistrc(frag2, frag1, 0x0c); + cmp_s = _mm_cmpistrs(frag2, frag1, 0x0c); + if( cmp_s & cmp_c ) + __asm("bsfl %[bmsk], %[len]" : [len] "=r" (len) : [bmsk] "r" (bmsk) ); + return p2 + len; +} diff --git a/gcc/testsuite/gcc.dg/vect/pr40542.c b/gcc/testsuite/gcc.dg/vect/pr40542.c new file mode 100644 index 00000000000..0a827724dc8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr40542.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ + +void +volarr_cpy(char *d, volatile char *s) +{ + int i; + + for (i = 0; i < 16; i++) + d[i] = s[i]; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gfortran.dg/data_value_1.f90 b/gcc/testsuite/gfortran.dg/data_value_1.f90 new file mode 100644 index 00000000000..ea05a91d30d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/data_value_1.f90 @@ -0,0 +1,14 @@ +! { dg-do compile } +! Test the fix for PR40402, in which it was not detected that X +! is not a constant and so the DATA statement did not have +! a constant value expression. +! +! Contributed by Philippe Marguinaud <philippe.marguinaud@meteo.fr> +! + TYPE POINT + REAL :: X + ENDTYPE + TYPE(POINT) :: P + DATA P / POINT(1.+X) / ! { dg-error "non-constant DATA value" } + print *, p + END diff --git a/gcc/testsuite/gfortran.dg/derived_pointer_recursion_2.f90 b/gcc/testsuite/gfortran.dg/derived_pointer_recursion_2.f90 new file mode 100644 index 00000000000..f6bda4d0531 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/derived_pointer_recursion_2.f90 @@ -0,0 +1,48 @@ +! { dg-do run } +! +! PR 40594: [4.5 Regression] wrong-code +! +! Original test case by Daniel Franke <dfranke@gcc.gnu.org> +! Modified by Janus Weil <janus@gcc.gnu.org> + +MODULE atom_types + +TYPE :: atom_list + TYPE(atom_private), DIMENSION(:), pointer :: table +END TYPE + +TYPE :: atom_private + TYPE(atom_list) :: neighbours + LOGICAL :: initialized = .true. +END TYPE + +TYPE :: atom_model + TYPE(atom_list) :: atoms + integer :: dummy +END TYPE + +contains + + SUBROUTINE init(this) + TYPE(atom_private) :: this + this%initialized = .FALSE. + END SUBROUTINE + +END MODULE + + +program pr40594 + + USE atom_types + TYPE(atom_model) :: am + type(atom_private) :: ap + + am%dummy = 0 + + call init(ap) + if (ap%initialized .neqv. .false.) call abort() + +END + +! { dg-final { cleanup-modules "atom_types" } } + diff --git a/gcc/testsuite/gfortran.dg/generic_18.f90 b/gcc/testsuite/gfortran.dg/generic_18.f90 new file mode 100644 index 00000000000..1e23838d712 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/generic_18.f90 @@ -0,0 +1,54 @@ +! { dg-do compile } +! { dg-options "-fdump-tree-original" } +! +! Test the fix for PR40443 in which the final call to the generic +! 'SpecElem' was resolved to the elemental rather than the specific +! procedure, which is required by the second part of 12.4.4.1. +! +! Contributed by Ian Harvey <ian_harvey@bigpond.com> +! +MODULE SomeOptions + IMPLICIT NONE + INTERFACE ElemSpec + MODULE PROCEDURE ElemProc + MODULE PROCEDURE SpecProc + END INTERFACE ElemSpec + INTERFACE SpecElem + MODULE PROCEDURE SpecProc + MODULE PROCEDURE ElemProc + END INTERFACE SpecElem +CONTAINS + ELEMENTAL SUBROUTINE ElemProc(a) + CHARACTER, INTENT(OUT) :: a + !**** + a = 'E' + END SUBROUTINE ElemProc + + SUBROUTINE SpecProc(a) + CHARACTER, INTENT(OUT) :: a(:) + !**** + a = 'S' + END SUBROUTINE SpecProc +END MODULE SomeOptions + +PROGRAM MakeAChoice + USE SomeOptions + IMPLICIT NONE + CHARACTER scalar, array(2) + !**** + CALL ElemSpec(scalar) ! Should choose the elemental (and does) + WRITE (*, 100) scalar + CALL ElemSpec(array) ! Should choose the specific (and does) + WRITE (*, 100) array + !---- + CALL SpecElem(scalar) ! Should choose the elemental (and does) + WRITE (*, 100) scalar + CALL SpecElem(array) ! Should choose the specific (but didn't) + WRITE (*, 100) array + !---- + 100 FORMAT(A,:,', ',A) +END PROGRAM MakeAChoice +! { dg-final { scan-tree-dump-times "specproc" 3 "original" } } +! { dg-final { scan-tree-dump-times "elemproc" 3 "original" } } +! { dg-final { cleanup-tree-dump "original" } } +! { dg-final { cleanup-modules "SomeOptions" } } diff --git a/gcc/testsuite/gfortran.dg/internal_write_1.f90 b/gcc/testsuite/gfortran.dg/internal_write_1.f90 new file mode 100644 index 00000000000..3dfcaad2677 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/internal_write_1.f90 @@ -0,0 +1,9 @@ +! { dg-do run } +! { dg-shouldfail "End of file" } +program main + character(len=20) :: line + integer, dimension(4) :: n + n = 1 + write(line,'(2I2)') n +end program main +! { dg-output "Fortran runtime error: End of file" } diff --git a/gcc/testsuite/gfortran.dg/maxloc_1.f90 b/gcc/testsuite/gfortran.dg/maxloc_1.f90 new file mode 100644 index 00000000000..41115eda981 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/maxloc_1.f90 @@ -0,0 +1,14 @@ +! { dg-do run } + integer :: a(3), n + a(1) = -huge(n) + a(2) = -huge(n) + a(3) = -huge(n) + a(1) = a(1) - 1 + a(2) = a(2) - 1 + a(3) = a(3) - 1 + n = maxloc (a, dim = 1) + if (n .ne. 1) call abort + a(2) = -huge(n) + n = maxloc (a, dim = 1) + if (n .ne. 2) call abort +end diff --git a/gcc/testsuite/gfortran.dg/pr40587.f b/gcc/testsuite/gfortran.dg/pr40587.f new file mode 100644 index 00000000000..0761d9d7e90 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr40587.f @@ -0,0 +1,17 @@ +C PR traget/40587 +C { dg-do compile } +C { dg-options "-O2" } + subroutine TEST(i, r, result) + implicit none + integer i + REAL*8 r + REAL*8 result + REAL*8 r2 + if(i.eq.0) then + r2 = r + else + call ERROR() + endif + result = r2 + return + end diff --git a/gcc/testsuite/gfortran.dg/private_type_13.f90 b/gcc/testsuite/gfortran.dg/private_type_13.f90 new file mode 100644 index 00000000000..77c41a44f12 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/private_type_13.f90 @@ -0,0 +1,32 @@ +! { dg-do compile } +! Test fix for F95 part of PR39800, in which the host association of the type 't1' +! generated an error. +! +! Reported to clf by Alexei Matveev <Alexei Matveev@gmail.com> and reported by +! Tobias Burnus <burnus@gcc.gnu.org> +! +module m + implicit none + private + + type :: t1 + integer :: i + end type + + type :: t2 + type(t1) :: j + end type + + contains + + subroutine sub() + implicit none + + type :: t3 + type(t1) :: j + end type + + end subroutine + +end module +! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/private_type_2.f90 b/gcc/testsuite/gfortran.dg/private_type_2.f90 index 690be5d3a85..cda00cabbc6 100644 --- a/gcc/testsuite/gfortran.dg/private_type_2.f90 +++ b/gcc/testsuite/gfortran.dg/private_type_2.f90 @@ -1,8 +1,11 @@ ! { dg-do compile } +! { dg-options "-std=f95" } ! PR16404 test 6 - If a component of a derived type is of a type declared to ! be private, either the derived type definition must contain the PRIVATE ! statement, or the derived type must be private. ! Modified on 20051105 to test PR24534. +! Modified on 20090419 to use -std=f95, since F2003 allows public types +! with private components. ! ! Contributed by Joost VandeVondele <jv244@cam.ac.uk> MODULE TEST diff --git a/gcc/testsuite/gfortran.dg/unit_1.f90 b/gcc/testsuite/gfortran.dg/unit_1.f90 new file mode 100644 index 00000000000..5233bc87019 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/unit_1.f90 @@ -0,0 +1,24 @@ +! { dg-do run } +! PR40638 Run Time Error: Unit number in I/O statement too large + program main + integer(kind=2) :: lun, anum + integer(kind=1) :: looney, bin + lun = 12 + anum = 5 + looney = 42 + bin = 23 + open (lun, status='scratch') + write(lun,*) anum + anum = 0 + rewind(lun) + read (lun, *) anum + if (anum.ne.5) call abort + open (looney, status='scratch') + write(looney,*)bin + bin = 0 + rewind (looney) + read (looney,*)bin + if (bin.ne.23) call abort + close (lun) + close (looney) + end diff --git a/gcc/testsuite/objc.dg/pr28050.m b/gcc/testsuite/objc.dg/pr28050.m new file mode 100644 index 00000000000..efd9216f7fd --- /dev/null +++ b/gcc/testsuite/objc.dg/pr28050.m @@ -0,0 +1,2 @@ +/* { dg-do compile } */ +int i = [0]; /* { dg-error "expected .:. before .\\]. token" } */ diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 5a74e82613b..7e9947f6f7e 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -4943,6 +4943,10 @@ gimple_move_block_after (basic_block bb, basic_block after) static bool gimple_can_duplicate_bb_p (const_basic_block bb ATTRIBUTE_UNUSED) { + gimple_seq_node last = gimple_seq_last (bb_seq (bb)); + /* We cannot duplicate GIMPLE_RESXs due to expander limitations. */ + if (last && gimple_code (last->stmt) == GIMPLE_RESX) + return false; return true; } diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c index 82c1fbefacf..b93ac70952a 100644 --- a/gcc/tree-chrec.c +++ b/gcc/tree-chrec.c @@ -220,16 +220,16 @@ chrec_fold_multiply_poly_poly (tree type, /* "a*c". */ t0 = chrec_fold_multiply (type, CHREC_LEFT (poly0), CHREC_LEFT (poly1)); - /* "a*d + b*c + b*d". */ + /* "a*d + b*c". */ t1 = chrec_fold_multiply (type, CHREC_LEFT (poly0), CHREC_RIGHT (poly1)); t1 = chrec_fold_plus (type, t1, chrec_fold_multiply (type, CHREC_RIGHT (poly0), CHREC_LEFT (poly1))); - t1 = chrec_fold_plus (type, t1, chrec_fold_multiply (type, - CHREC_RIGHT (poly0), - CHREC_RIGHT (poly1))); - /* "2*b*d". */ + /* "b*d". */ t2 = chrec_fold_multiply (type, CHREC_RIGHT (poly0), CHREC_RIGHT (poly1)); + /* "a*d + b*c + b*d". */ + t1 = chrec_fold_plus (type, t1, t2); + /* "2*b*d". */ t2 = chrec_fold_multiply (type, SCALAR_FLOAT_TYPE_P (type) ? build_real (type, dconst2) : build_int_cst (type, 2), t2); diff --git a/gcc/tree-chrec.h b/gcc/tree-chrec.h index 76c24b3b5cc..db45eedc595 100644 --- a/gcc/tree-chrec.h +++ b/gcc/tree-chrec.h @@ -132,7 +132,8 @@ build_polynomial_chrec (unsigned loop_num, || right == chrec_dont_know) return chrec_dont_know; - if (no_evolution_in_loop_p (left, loop_num, &val) && !val) + if (!no_evolution_in_loop_p (left, loop_num, &val) + || !val) return chrec_dont_know; /* Pointer types should occur only on the left hand side, i.e. in diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index e30e56d492c..2db08ed13bf 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -2130,6 +2130,13 @@ parse_ssa_operands (gimple stmt) /* Add call-clobbered operands, if needed. */ if (code == GIMPLE_CALL) maybe_add_call_clobbered_vops (stmt); + + /* Make sure the return value is addressable in case of NRV. */ + if (code == GIMPLE_CALL + && gimple_call_lhs (stmt) != NULL_TREE + && gimple_call_return_slot_opt_p (stmt) + && TREE_ADDRESSABLE (TREE_TYPE (gimple_call_lhs (stmt)))) + gimple_add_to_addresses_taken (stmt, gimple_call_lhs (stmt)); } } diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c index f88af5dc9b0..a7d96e8b87f 100644 --- a/gcc/tree-vect-analyze.c +++ b/gcc/tree-vect-analyze.c @@ -199,6 +199,15 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo) print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM); } + if (gimple_has_volatile_ops (stmt)) + { + if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS)) + fprintf (vect_dump, "not vectorized: stmt has volatile" + " operands"); + + return false; + } + gcc_assert (stmt_info); /* skip stmts which do not need to be vectorized. */ diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c index 13138ddd464..c472442c6f9 100644 --- a/gcc/tree-vect-generic.c +++ b/gcc/tree-vect-generic.c @@ -481,8 +481,10 @@ expand_vector_operations_1 (gimple_stmt_iterator *gsi) tree vector_compute_type = type_for_widest_vector_mode (TYPE_MODE (TREE_TYPE (type)), op, TYPE_SATURATING (TREE_TYPE (type))); - if (vector_compute_type != NULL_TREE) - compute_type = vector_compute_type; + if (vector_compute_type != NULL_TREE + && (TYPE_VECTOR_SUBPARTS (vector_compute_type) + < TYPE_VECTOR_SUBPARTS (compute_type))) + compute_type = vector_compute_type; } /* If we are breaking a BLKmode vector into smaller pieces, diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 7258bcf58aa..6ad8a2b502d 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -5685,6 +5685,14 @@ vrp_evaluate_conditional (enum tree_code code, tree op0, tree op1, gimple stmt) tree ret; bool only_ranges; + /* Some passes and foldings leak constants with overflow flag set + into the IL. Avoid doing wrong things with these and bail out. */ + if ((TREE_CODE (op0) == INTEGER_CST + && TREE_OVERFLOW (op0)) + || (TREE_CODE (op1) == INTEGER_CST + && TREE_OVERFLOW (op1))) + return NULL_TREE; + sop = false; ret = vrp_evaluate_conditional_warnv_with_ops (code, op0, op1, true, &sop, &only_ranges); diff --git a/gcc/tree.c b/gcc/tree.c index c9618f7d517..94cd8e3f752 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -1606,7 +1606,8 @@ tree_floor_log2 (const_tree expr) : floor_log2 (low)); } -/* Return 1 if EXPR is the real constant zero. */ +/* Return 1 if EXPR is the real constant zero. Trailing zeroes matter for + decimal float constants, so don't return 1 for them. */ int real_zerop (const_tree expr) @@ -1614,13 +1615,16 @@ real_zerop (const_tree expr) STRIP_NOPS (expr); return ((TREE_CODE (expr) == REAL_CST - && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst0)) + && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst0) + && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr))))) || (TREE_CODE (expr) == COMPLEX_CST && real_zerop (TREE_REALPART (expr)) && real_zerop (TREE_IMAGPART (expr)))); } -/* Return 1 if EXPR is the real constant one in real or complex form. */ +/* Return 1 if EXPR is the real constant one in real or complex form. + Trailing zeroes matter for decimal float constants, so don't return + 1 for them. */ int real_onep (const_tree expr) @@ -1628,13 +1632,15 @@ real_onep (const_tree expr) STRIP_NOPS (expr); return ((TREE_CODE (expr) == REAL_CST - && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst1)) + && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst1) + && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr))))) || (TREE_CODE (expr) == COMPLEX_CST && real_onep (TREE_REALPART (expr)) && real_zerop (TREE_IMAGPART (expr)))); } -/* Return 1 if EXPR is the real constant two. */ +/* Return 1 if EXPR is the real constant two. Trailing zeroes matter + for decimal float constants, so don't return 1 for them. */ int real_twop (const_tree expr) @@ -1642,13 +1648,15 @@ real_twop (const_tree expr) STRIP_NOPS (expr); return ((TREE_CODE (expr) == REAL_CST - && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst2)) + && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst2) + && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr))))) || (TREE_CODE (expr) == COMPLEX_CST && real_twop (TREE_REALPART (expr)) && real_zerop (TREE_IMAGPART (expr)))); } -/* Return 1 if EXPR is the real constant minus one. */ +/* Return 1 if EXPR is the real constant minus one. Trailing zeroes + matter for decimal float constants, so don't return 1 for them. */ int real_minus_onep (const_tree expr) @@ -1656,7 +1664,8 @@ real_minus_onep (const_tree expr) STRIP_NOPS (expr); return ((TREE_CODE (expr) == REAL_CST - && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconstm1)) + && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconstm1) + && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr))))) || (TREE_CODE (expr) == COMPLEX_CST && real_minus_onep (TREE_REALPART (expr)) && real_zerop (TREE_IMAGPART (expr)))); diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index ad129b822b1..053ccca6b90 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2009-06-29 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libfortran/40576 + * io/transfer.c (sset): Adjust exit condition for loop. + 2009-06-11 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/40330 diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index cf25a89fff6..964f8719f4f 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -2868,7 +2868,7 @@ sset (stream * s, int c, ssize_t nbyte) { trans = (bytes_left < WRITE_CHUNK) ? bytes_left : WRITE_CHUNK; trans = swrite (s, p, trans); - if (trans < 0) + if (trans <= 0) return trans; bytes_left -= trans; } diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 9d5d2535182..d5b4486bd34 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,27 @@ +2009-06-30 Paolo Carlini <paolo.carlini@oracle.com> + + PR libstdc++/40600 + * testsuite/25_algorithms/minmax/2.cc: Fix consistently with + std::minmax return type. + * testsuite/25_algorithms/minmax/3.cc: Likewise. + +2009-06-24 Jonathan Wakely <jwakely.gcc@gmail.com> + + PR libstdc++/40297 + * include/bits/atomic_0.h: Reverse debug assertions. + * include/bits/atomic_2.h: Likewise. + +2009-06-20 Paolo Carlini <paolo.carlini@oracle.com> + + * Revert last Change. + +2009-06-20 Paolo Carlini <paolo.carlini@oracle.com> + + PR libstdc++/40497 + * include/bits/stl_iterator_base_funcs.h (next, prev): Fix the + signature per the current C++1x draft (N2857). + * testsuite/24_iterators/operations/40497.cc: Add. + 2009-06-16 Jonathan Wakely <jwakely.gcc@gmail.com> * libsupc++/exception_ptr.h (exception_ptr::swap(exception_ptr&&)): diff --git a/libstdc++-v3/include/bits/atomic_0.h b/libstdc++-v3/include/bits/atomic_0.h index 5d2631d76e9..a493ea66af9 100644 --- a/libstdc++-v3/include/bits/atomic_0.h +++ b/libstdc++-v3/include/bits/atomic_0.h @@ -119,17 +119,17 @@ namespace __atomic0 void store(void* __v, memory_order __m = memory_order_seq_cst) volatile { - __glibcxx_assert(__m == memory_order_acquire); - __glibcxx_assert(__m == memory_order_acq_rel); - __glibcxx_assert(__m == memory_order_consume); + __glibcxx_assert(__m != memory_order_acquire); + __glibcxx_assert(__m != memory_order_acq_rel); + __glibcxx_assert(__m != memory_order_consume); _ATOMIC_STORE_(this, __v, __m); } void* load(memory_order __m = memory_order_seq_cst) const volatile { - __glibcxx_assert(__m == memory_order_release); - __glibcxx_assert(__m == memory_order_acq_rel); + __glibcxx_assert(__m != memory_order_release); + __glibcxx_assert(__m != memory_order_acq_rel); return _ATOMIC_LOAD_(this, __m); } @@ -141,8 +141,8 @@ namespace __atomic0 compare_exchange_weak(void*& __v1, void* __v2, memory_order __m1, memory_order __m2) volatile { - __glibcxx_assert(__m2 == memory_order_release); - __glibcxx_assert(__m2 == memory_order_acq_rel); + __glibcxx_assert(__m2 != memory_order_release); + __glibcxx_assert(__m2 != memory_order_acq_rel); __glibcxx_assert(__m2 <= __m1); return _ATOMIC_CMPEXCHNG_(this, &__v1, __v2, __m1); } @@ -159,8 +159,8 @@ namespace __atomic0 compare_exchange_strong(void*& __v1, void* __v2, memory_order __m1, memory_order __m2) volatile { - __glibcxx_assert(__m2 == memory_order_release); - __glibcxx_assert(__m2 == memory_order_acq_rel); + __glibcxx_assert(__m2 != memory_order_release); + __glibcxx_assert(__m2 != memory_order_acq_rel); __glibcxx_assert(__m2 <= __m1); return _ATOMIC_CMPEXCHNG_(this, &__v1, __v2, __m1); } @@ -310,17 +310,17 @@ namespace __atomic0 store(__integral_type __i, memory_order __m = memory_order_seq_cst) volatile { - __glibcxx_assert(__m == memory_order_acquire); - __glibcxx_assert(__m == memory_order_acq_rel); - __glibcxx_assert(__m == memory_order_consume); + __glibcxx_assert(__m != memory_order_acquire); + __glibcxx_assert(__m != memory_order_acq_rel); + __glibcxx_assert(__m != memory_order_consume); _ATOMIC_STORE_(this, __i, __m); } __integral_type load(memory_order __m = memory_order_seq_cst) const volatile { - __glibcxx_assert(__m == memory_order_release); - __glibcxx_assert(__m == memory_order_acq_rel); + __glibcxx_assert(__m != memory_order_release); + __glibcxx_assert(__m != memory_order_acq_rel); return _ATOMIC_LOAD_(this, __m); } @@ -333,8 +333,8 @@ namespace __atomic0 compare_exchange_weak(__integral_type& __i1, __integral_type __i2, memory_order __m1, memory_order __m2) volatile { - __glibcxx_assert(__m2 == memory_order_release); - __glibcxx_assert(__m2 == memory_order_acq_rel); + __glibcxx_assert(__m2 != memory_order_release); + __glibcxx_assert(__m2 != memory_order_acq_rel); __glibcxx_assert(__m2 <= __m1); return _ATOMIC_CMPEXCHNG_(this, &__i1, __i2, __m1); } @@ -351,8 +351,8 @@ namespace __atomic0 compare_exchange_strong(__integral_type& __i1, __integral_type __i2, memory_order __m1, memory_order __m2) volatile { - __glibcxx_assert(__m2 == memory_order_release); - __glibcxx_assert(__m2 == memory_order_acq_rel); + __glibcxx_assert(__m2 != memory_order_release); + __glibcxx_assert(__m2 != memory_order_acq_rel); __glibcxx_assert(__m2 <= __m1); return _ATOMIC_CMPEXCHNG_(this, &__i1, __i2, __m1); } diff --git a/libstdc++-v3/include/bits/atomic_2.h b/libstdc++-v3/include/bits/atomic_2.h index c172767140f..8e8e7ff16f8 100644 --- a/libstdc++-v3/include/bits/atomic_2.h +++ b/libstdc++-v3/include/bits/atomic_2.h @@ -65,6 +65,10 @@ namespace __atomic2 void clear(memory_order __m = memory_order_seq_cst) volatile { + __glibcxx_assert(__m != memory_order_consume); + __glibcxx_assert(__m != memory_order_acquire); + __glibcxx_assert(__m != memory_order_acq_rel); + __sync_lock_release(&_M_i); if (__m != memory_order_acquire && __m != memory_order_acq_rel) __sync_synchronize(); @@ -93,9 +97,9 @@ namespace __atomic2 void store(void* __v, memory_order __m = memory_order_seq_cst) volatile { - __glibcxx_assert(__m == memory_order_acquire); - __glibcxx_assert(__m == memory_order_acq_rel); - __glibcxx_assert(__m == memory_order_consume); + __glibcxx_assert(__m != memory_order_acquire); + __glibcxx_assert(__m != memory_order_acq_rel); + __glibcxx_assert(__m != memory_order_consume); if (__m == memory_order_relaxed) _M_i = __v; @@ -111,8 +115,8 @@ namespace __atomic2 void* load(memory_order __m = memory_order_seq_cst) const volatile { - __glibcxx_assert(__m == memory_order_release); - __glibcxx_assert(__m == memory_order_acq_rel); + __glibcxx_assert(__m != memory_order_release); + __glibcxx_assert(__m != memory_order_acq_rel); __sync_synchronize(); void* __ret = _M_i; @@ -144,8 +148,8 @@ namespace __atomic2 compare_exchange_strong(void*& __v1, void* __v2, memory_order __m1, memory_order __m2) volatile { - __glibcxx_assert(__m2 == memory_order_release); - __glibcxx_assert(__m2 == memory_order_acq_rel); + __glibcxx_assert(__m2 != memory_order_release); + __glibcxx_assert(__m2 != memory_order_acq_rel); __glibcxx_assert(__m2 <= __m1); void* __v1o = __v1; @@ -284,9 +288,9 @@ namespace __atomic2 store(__integral_type __i, memory_order __m = memory_order_seq_cst) volatile { - __glibcxx_assert(__m == memory_order_acquire); - __glibcxx_assert(__m == memory_order_acq_rel); - __glibcxx_assert(__m == memory_order_consume); + __glibcxx_assert(__m != memory_order_acquire); + __glibcxx_assert(__m != memory_order_acq_rel); + __glibcxx_assert(__m != memory_order_consume); if (__m == memory_order_relaxed) _M_i = __i; @@ -302,8 +306,8 @@ namespace __atomic2 __integral_type load(memory_order __m = memory_order_seq_cst) const volatile { - __glibcxx_assert(__m == memory_order_release); - __glibcxx_assert(__m == memory_order_acq_rel); + __glibcxx_assert(__m != memory_order_release); + __glibcxx_assert(__m != memory_order_acq_rel); __sync_synchronize(); __integral_type __ret = _M_i; @@ -336,8 +340,8 @@ namespace __atomic2 compare_exchange_strong(__integral_type& __i1, __integral_type __i2, memory_order __m1, memory_order __m2) volatile { - __glibcxx_assert(__m2 == memory_order_release); - __glibcxx_assert(__m2 == memory_order_acq_rel); + __glibcxx_assert(__m2 != memory_order_release); + __glibcxx_assert(__m2 != memory_order_acq_rel); __glibcxx_assert(__m2 <= __m1); __integral_type __i1o = __i1; diff --git a/libstdc++-v3/testsuite/25_algorithms/minmax/2.cc b/libstdc++-v3/testsuite/25_algorithms/minmax/2.cc index 9818c5ca1dd..6c4200eeffb 100644 --- a/libstdc++-v3/testsuite/25_algorithms/minmax/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/minmax/2.cc @@ -27,25 +27,25 @@ void test01() { bool test __attribute__((unused)) = true; - std::pair<const int&, const int&> z = std::minmax({1, 2, 3}); - std::pair<const int&, const int&> w = std::minmax({4, 3, 5, 4}); - std::pair<const int&, const int&> y = std::minmax({4, 5, 3, 7, 3}); + std::pair<int, int> z = std::minmax({1, 2, 3}); + std::pair<int, int> w = std::minmax({4, 3, 5, 4}); + std::pair<int, int> y = std::minmax({4, 5, 3, 7, 3}); VERIFY( z.first == 1 ); VERIFY( z.second == 3 ); VERIFY( w.first == 3 ); VERIFY( w.second == 5 ); VERIFY( y.first == 3 ); VERIFY( y.second == 7 ); - - std::pair<const int&, const int&> zc = + + std::pair<int, int> zc = std::minmax({1, 2, 3}, std::greater<int>()); - - std::pair<const int&, const int&> wc = + + std::pair<int, int> wc = std::minmax({4, 3, 5, 4}, std::greater<int>()); - - std::pair<const int&, const int&> yc = + + std::pair<int, int> yc = std::minmax({4, 5, 3, 7, 3}, std::greater<int>()); - + VERIFY( zc.first == 3 ); VERIFY( zc.second == 1 ); VERIFY( wc.first == 5 ); diff --git a/libstdc++-v3/testsuite/25_algorithms/minmax/3.cc b/libstdc++-v3/testsuite/25_algorithms/minmax/3.cc index 5e896e208f7..f0944b0bfde 100644 --- a/libstdc++-v3/testsuite/25_algorithms/minmax/3.cc +++ b/libstdc++-v3/testsuite/25_algorithms/minmax/3.cc @@ -41,8 +41,8 @@ void test01() { bool test __attribute__((unused)) = true; - std::pair<const int&, const int&> z = std::minmax({1, 2, 3, 4, 5, 6, 7, 8}, - compare_counter()); + std::pair<int, int> z = std::minmax({1, 2, 3, 4, 5, 6, 7, 8}, + compare_counter()); // If N is the number of arguments in the minmax function call, // 25.3.7 specifies that at most 3N/2 comparisons are allowed. |