1. 27 Apr, 2016 23 commits
    • [multiple changes] · a6ac7311
      2016-04-27  Vincent Celier  <celier@adacore.com>
      
      	* gnatcmd.adb: For "gnat ls -V -P", recognize switch
      	--unchecked-shared-lib-imports and set the flag
      	Opt.Unchecked_Shared_Lib_Imports accordingly.
      
      2016-04-27  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_prag.adb (Analyze_Pre_Post_Condition_In_Decl_Part):
      	A generic subprogram is never a primitive operation, and thus
      	a classwide condition for it is not legal.
      
      2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* sem_aggr.adb, sem_dim.adb, sem_dim.ads, einfo.adb: Minor
      	reformatting.
      
      From-SVN: r235494
      Arnaud Charlet committed
    • [multiple changes] · 888be6b1
      2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* sem_res.adb (Flag_Effectively_Volatile_Objects): New routine.
      	(Resolve_Actuals): Flag effectively volatile objects with enabled
      	property Async_Writers or Effective_Reads as illegal.
      	* sem_util.adb (Is_OK_Volatile_Context): Comment reformatting.
      
      2016-04-27  Javier Miranda  <miranda@adacore.com>
      
      	* exp_ch3.adb (Make_Predefined_Primitive_Specs):
      	Do not generate the profile of the equality operator if it has
      	been explicitly defined as abstract in the parent type. Required
      	to avoid reporting an spurious error.
      
      2016-04-27  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_dim.ads, sem_dim.adb (Check_Expression_Dimensions): New
      	procedure to compute the dimension vector of a scalar expression
      	and compare it with the dimensions if its expected subtype. Used
      	for the ultimate components of a multidimensional aggregate,
      	whose components typically are themselves aggregates that are
      	expanded separately. Previous to this patch, dimensionality
      	checking on such aggregates generated spurious errors.
      	* sem_aggr.adb (Resolve_Array_Aggregate): Use
      	Check_Expression_Dimensions when needed.
      
      2016-04-27  Javier Miranda  <miranda@adacore.com>
      
      	* einfo.ads, einfo.adb (Corresponding_Function): New attribute
      	(applicable to E_Procedure).
      	(Corresponding_Procedure): New attribute (applicable to E_Function).
      	* exp_util.adb (Build_Procedure_Form): Link the function with
      	its internally built proc and viceversa.
      	* sem_ch6.adb (Build_Subprogram_Declaration): Propagate the
      	attribute Rewritten_For_C and Corresponding_Procedure to the body.
      	* exp_ch6.adb (Rewritten_For_C_Func_Id): Removed.
      	(Rewritten_For_C_Proc_Id): Removed.
      	* exp_unst.adb (Note_Uplevel_Ref): Use the new attribute to
      	locate the corresponding procedure.
      
      From-SVN: r235493
      Arnaud Charlet committed
    • [multiple changes] · c7518e6f
      2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* sem_ch13.adb (Analyze_Aspect_Export_Import): Signal that there is no
      	corresponding pragma.
      
      2016-04-27  Bob Duff  <duff@adacore.com>
      
      	* exp_ch3.adb: Minor comment improvement.
      
      2016-04-27  Ed Schonberg  <schonberg@adacore.com>
      
      	* exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): If the
      	return type is an untagged limited record with only access
      	discriminants and no controlled components, the return value does not
      	need to use the secondary stack.
      
      2016-04-27  Javier Miranda  <miranda@adacore.com>
      
      	* exp_util.adb (Remove_Side_Effects): When
      	generating C code handle object declarations that have
      	discriminants and are initialized by means of a call to a
      	function.
      
      2016-04-27  Ed Schonberg  <schonberg@adacore.com>
      
      	* a-textio.adb (Get_Line function): Handle properly the case of
      	a line that has the same length as the buffer (or a multiple
      	thereof) and there is no line terminator.
      	* a-tigeli.adb (Get_Line procedure): Do not store an end_of_file
      	in the string when there is no previous line terminator and we
      	need at most one additional character.
      
      From-SVN: r235492
      Arnaud Charlet committed
    • [multiple changes] · 814cc240
      2016-04-27  Arnaud Charlet  <charlet@adacore.com>
      
      	* s-rident.ads: Make No_Implicit_Loops non partition wide.
      
      2016-04-27  Arnaud Charlet  <charlet@adacore.com>
      
      	* sem_ch11.adb (Analyze_Handled_Statements): check useless
      	assignments also in entries and task bodies, not only in
      	procedures and declaration blocks.
      	* sem_ch5.adb (Analyze_Block_Statement): check useless
      	assignements in declaration blocks as part of processing their
      	handled statement sequence, just like it was done for procedures
      	and now is also done for entries and task bodies.
      	* sem_warn.adb (Warn_On_Useless_Assignment): detect boundries
      	of entries and task bodies just like of procedures.
      
      2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* sem_util.adb (Is_Volatile_Function): Recognize
      	a function declared within a protected type as well as the
      	protected/unprotected version of a function.
      
      From-SVN: r235491
      Arnaud Charlet committed
    • exp_ch3.adb (Expand_N_Object_Declaration): Rewrite an object declaration of the form "X ... · 24d2fbbe
      2016-04-27  Bob Duff  <duff@adacore.com>
      
      	* exp_ch3.adb (Expand_N_Object_Declaration): Rewrite an object
      	declaration of the form "X : T := Func (...);", where T is
      	controlled, as a renaming.
      	* a-strunb-shared.adb (Finalize): Set the Unbounded_String Object
      	to be an empty string, instead of null-ing out the Reference.
      	* exp_util.adb (Needs_Finalization): Remove redundant code.
      
      From-SVN: r235488
      Bob Duff committed
    • libstdc++/70767 Define std::numeric_limits<cv T> in C++98 mode · 45e20696
      	PR libstdc++/70767
      	* include/std/limits: Update comments about DRs.
      	(numeric_limits<const _Tp>, numeric_limits<volatile _Tp>,
      	numeric_limits<const volatile _Tp>): Define unconditionally.
      
      From-SVN: r235486
      Jonathan Wakely committed
    • * doc/invoke.texi (-frename-registers): Also enabled at -Os. · 58197648
      From-SVN: r235485
      Bernd Schmidt committed
    • re PR go/49889 (Calling a function whose name is obscured by a local variable… · 9ec5d66b
      re PR go/49889 (Calling a function whose name is obscured by a local variable does not produce an error)
      
      	PR middle-end/49889
      gcc	* varasm.c (merge_weak): Generate an error if an attempt is made
      	to convert a non-weak static function into a weak, public function.
      
      testsuite	* gcc.dg/pr49889.c: New test.
      
      From-SVN: r235484
      Nick Clifton committed
    • [multiple changes] · 2e885a6f
      2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* aspects.ads Aspects Export and Import do not require delay. They
      	were classified as delayed aspects, but treated as non-delayed
      	by the analysis of aspects.
      	* freeze.adb (Copy_Import_Pragma): New routine.
      	(Wrap_Imported_Subprogram): Copy the import pragma by first
      	resetting all semantic fields to avoid an infinite loop when
      	performing the copy.
      	* sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): Add
      	comment on the processing of aspects Export and Import
      	at the freeze point.
      	(Analyze_Aspect_Convention: New routine.
      	(Analyze_Aspect_Export_Import): New routine.
      	(Analyze_Aspect_External_Link_Name): New routine.
      	(Analyze_Aspect_External_Or_Link_Name): Removed.
      	(Analyze_Aspect_Specifications): Factor out the analysis of
      	aspects Convention, Export, External_Name, Import, and Link_Name
      	in their respective routines.  Aspects Export and Import should
      	not generate a Boolean pragma because their corresponding pragmas
      	have a very different syntax.
      	(Build_Export_Import_Pragma): New routine.
      	(Get_Interfacing_Aspects): New routine.
      
      2016-04-27  Eric Botcazou  <ebotcazou@adacore.com>
      
      	* inline.adb (Add_Inlined_Body): Overhaul implementation,
      	robustify handling of -gnatn1, add special treatment for
      	expression functions.
      
      2016-04-27  Doug Rupp  <rupp@adacore.com>
      
      	* g-traceb.ads: Update comment.
      	* exp_ch2.adb: minor style fix in object declaration
      
      From-SVN: r235483
      Arnaud Charlet committed
    • [multiple changes] · 2a253c5b
      2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* sem_elab.adb (Check_Internal_Call): Do not
      	consider a call when it appears within pragma Initial_Condition
      	since the pragma is part of the elaboration statements of a
      	package body and may only call external subprograms or subprograms
      	whose body is already available.
      	(Within_Initial_Condition): New routine.
      
      2016-04-27  Ed Schonberg  <schonberg@adacore.com>
      
      	* exp_util.adb (Build_Procedure_Form): Prevent double generation
      	of the procedure form when dealing with an expression function
      	whose return type is an array.
      	* sem_ch3.adb: Fix out-of order Has_Predicates setting.
      	* exp_ch6.adb: Proper conversion for inherited operation in C.
      	* sem_ch6.adb: Code cleanup.
      
      2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* lib-xref.ads, sem_ch10.adb: minor style fix in comment
      	* g-socket.adb: Minor reformatting.
      	* sinfo.ads: Minor comment correction.
      	* sem_warn.ads: minor grammar fix in comment
      
      From-SVN: r235482
      Arnaud Charlet committed
    • Fix ChangeLog entry for r235478 · 780fd376
      From-SVN: r235481
      Prathamesh Kulkarni committed
    • Fix typo in gcc/testsuite/ChangeLog for revision 235436. · 25939d34
      From-SVN: r235480
      Bin Cheng committed
    • gigi.h (gnat_to_gnu_entity): Adjust prototype. · afc737f0
      	* gcc-interface/gigi.h (gnat_to_gnu_entity): Adjust prototype.
      	(maybe_pad_type): Adjust comment.
      	(finish_record_type): Likewise.
      	(rest_of_record_type_compilation): Likewise.
      	* gcc-interface/decl.c (gnat_to_gnu_entity): Change DEFINITION type
      	parameter from integer to boolean.  Adjust recursive calls.
      	<E_Subprogram_Type>: Use copy_type and remove redundant assignments.
      	<E_Signed_Integer_Subtype>:  Adjust comment.  Remove call to
      	rest_of_record_type_compilation.  Set TYPE_PADDING_P flag earlier.
      	Pass false to finish_record_type.  Set the debug type later.
      	<E_Record_Subtype>: Remove call to rest_of_record_type_compilation.
      	(gnat_to_gnu_component_type): Fix formatting.
      	(gnat_to_gnu_field_decl): Adjust call to gnat_to_gnu_entity.
      	(gnat_to_gnu_type): Likewise.
      	* gcc-interface/trans.c (Identifier_to_gnu): Likewise.
      	(Loop_Statement_to_gnu): Likewise.
      	(Subprogram_Body_to_gnu): Likewise.
      	(Exception_Handler_to_gnu_fe_sjlj): Likewise.
      	(Exception_Handler_to_gnu_gcc): Likewise.
      	(Compilation_Unit_to_gnu): Likewise.
      	(gnat_to_gnu): Likewise.
      	(push_exception_label_stack): Likewise.
      	(elaborate_all_entities_for_package): Likewise.
      	(process_freeze_entity): Likewise.
      	(process_decls): Likewise.
      	(process_type): Likewise.
      	* gcc-interface/utils.c (struct deferred_decl_context_node): Tweak.
      	(maybe_pad_type): Adjust comments.  Set the debug type later.  Remove
      	call to rest_of_record_type_compilation.
      	(rest_of_record_type_compilation): Use copy_type.
      	(copy_type): Use correctly typed constants.
      	(gnat_signed_or_unsigned_type_for): Use copy_type.
      	* gcc-interface/utils2.c (nonbinary_modular_operation): Likewise.
      	(build_goto_raise): Adjust call tognat_to_gnu_entity.
      
      From-SVN: r235479
      Eric Botcazou committed
    • params.def (MAX_PARTITION_SIZE): New param. · a2e76867
      2016-04-27  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
      
      	* params.def (MAX_PARTITION_SIZE): New param.
      	* invoke.texi: Document lto-max-partition.
      lto/
      	* lto-partition.h (lto_balanced_map): New parameter.
      	* lto-partition.c (lto_balanced_map): New parameter
      	max_partition_size.
      	Check if partition size is greater than max_partition_size.
      	* lto.c (do_whole_program_analysis): Adjust calls to
      	lto_balanced_map() to pass 2nd argument.
      
      From-SVN: r235478
      Prathamesh Kulkarni committed
    • re PR ipa/70785 (LTO bootstrap with IPA PTA is broken) · 2b78f221
      2016-04-27  Richard Biener  <rguenther@suse.de>
      
      	PR ipa/70785
      	* tree-ssa-structalias.c (refered_from_nonlocal_fn): New
      	function cummulating used_from_other_partition, externally_visible
      	and force_output from aliases.
      	(refered_from_nonlocal_var): Likewise.
      	(ipa_pta_execute): Use call_for_symbol_and_aliases to cummulate
      	node flags properly.
      
      From-SVN: r235477
      Richard Biener committed
    • invoke.texi (Warning Options): Add -Wmemset-elt-size. · c1e1f433
      	* doc/invoke.texi (Warning Options): Add -Wmemset-elt-size.
      	(-Wmemset-elt-size): New item.
      c-family/
      	* c.opt (Wmemset-elt-size): New option.
      	* c-common.c (warn_for_memset): New function.
      	* c-common.h (warn_for_memset): Declare.
      c/
      	* c-parser.c (c_parser_postfix_expression_after_primary): Call
      	warn_for_memset instead of warning directly here.
      cp/
      	* parser.c (cp_parser_postfix_expression): Call
      	warn_for_memset instead of warning directly here.
      testsuite/
      	* c-c++-common/memset-array.c: New test.
      
      From-SVN: r235475
      Bernd Schmidt committed
    • re PR ada/70759 (Ada rts fails to build with -mabi=ilp32) · 06aed101
      	PR ada/70759
      	* stor-layout.h (internal_reference_types): Delete.
      	* stor-layout.c (reference_types_internal): Likewise.
      	(internal_reference_types): Likewise.
      	(layout_type) <REFERENCE_TYPE>: Adjust.
      ada/
      	* gcc-interface/misc.c (gnat_init): Do not call
      	internal_reference_types.
      
      From-SVN: r235472
      Eric Botcazou committed
    • * gennews (files): Add files for GCC 6. · 9364c30e
      From-SVN: r235470
      Jakub Jelinek committed
    • re PR sanitizer/70683 (-fcompare-debug bug with -fsanitize=address) · 108b7b29
      	PR sanitizer/70683
      	* tree.h (inchash::add_expr): Add FLAGS argument.
      	* tree.c (inchash::add_expr): Likewise.  If not OEP_ADDRESS_OF,
      	use STRIP_NOPS first.  For INTEGER_CST assert not OEP_ADDRESS_OF.
      	For REAL_CST and !HONOR_SIGNED_ZEROS (t) hash +/- 0 the same.
      	Formatting fix.  Adjust recursive calls.  For tcc_comparison,
      	if swap_tree_comparison (code) is smaller than code, hash that
      	and arguments in the other order.  Hash CONVERT_EXPR the same
      	as NOP_EXPR.  For OEP_ADDRESS_OF hash MEM_REF with 0 offset
      	of ADDR_EXPR of decl as the decl itself.  Add or remove
      	OEP_ADDRESS_OF from recursive flags as needed.  For
      	FMA_EXPR, WIDEN_MULT_{PLUS,MINUS}_EXPR hash the first two
      	operands commutatively and only the third one normally.
      	For internal CALL_EXPR hash in CALL_EXPR_IFN.
      
      From-SVN: r235469
      Jakub Jelinek committed
    • Makefile.in (x86 GNU/Hurd): Use s-osinte-gnu.adb. · 1ee806d8
      	* gcc-interface/Makefile.in (x86 GNU/Hurd): Use s-osinte-gnu.adb.
      	* s-osinte-gnu.ads: Small tweaks.
      	* s-osinte-gnu.adb: New file.
      
      From-SVN: r235467
      Svante Signell committed
    • [libatomic] Add RTEMS support · c47194d2
      gcc/
      
      	* config/rtems.h (LIB_SPEC): Add -latomic.
      
      libatomic/
      
      	* configure.tgt (configure_tgt_pre_target_cpu_XCFLAGS): New variable.
      	(*-*-rtems*): New supported target.
      	* config/rtems/host-config.h: New file.
      	* config/rtems/lock.c: Likewise.
      
      From-SVN: r235466
      Sebastian Huber committed
    • [Microblaze] Redefine LINK_SPEC for RTEMS · 727cbedf
      gcc/
      
      	* config/microblaze/rtems.h: Redefine LINK_SPEC to avoid
      	xilink.ld and flags not relevant to RTEMS.
      
      From-SVN: r235465
      Joel Sherrill committed
    • Daily bump. · f702d110
      From-SVN: r235464
      GCC Administrator committed
  2. 26 Apr, 2016 17 commits
    • PR c++/66639 - declare __func__ , __FUNCTION__ & __PRETTY_FUNCTION__ constexpr · 8ac43293
      PR c++/66639 - declare __func__ , __FUNCTION__ & __PRETTY_FUNCTION__ constexpr
      * g++.dg/cpp1y/func_constexpr.C: New test.
      
      From-SVN: r235458
      Martin Sebor committed
    • Fix PR c++/70241 (inconsistent access with in-class enumeration) · 843ce8ab
      gcc/cp/ChangeLog:
      
      	PR c++/70241
      	* decl.c (build_enumerator): Set current_access_specifier when
      	declaring an enumerator belonging to an in-class enumeration.
      	* parser.c (cp_parser_check_access_in_redecleration): Also
      	consider in-class enumerations.
      
      gcc/testsite/ChangeLog:
      
      	PR c++/70241
      	* g++.dg/cpp0x/enum32.C: New test.
      	* g++.dg/cpp0x/enum33.C: New test.
      
      From-SVN: r235456
      Patrick Palka committed
    • pr69102.c: Require scheduling support. · 3866f82f
      2016-04-06  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
      
      	* gcc.c-torture/compile/pr69102.c: Require scheduling support.
      	* gcc.c-torture/compile/pr37669.c: Require >=32 bit integers.
      	* gcc.c-torture/execute/bitfld-6.c: Likewise.
      	* gcc.c-torture/execute/bitfld-7.c: Likewise.
      	* gcc.c-torture/execute/pr38151.c: Likewise.
      	* gcc.c-torture/execute/pr66556.c: Likewise.
      	* gcc.c-torture/execute/pr67781.c: Likewise.
      	* gcc.c-torture/execute/pr68648.c: Likewise.
      
      From-SVN: r235454
      Senthil Kumar Selvaraj committed
    • toplev.c (backend_init_target): Avoid calling init_reload when using LRA. · a24c4267
      2016-04-26  Zhouyi Zhou  <yizhouzhou@ict.ac.cn>
      
      	* toplev.c (backend_init_target): Avoid calling init_reload when using
      	LRA.
      
      From-SVN: r235453
      Zhouyi Zhou committed
    • compiler: Add Enclosed_var_expression. · e64e9387
          
          Introduces an abstraction for a variable referenced in a closure.
          This maintains the underlying expression which accesses a field within
          a closure variable and gives easy access to the underlying
          Named_object.
          
          Reviewed-on: https://go-review.googlesource.com/22374
      
      From-SVN: r235452
      Ian Lance Taylor committed
    • reorg.c (try_merge_delay_insns): Declare i and j inside the for loops rather… · 5e851c02
      reorg.c (try_merge_delay_insns): Declare i and j inside the for loops rather than one for the whole function.
      
      	* reorg.c (try_merge_delay_insns): Declare i and j inside the
      	for loops rather than one for the whole function.
      
      From-SVN: r235451
      Jakub Jelinek committed
    • match.pd: u + 3 < u is u > UINT_MAX - 3 · ca1206be
      2016-04-26  Marc Glisse  <marc.glisse@inria.fr>
      
      gcc/
      	* match.pd (X + CST CMP X): New transformation.
      
      gcc/testsuite/
      	* gcc.dg/tree-ssa/overflow-1.c: New testcase.
      
      From-SVN: r235448
      Marc Glisse committed
    • re PR c/70791 (-Wnested-externs prints inconsistent column number) · b02a5e26
      	PR c/70791
      	* c-decl.c (pushdecl): Pass LOCUS down to warning.
      
      	* gcc.dg/Wnested-externs-2.c: New test.
      
      From-SVN: r235447
      Marek Polacek committed
    • re PR c/67784 (Incorrect parsing when using declarations in for loops and typedefs) · 2448a956
      	PR c/67784
      	* c-parser.c (c_parser_maybe_reclassify_token): New function factored
      	out of ...
      	(c_parser_for_statement): ... here.
      	(c_parser_if_statement): Use it.
      	(c_parser_switch_statement): Use it.
      	(c_parser_while_statement): Use it.
      
      	* gcc.dg/pr67784-3.c: New test.
      	* gcc.dg/pr67784-4.c: New test.
      	* gcc.dg/pr67784-5.c: New test.
      
      From-SVN: r235446
      Marek Polacek committed
    • match.pd: X + X --> X * 2 for integers · 6b6aa8d3
      2016-04-26  Marc Glisse  <marc.glisse@inria.fr>
      
      gcc/
      	* genmatch.c (write_predicate): Add ATTRIBUTE_UNUSED.
      	* fold-const.c (fold_binary_loc): Remove 2 transformations
      	superseded by match.pd.
      	* match.pd (x+x -> x*2): Generalize to integers.
      
      gcc/testsuite/
      	* gcc.dg/fold-plusmult.c: Adjust.
      	* gcc.dg/no-strict-overflow-6.c: Adjust.
      	* gcc.dg/gomp/loop-1.c: Xfail some tests.
      
      From-SVN: r235444
      Marc Glisse committed
    • i386: Add a variant peephole for lea rather than ops that clobber CC. · a84454dc
      	* config/i386/i386.md (operation on memory peephole): Duplicate an
      	existing peephole and adapt it to match lea rather than an operation
      	that clobbers CC.
      
      From-SVN: r235443
      Bernd Schmidt committed
    • Enable -frename-registers at -O2. · 1d776c5f
      	PR rtl-optimization/57193
      	* opts.c (default_options_table): Add OPT_frename_registers at -O2
      	and above.
      	* doc/invoke.texi (-frename-registers, -O2): Update documentation.
      
      From-SVN: r235442
      Bernd Schmidt committed
    • Fix x86 testcases for -frename-registers. · a2095b55
      	* gcc.target/i386/avx512bw-vptestmb-1.c: Correct [xyz]mm register
      	number scans.
      	* gcc.target/i386/avx512bw-vptestmw-1.c: Likewise.
      	* gcc.target/i386/avx512bw-vptestnmb-1.c: Likewise.
      	* gcc.target/i386/avx512bw-vptestnmw-1.c: Likewise.
      	* gcc.target/i386/avx512cd-vpbroadcastmb2q-1.c: Likewise.
      	* gcc.target/i386/avx512cd-vpbroadcastmw2d-1.c: Likewise.
      	* gcc.target/i386/avx512dq-vfpclasspd-1.c: Likewise.
      	* gcc.target/i386/avx512dq-vfpclassps-1.c: Likewise.
      	* gcc.target/i386/avx512dq-vinsertf64x2-1.c: Likewise.
      	* gcc.target/i386/avx512dq-vinserti64x2-1.c: Likewise.
      	* gcc.target/i386/avx512f-gather-5.c: Likewise.
      	* gcc.target/i386/avx512f-vptestmd-1.c: Likewise.
      	* gcc.target/i386/avx512f-vptestmq-1.c: Likewise.
      	* gcc.target/i386/avx512f-vptestnmd-1.c: Likewise.
      	* gcc.target/i386/avx512f-vptestnmq-1.c: Likewise.
      	* gcc.target/i386/avx512f-vrndscaleps-1.c: Likewise.
      	* gcc.target/i386/avx512vl-vpbroadcastmb2q-1.c: Likewise.
      	* gcc.target/i386/avx512vl-vpbroadcastmw2d-1.c: Likewise.
      	* gcc.target/i386/avx512vl-vptestmd-1.c: Likewise.
      	* gcc.target/i386/avx512vl-vptestmq-1.c: Likewise.
      	* gcc.target/i386/avx512vl-vptestnmd-1.c: Likewise.
      	* gcc.target/i386/avx512vl-vptestnmq-1.c: Likewise.
      	* gcc.target/i386/pr32219-2.c: Allow registers other than %eax in
      	scans.
      	* gcc.target/i386/pr32219-4.c: Likewise.
      	* gcc.target/i386/pr32219-6.c: Likewise.
      	* gcc.target/i386/pr32219-8.c: Likewise.
      
      From-SVN: r235441
      Bernd Schmidt committed
    • Fix FAIL: gcc.dg/tree-ssa/minmax-2.c scan-tree-dump optimized "__builtin_fmin" · bb0cc5c8
      	* gcc.dg/tree-ssa/minmax-2.c: Require c99_runtime and add the
      	associated options.
      
      From-SVN: r235440
      Kyrylo Tkachov committed
    • Verify __builtin_unreachable and __builtin_trap are not called with arguments · 83f5f27d
      2016-04-26  Martin Jambor  <mjambor@suse.cz>
      
      	* tree-cfg.c (verify_gimple_call): Check that calls to
      	__builtin_unreachable or __builtin_trap do not have actual arguments.
      
      From-SVN: r235439
      Martin Jambor committed
    • Bootstrapped/regtested on x86_64-linux, ok for trunk? · 5a0802ea
      2016-04-25  Marek Polacek  <polacek@redhat.com>
      
      	PR c++/70744
      	* call.c (build_conditional_expr_1): Call cp_stabilize_reference
      	instead of stabilize_reference.
      	(build_over_call): Likewise.
      	* cp-tree.h (cp_stabilize_reference): Declare.
      	* tree.c (cp_stabilize_reference): New function.
      	* typeck.c (cp_build_unary_op): Call cp_stabilize_reference instead of
      	stabilize_reference.
      	(unary_complex_lvalue): Likewise.
      	(cp_build_modify_expr): Likewise.
      
      	* g++.dg/ext/cond2.C: New test.
      
      diff --git gcc/cp/call.c gcc/cp/call.c
      index 11f2d42..476e806 100644
      --- gcc/cp/call.c
      +++ gcc/cp/call.c
      @@ -4634,7 +4634,7 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3,
       
             /* Make sure that lvalues remain lvalues.  See g++.oliva/ext1.C.  */
             if (real_lvalue_p (arg1))
      -	arg2 = arg1 = stabilize_reference (arg1);
      +	arg2 = arg1 = cp_stabilize_reference (arg1);
             else
       	arg2 = arg1 = save_expr (arg1);
           }
      @@ -7644,8 +7644,9 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
       	       || (TREE_CODE (arg) == TARGET_EXPR
       		   && !unsafe_copy_elision_p (fa, arg)))
       	{
      -	  tree to = stabilize_reference (cp_build_indirect_ref (fa, RO_NULL,
      -								complain));
      +	  tree to = cp_stabilize_reference (cp_build_indirect_ref (fa,
      +								   RO_NULL,
      +								   complain));
       
       	  val = build2 (INIT_EXPR, DECL_CONTEXT (fn), to, arg);
       	  return val;
      @@ -7655,7 +7656,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
       	   && trivial_fn_p (fn)
       	   && !DECL_DELETED_FN (fn))
           {
      -      tree to = stabilize_reference
      +      tree to = cp_stabilize_reference
       	(cp_build_indirect_ref (argarray[0], RO_NULL, complain));
             tree type = TREE_TYPE (to);
             tree as_base = CLASSTYPE_AS_BASE (type);
      diff --git gcc/cp/cp-tree.h gcc/cp/cp-tree.h
      index ec92718..0e46ae1 100644
      --- gcc/cp/cp-tree.h
      +++ gcc/cp/cp-tree.h
      @@ -6494,6 +6494,7 @@ extern cp_lvalue_kind real_lvalue_p		(const_tree);
       extern cp_lvalue_kind lvalue_kind		(const_tree);
       extern bool lvalue_or_rvalue_with_address_p	(const_tree);
       extern bool xvalue_p	                        (const_tree);
      +extern tree cp_stabilize_reference		(tree);
       extern bool builtin_valid_in_constant_expr_p    (const_tree);
       extern tree build_min				(enum tree_code, tree, ...);
       extern tree build_min_nt_loc			(location_t, enum tree_code,
      diff --git gcc/cp/tree.c gcc/cp/tree.c
      index 112c8c7..137186f 100644
      --- gcc/cp/tree.c
      +++ gcc/cp/tree.c
      @@ -296,6 +296,46 @@ xvalue_p (const_tree ref)
         return (lvalue_kind (ref) == clk_rvalueref);
       }
       
      +/* C++-specific version of stabilize_reference.  */
      +
      +tree
      +cp_stabilize_reference (tree ref)
      +{
      +  switch (TREE_CODE (ref))
      +    {
      +    /* We need to treat specially anything stabilize_reference doesn't
      +       handle specifically.  */
      +    case VAR_DECL:
      +    case PARM_DECL:
      +    case RESULT_DECL:
      +    CASE_CONVERT:
      +    case FLOAT_EXPR:
      +    case FIX_TRUNC_EXPR:
      +    case INDIRECT_REF:
      +    case COMPONENT_REF:
      +    case BIT_FIELD_REF:
      +    case ARRAY_REF:
      +    case ARRAY_RANGE_REF:
      +    case COMPOUND_EXPR:
      +    case ERROR_MARK:
      +      break;
      +    default:
      +      cp_lvalue_kind kind = lvalue_kind (ref);
      +      if ((kind & ~clk_class) != clk_none)
      +	{
      +	  tree type = unlowered_expr_type (ref);
      +	  bool rval = !!(kind & clk_rvalueref);
      +	  type = cp_build_reference_type (type, rval);
      +	  /* This inhibits warnings in, eg, cxx_mark_addressable
      +	     (c++/60955).  */
      +	  warning_sentinel s (extra_warnings);
      +	  ref = build_static_cast (type, ref, tf_error);
      +	}
      +    }
      +
      +  return stabilize_reference (ref);
      +}
      +
       /* Test whether DECL is a builtin that may appear in a
          constant-expression. */
       
      diff --git gcc/cp/typeck.c gcc/cp/typeck.c
      index cef5604..7e12009 100644
      --- gcc/cp/typeck.c
      +++ gcc/cp/typeck.c
      @@ -5912,7 +5912,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
       	{
       	  tree real, imag;
       
      -	  arg = stabilize_reference (arg);
      +	  arg = cp_stabilize_reference (arg);
       	  real = cp_build_unary_op (REALPART_EXPR, arg, 1, complain);
       	  imag = cp_build_unary_op (IMAGPART_EXPR, arg, 1, complain);
       	  real = cp_build_unary_op (code, real, 1, complain);
      @@ -6112,7 +6112,7 @@ unary_complex_lvalue (enum tree_code code, tree arg)
             tree lvalue = TREE_OPERAND (arg, 0);
             if (TREE_SIDE_EFFECTS (lvalue))
       	{
      -	  lvalue = stabilize_reference (lvalue);
      +	  lvalue = cp_stabilize_reference (lvalue);
       	  arg = build2 (TREE_CODE (arg), TREE_TYPE (arg),
       			lvalue, TREE_OPERAND (arg, 1));
       	}
      @@ -7496,7 +7496,7 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs,
           case PREINCREMENT_EXPR:
             if (TREE_SIDE_EFFECTS (TREE_OPERAND (lhs, 0)))
       	lhs = build2 (TREE_CODE (lhs), TREE_TYPE (lhs),
      -		      stabilize_reference (TREE_OPERAND (lhs, 0)),
      +		      cp_stabilize_reference (TREE_OPERAND (lhs, 0)),
       		      TREE_OPERAND (lhs, 1));
             newrhs = cp_build_modify_expr (TREE_OPERAND (lhs, 0),
       				     modifycode, rhs, complain);
      @@ -7516,7 +7516,7 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs,
           case MODIFY_EXPR:
             if (TREE_SIDE_EFFECTS (TREE_OPERAND (lhs, 0)))
       	lhs = build2 (TREE_CODE (lhs), TREE_TYPE (lhs),
      -		      stabilize_reference (TREE_OPERAND (lhs, 0)),
      +		      cp_stabilize_reference (TREE_OPERAND (lhs, 0)),
       		      TREE_OPERAND (lhs, 1));
             newrhs = cp_build_modify_expr (TREE_OPERAND (lhs, 0), modifycode, rhs,
       				     complain);
      @@ -7665,7 +7665,7 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs,
       	     not intervene between the lvalue-to-rvalue conversion and the
       	     side effect associated with any single compound assignment
       	     operator. -- end note ]  */
      -	  lhs = stabilize_reference (lhs);
      +	  lhs = cp_stabilize_reference (lhs);
       	  rhs = rvalue (rhs);
       	  rhs = stabilize_expr (rhs, &init);
       	  newrhs = cp_build_binary_op (input_location,
      diff --git gcc/testsuite/g++.dg/ext/cond2.C gcc/testsuite/g++.dg/ext/cond2.C
      index e69de29..d9f1d59 100644
      --- gcc/testsuite/g++.dg/ext/cond2.C
      +++ gcc/testsuite/g++.dg/ext/cond2.C
      @@ -0,0 +1,28 @@
      +// PR c++/70744
      +// { dg-do run }
      +// { dg-options "" }
      +
      +static void
      +fn1 (void)
      +{
      +  int x = 2;
      +  ++x ? : 42;
      +  if (x != 3)
      +    __builtin_abort ();
      +  --x ? : 42;
      +  if (x != 2)
      +    __builtin_abort ();
      +  x++ ? : 42;
      +  if (x != 3)
      +    __builtin_abort ();
      +  x-- ? : 42;
      +  if (x != 2)
      +    __builtin_abort ();
      +}
      +
      +int
      +main ()
      +{
      +  fn1 ();
      +  return 0;
      +}
      
      From-SVN: r235438
      Marek Polacek committed