1. 15 Nov, 2018 9 commits
  2. 14 Nov, 2018 31 commits
    • re PR middle-end/59658 (Document -f* flags enabled by -Og) · ded7b411
      2018-11-14  Sandra Loosemore  <sandra@codesourcery.com>
      
      	PR middle-end/59658
      
      	gcc/
      	* doc/invoke.texi (Optimize Options): Clarify that -O0 and -Og
      	also suppress many optimizations.  Alphabetize option lists for
      	-O1, -O2, and -Os.  Add list of options disabled with -Og, and
      	correct documentation for those options to say that.
      	* opts.c (default_options_table): Sort table by level and option
      	name, to make it easier to correlate to the manual.
      
      From-SVN: r266162
      Sandra Loosemore committed
    • i386.c (ix86_print_operand_address_as): Simplify printing of the names of segment registers. · 281d448d
      	* config/i386/i386.c (ix86_print_operand_address_as): Simplify
      	printing of the names of segment registers.
      
      From-SVN: r266161
      Uros Bizjak committed
    • [debug/88006] -fdebug-types-section gives undefined ref · 89d9bf44
      https://gcc.gnu.org/ml/gcc-patches/2018-11/msg01280.html
      	PR debug/88006
      	PR debug/87462
      	* dwarf2out.c (dwarf2out_finish): Apply resolve_addr to comdat
      	type list.
      
      	* g++.dg/debug/dwarf2/pr87462.C: New.
      	* g++.dg/debug/dwarf2/pr88006.C: New.
      
      From-SVN: r266158
      Nathan Sidwell committed
    • Add missing ZLIBINC to CFLAGS-optinfo-emit-json.o · 1ded030b
      gcc/ChangeLog:
      	* Makefile.in (CFLAGS-optinfo-emit-json.o): Add $(ZLIBINC).
      
      From-SVN: r266156
      David Malcolm committed
    • parser.c (make_id_declarator): Add location_t parameter. · 03f3f0f2
      /cp
      2018-11-14  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* parser.c (make_id_declarator): Add location_t parameter.
      	(cp_parser_lambda_declarator_opt): Adjust call.
      	(cp_parser_decomposition_declaration): Likewise.
      	(cp_parser_alias_declaration): Likewise.
      	(cp_parser_direct_declarator): Likewise.
      	(cp_parser_member_declaration): Likewise.
      	(cp_parser_objc_class_ivars): Likewise.
      	* decl.c (grokdeclarator): Use declarator->id_loc in two error
      	messages.
      
      /testsuite
      2018-11-14  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* g++.dg/cpp0x/nsdmi-union6.C: Test locations too.
      	* g++.dg/cpp0x/nsdmi6.C: Likewise.
      	* g++.dg/ext/flexary4.C: Likewise.
      	* g++.dg/ext/flexary9.C: Likewise.
      	* g++.dg/other/incomplete2.C: Likewise.
      	* g++.dg/parse/friend12.C: Likewise.
      
      From-SVN: r266155
      Paolo Carlini committed
    • Handle libphobos in contrib/gcc_update · 357044d2
      	* gcc_update (files_and_dependencies): Handle libphobos.
      
      From-SVN: r266154
      Rainer Orth committed
    • P1236R1 - Signed integers are two's complement · 8ee09943
      	P1236R1 - Signed integers are two's complement
      gcc/cp/
      	* constexpr.c (cxx_eval_check_shift_p): Disable the signed LSHIFT_EXPR
      	checks for c++2a.
      gcc/c-family/
      	* c-warn.c (maybe_warn_shift_overflow): Don't warn for c++2a.
      	* c-ubsan.c (ubsan_instrument_shift): Make signed shifts
      	with in-range second operand well defined for -std=c++2a.
      gcc/
      	* doc/invoke.texi (Wshift-overflow): Adjust documentation for
      	c++2a.
      gcc/testsuite/
      	* g++.dg/cpp2a/constexpr-shift1.C: New test.
      	* g++.dg/warn/permissive-1.C (enum A, enum D): Don't expect
      	diagnostics here for c++2a.
      	* g++.dg/cpp0x/constexpr-shift1.C (fn3, i3, fn4, i4): Don't expect
      	diagnostics here for c++2a.
      	* g++.dg/cpp0x/constexpr-60049.C (f3, x3, y3): Likewise.
      	* g++.dg/ubsan/cxx11-shift-1.C (main): Add some further tests.
      	* g++.dg/ubsan/cxx11-shift-2.C (main): Likewise.
      	* g++.dg/ubsan/cxx2a-shift-1.C: New test.
      	* g++.dg/ubsan/cxx2a-shift-2.C: New test.
      
      From-SVN: r266153
      Jakub Jelinek committed
    • re PR bootstrap/86739 (Bootstrap broken with host GCC 4.1.2) · 12763abc
      	PR bootstrap/86739
      	* hash-map.h (hash_map::iterator::reference_pair): New class.
      	(hash_map::iterator::operator*): Return it rather than std::pair.
      
      From-SVN: r266152
      Jakub Jelinek committed
    • optabs.c (expand_binop): Pass INT_MODE to operand_subword_force iff the operand is a constant. · c933b893
      	* optabs.c (expand_binop): Pass INT_MODE to operand_subword_force
      	iff the operand is a constant.
      
      	* gcc.c-torture/compile/20181114.c: New test.
      
      2018-11-14  Ilya Leoshkevich  <iii@linux.ibm.com>
      
      From-SVN: r266151
      Jeff Law committed
    • * gimple-ssa-evrp-analyze.c · ff361cc6
      	(evrp_range_analyzer::record_ranges_from_incoming_edge): Rename
      	ignore_equivs_equal_p to equal_p.
      	* ipa-cp.c (meet_with_1): Use equal_p instead of
      	ignore_equivs_equal_p.
      	* ipa-prop.c (ipa_vr_ggc_hash_traits::equal): Same.
      	* tree-vrp.c (value_range::ignore_equivs_equal_p): Remove.
      	(value_range::operator==): Remove.
      	(value_range::operator!=): Remove.
      	(vrp_prop::visit_stmt): Use equal_p.
      	* tree-vrp.h (value_range): Remove operator==, operator!=,
      	ignore_equivs_equal_p.
      	* vr-values.c (update_value_range): Use equal_p.
      
      From-SVN: r266150
      Aldy Hernandez committed
    • Add comment · 62ec3fe8
      From-SVN: r266149
      Michael Matz committed
    • re PR middle-end/86575 (-Wimplicit-fallthrough affects code generation) · 725891a0
      Fix PR middle-end/86575
      
      	PR middle-end/86575
      	* gimplify.c (collect_fallthrough_labels): Add new argument,
      	return location via that, don't modify statements.
      	(warn_implicit_fallthrough_r): Adjust call, don't use
      	statement location directly.
      
      From-SVN: r266148
      Michael Matz committed
    • re PR tree-optimization/87985 (Compile-time and memory hog w/ -O1 -ftree-slp-vectorize) · e81d464c
      2018-11-14  Richard Biener  <rguenther@suse.de>
      
      	PR middle-end/87985
      	* tree-data-ref.c (split_constant_offset): Add wrapper
      	allocating a cache hash-map.
      	(split_constant_offset_1): Cache results of expanding
      	expressions from SSA def stmts.
      
      	* gcc.dg/pr87985.c: New testcase.
      
      From-SVN: r266147
      Richard Biener committed
    • Add missing dir to create_testsuite_files script · 78ef03b7
      	* scripts/create_testsuite_files: Add special_functions to the list
      	of directories to search. Add comment referring to conformance.exp.
      	* testsuite/libstdc++-dg/conformance.exp: Add comment referring
      	to create_testsuite_files.
      
      From-SVN: r266146
      Jonathan Wakely committed
    • [PATCH 2/2] S/390: Fix expectation in mrecord-mcount test for 31-bit · 487a4df6
       mode
      
      The emitted address is .long, not .quad, in that case.
      
      gcc/testsuite/ChangeLog:
      
      2018-11-14  Ilya Leoshkevich  <iii@linux.ibm.com>
      
      	* gcc.target/s390/mrecord-mcount.c (profileme): Expect .long in
      	31-bit mode.
      
      From-SVN: r266145
      Ilya Leoshkevich committed
    • [PATCH 1/2] S/390: Disable 3 global-array-* tests for 31-bit mode · 867a1e28
      These tests rely on larl->movdi merge, which is not implemented for
      31-bit mode.
      
      gcc/testsuite/ChangeLog:
      
      2018-11-14  Ilya Leoshkevich  <iii@linux.ibm.com>
      
      	* gcc.target/s390/global-array-almost-huge-element.c: Run only
      	in 64-bit mode.
      	* gcc.target/s390/global-array-almost-negative-huge-element.c:
      	Likewise.
      	* gcc.target/s390/global-array-even-element.c: Likewise.
      
      From-SVN: r266144
      Ilya Leoshkevich committed
    • re PR testsuite/88021 (aarch64 Busy hang running testcase pr60183.c since revision 265914) · 9449a01e
      2018-11-14  Richard Biener  <rguenther@suse.de>
      
      	PR middle-end/88021
      	* tree-data-ref.c (lambda_matrix_row_add): Change const1 argument
      	to lambda_int.
      	(lambda_vector_mult_const): Likewise.
      	(lambda_matrix_right_hermite): Use lambda_int temporaries.
      
      From-SVN: r266143
      Richard Biener committed
    • Simplify floating point comparisons · 5e21d765
      This patch implements some of the optimizations discussed in PR71026.
      
      Simplify (C / x >= 0.0) into x >= 0.0 with -funsafe-math-optimizations
      (since C / x can underflow to zero if x is huge, it's not safe otherwise).
      If C is negative the comparison is reversed.
      
      Simplify (x * C1) > C2 into x > (C2 / C1) with -funsafe-math-optimizations.
      If C1 is negative the comparison is reversed.
      
          gcc/
      	PR 71026/tree-optimization
      	* match.pd: Simplify floating point comparisons.
      
          gcc/testsuite/
      	PR 71026/tree-optimization
      	* gcc.dg/div-cmp-1.c: New test.
      	* gcc.dg/div-cmp-2.c: New test.
      
      Co-Authored-By: Jackson Woodruff <jackson.woodruff@arm.com>
      
      From-SVN: r266142
      Wilco Dijkstra committed
    • re PR other/88007 (ICE in gt_ggc_m_S, at ggc-page.c:1474) · 8cca0163
      	PR other/88007
      	* c-common.c (parse_optimize_options): Allocate option string from
      	opts_obstack rather than as GC memory.  Move the allocation after
      	warning for invalid option.
      
      	* gcc.dg/pr88007.c: New test.
      
      From-SVN: r266141
      Jakub Jelinek committed
    • re PR rtl-optimization/87817 (gcc.target/i386/bmi2-bzhi-2.c execution test) · 5bfba2b5
      	PR rtl-optimization/87817
      	* config/i386/i386.c (ix86_fold_builtin): For _bzhi_u{32,64} if
      	last argument has low 8 bits clear, fold to 0.
      
      	* gcc.target/i386/bmi2-bzhi-3.c (main): Add a couple of new tests.
      
      From-SVN: r266140
      Jakub Jelinek committed
    • [AArch64] Fix PR62178 testcase failures · ff4d8480
      The testcase for PR62178 has been failing for a while due to the pass
      conditions being too tight, resulting in failures with -mcmodel=tiny:
      
      	ldr	q2, [x0], 124
      	ld1r	{v1.4s}, [x1], 4
      	cmp	x0, x2
      	mla	v0.4s, v2.4s, v1.4s
      	bne	.L7
      
      -mcmodel=small generates the slightly different:
      
      	ldr	q1, [x0], 124
      	ldr	s2, [x1, 4]!
      	cmp	x0, x2
      	mla	v0.4s, v1.4s, v2.s[0]
      	bne	.L7
      
      This is due to Combine merging a DUP instruction with either a load
      or MLA - we can't force it to prefer one over the other.  However the
      generated vector loop is fast either way since it generates MLA and
      merges the DUP either with a load or MLA.  So relax the conditions
      slightly and check we still generate MLA and there is no DUP or FMOV.
      
      The testcase now passes - committed as obvious.
      
          testsuite/
      	* gcc.target/aarch64/pr62178.c: Relax scan-assembler checks.
      
      From-SVN: r266139
      Wilco Dijkstra committed
    • fix Darwin bootstrap. · b2581735
      gcc/
      
      	* tree-vect-data-refs.c (vect_can_force_dr_alignment_p): Cast
      	MAX_OFILE_ALIGNMENT as needed.
      
      From-SVN: r266138
      Iain Sandoe committed
    • [Ada] Problem with boundary case of XOR operation and unnesting · 076bbec1
      The XOR operation applied to a boolean array whose component type has
      the range True .. True raises constraint error. Previous to this patch,
      the expansion of the operation could lead to uplevel references that
      were not handled properly when unnesting is in effect.
      
      2018-11-14  Ed Schonberg  <schonberg@adacore.com>
      
      gcc/ada/
      
      	* exp_util.ads, exp_util.adb: Change the profile of
      	Silly_Boolean_Array_Xor_Test, adding a formal that can be a copy
      	of the right opersnd. This prevents unnesting anomalies when
      	that operand contains uplevel references.
      	* exp_ch4.adb (Expand_Boolean_Operation): Use this new profile.
      	* exp_pakd.adb (Expand_Packed_Boolean_Operator): Ditto.
      
      From-SVN: r266137
      Ed Schonberg committed
    • [Ada] Update signal constants for GNU/Linux · 9989a439
      Add the signal SIGSYS and mark the glibc reserved real-time signals
      (32-34) as reserved rather than not maskable.
      
      2018-11-14  Patrick Bernardi  <bernardi@adacore.com>
      
      gcc/ada/
      
      	* libgnarl/a-intnam__linux.ads: Add SIGSYS.
      	* libgnarl/s-linux__alpha.ads, libgnarl/s-linux__android.ads,
      	libgnarl/s-linux__hppa.ads, libgnarl/s-linux__mips.ads,
      	libgnarl/s-linux__riscv.ads, libgnarl/s-linux__sparc.ads,
      	libgnarl/s-linux__x32.ads: Rename SIGLTHRRES, SIGLTHRCAN and
      	SIGLTHRDBG to SIG32, SIG33 and SIG34 as their names are
      	implementation specific.
      	* libgnarl/s-osinte__linux.ads, libgnarl/s-linux.ads: Add
      	SIGSYS.  Move SIG32, SIG33 and SIG34 from the unmasked list to
      	the reserved list.
      
      gcc/testsuite/
      
      	* gnat.dg/rt_signals.adb: New testcase.
      
      From-SVN: r266136
      Patrick Bernardi committed
    • [Ada] Fix small regression with others choice in array aggregate · f1e2bf65
      This change is aimed at fixing a fallout of bumping the default value of
      the Max_Others_Replicate parameter of the Convert_To_Positional routine.
      This parameter is responsible for taming the duplication of the
      expression of an others choice in an array aggregate so that it doesn't
      result in a code size explosion.
      
      Unfortunately a fine-grained control based on the analysis of the
      expression is not really possible because this analysis has not been
      done yet by the time the decision is made in most cases, so the usual
      syntactic ambiguities of the language come into play and make the
      process a bit cumbersome.  For example, it is not possible to
      distinguish a simple reference to a static constant declared in another
      unit from a call to a parameterless function.
      
      Therefore the change errs on the side of caution and allows the
      duplication only if the expression is unambiguously static and
      sufficiently simple.
      
      For the following three aggregates, the duplication must be blocked and
      the elaboration of the aggregates must be done by means of a loop:
      
      with Q; use Q;
      
      procedure P is
      
        A : Arr := (others => Get_Value);
      
        B : Arr := (others => Get_Other_Value (0));
      
        C : Arr := (others => Q.Get_Other_Value (1));
      
      begin
        null;
      end;
      
      package Q is
      
        type Arr is array (1 .. 32) of Integer;
      
        function Get_Value return Integer;
      
        function Get_Other_Value (I : integer) return Integer;
      
      end Q;
      
      2018-11-14  Eric Botcazou  <ebotcazou@adacore.com>
      
      gcc/ada/
      
      	* exp_aggr.adb (Is_Static_Element): New predicate extracted
      	from...
      	(Check_Static_Components): ...here.  Call Is_Static_Element on
      	each element of the component association list, if any.
      	(Flatten): Duplicate the expression of an others choice only if
      	it is static or is an aggregate which can itself be flattened.
      
      From-SVN: r266135
      Eric Botcazou committed
    • [Ada] sigtramp-vxworks: Add a rule for sp (DWARF r31) on AArch64 · 934d4736
      2018-11-14  Olivier Hainque  <hainque@adacore.com>
      
      gcc/ada/
      
      	* sigtramp-vxworks-target.inc: Fix stack checking test errors in
      	ACATS, now that GCC can emit CFI rules referring to sp in
      	absence of a frame pointer.
      
      From-SVN: r266134
      Olivier Hainque committed
    • [Ada] Remove couple of recently added dead tests · 64a87aa5
      N_Quantified_Expression and N_Iterated_Component_Association are
      unrelated nodes that cannot appear in the same context: the former can
      appear wherever an expression node is acceptable whereas the latter can
      appear only as an element of a component association list.  So a test
      combining both most likely contains a dead arm and this change removes a
      couple of them.
      
      No functional changes.
      
      2018-11-14  Eric Botcazou  <ebotcazou@adacore.com>
      
      gcc/ada/
      
      	* exp_aggr.adb (Check_Static_Components): Remove dead test.
      	(Flatten): Likewise.  Move comment around.
      
      From-SVN: r266133
      Eric Botcazou committed
    • [Ada] Spurious error on Ghost null procedure · a2c54c95
      This patch modifies the analysis (which is really expansion) of null
      procedures to set the Ghost mode of the spec when the null procedure
      acts as a completion.  This ensures that all nodes and entities
      generated by the expansion are marked as Ghost, and provide a proper
      context for references to Ghost entities.
      
      2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>
      
      gcc/ada/
      
      	* sem_ch6.adb (Analyze_Null_Procedure): Capture Ghost and
      	SPARK-related global state at the start of the routine. Set the
      	Ghost mode of the completed spec if any.  Restore the saved
      	Ghost and SPARK-related global state on exit from the routine.
      
      gcc/testsuite/
      
      	* gnat.dg/ghost1.adb, gnat.dg/ghost1.ads: New testcase.
      
      From-SVN: r266132
      Hristian Kirtchev committed
    • [Ada] More complete information level for -gnatR output · b5f581cd
      This adds a 4th information level for the -gnatR output, where relevant
      compiler-generated types are listed in addition to the information
      already output by -gnatR3.
      
      For the following package P:
      
      package P is
      
        type Arr0 is array (Positive range <>) of Boolean;
      
          type Rec (D1 : Positive; D2 : Boolean) is record
             C1 : Integer;
             C2 : Arr0 (1 .. D1);
      
             case D2 is
                when False =>
                   C3 : Character;
                when True =>
                   C4 : String (1 .. 3);
                   C5 : Float;
             end case;
          end record;
      
          type Arr1 is array (1 .. 8) of Rec (1, True);
      
      end P;
      
      the output generated by -gnatR4 must be:
      
      Representation information for unit P (spec)
      --------------------------------------------
      
      for Arr0'Alignment use 1;
      for Arr0'Component_Size use 8;
      
      for Rec'Object_Size use 17179869344;
      for Rec'Value_Size use (if (#2 != 0) then ((((#1 + 15) & -4) + 8) * 8)
      else ((((#1 + 15) & -4) + 1) * 8) end);
      for Rec'Alignment use 4;
      for Rec use record
         D1 at  0 range  0 .. 31;
         D2 at  4 range  0 ..  7;
         C1 at  8 range  0 .. 31;
         C2 at 12 range  0 .. ((#1 * 8)) - 1;
         C3 at ((#1 + 15) & -4) range  0 ..  7;
         C4 at ((#1 + 15) & -4) range  0 .. 23;
         C5 at (((#1 + 15) & -4) + 4) range  0 .. 31;
      end record;
      
      for Arr1'Size use 1536;
      for Arr1'Alignment use 4;
      for Arr1'Component_Size use 192;
      
      for Tarr1c'Size use 192;
      for Tarr1c'Alignment use 4;
      for Tarr1c use record
         D1 at  0 range  0 .. 31;
         D2 at  4 range  0 ..  7;
         C1 at  8 range  0 .. 31;
         C2 at 12 range  0 ..  7;
         C4 at 16 range  0 .. 23;
         C5 at 20 range  0 .. 31;
      end record;
      
      2018-11-14  Eric Botcazou  <ebotcazou@adacore.com>
      
      gcc/ada/
      
      	* doc/gnat_ugn/building_executable_programs_with_gnat.rst
      	(-gnatR): Document new -gnatR4 level.
      	* gnat_ugn.texi: Regenerate.
      	* opt.ads (List_Representation_Info): Bump upper bound to 4.
      	* repinfo.adb: Add with clause for GNAT.HTable.
      	(Relevant_Entities_Size): New constant.
      	(Entity_Header_Num): New type.
      	(Entity_Hash): New function.
      	(Relevant_Entities): New set implemented with GNAT.HTable.
      	(List_Entities): Also list compiled-generated entities present
      	in the Relevant_Entities set. Consider that the Component_Type
      	of an array type is relevant.
      	(List_Rep_Info): Reset Relevant_Entities for each unit.
      	* switch-c.adb (Scan_Front_End_Switches): Add support for -gnatR4.
      	* switch-m.adb (Normalize_Compiler_Switches): Likewise
      	* usage.adb (Usage): Likewise.
      
      From-SVN: r266131
      Eric Botcazou committed
    • [Ada] Crash on interface equality covered by a renaming declaration · 4faf522b
      The frontend crashes processing a tagged type that implements an
      interface which has an equality primitive (that is, "=") and covers such
      primitive by means of a renaming declaration.
      
      2018-11-14  Javier Miranda  <miranda@adacore.com>
      
      gcc/ada/
      
      	* exp_disp.adb (Expand_Interface_Thunk): Extend handling of
      	renamings of the predefined equality primitive.
      	(Make_Secondary_DT): When calling Expand_Interface_Thunk() pass
      	it the primitive, instead of its Ultimate_Alias; required to
      	allow the called routine to identify renamings of the predefined
      	equality operation.
      
      gcc/testsuite/
      
      	* gnat.dg/equal5.adb, gnat.dg/equal5.ads: New testcase.
      
      From-SVN: r266130
      Javier Miranda committed
    • [Ada] Use of Suppress_Initialization with pragma Thread_Local_Storage · b6eb7548
      This patch allows for aspect/pragma Suppress_Initialization to be an
      acceptable form of missing initialization with respect to the semantics
      of pragma Thread_Local_Storage.
      
      ------------
      -- Source --
      ------------
      
      --  gnat.adc
      
      pragma Initialize_Scalars;
      
      --  pack.ads
      
      with System;
      
      package Pack is
         Addr : System.Address
            with Thread_Local_Storage, Suppress_Initialization;
      end Pack;
      
      -----------------
      -- Compilation --
      -----------------
      
      $ gcc -c pack.ads
      
      2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>
      
      gcc/ada/
      
      	* freeze.adb (Check_Pragma_Thread_Local_Storage): New routine. A
      	variable with suppressed initialization has no initialization
      	for purposes of the pragma.
      	(Freeze_Object_Declaration): Remove variable
      	Has_Default_Initialization as it is no longer used. Use routine
      	Check_Pragma_Thread_Local_Storage to verify the semantics of
      	pragma Thread_Local_Storage.
      
      From-SVN: r266129
      Hristian Kirtchev committed