Skip to content
Snippets Groups Projects
  1. May 06, 2021
  2. May 05, 2021
    • Eric Botcazou's avatar
      Fix PR target/100402 · e8d1ca7d
      Eric Botcazou authored
      This is a regression for 64-bit Windows present from mainline down to the 9
      branch and introduced by the fix for PR target/99234.  Again SEH, but with
      a twist related to the way MinGW implements setjmp/longjmp, which turns out
      to be piggybacked on SEH with recent versions of MinGW, i.e. the longjmp
      performs a bona-fide unwinding of the stack, because it calls RtlUnwindEx
      with the second argument initially passed to setjmp, which is the result of
      __builtin_frame_address (0) in the MinGW header file:
      
        define setjmp(BUF) _setjmp((BUF), __builtin_frame_address (0))
      
      This means that we directly expose the frame pointer to the SEH machinery
      here (unlike with regular exception handling where we use an intermediate
      CFA) and thus that we cannot do whatever we want with it.  The old code
      would leave it unaligned, i.e. not multiple of 16, whereas the new code
      aligns it, but this breaks for some reason; at least it appears that a
      .seh_setframe directive with 0 as second argument always works, so the
      fix aligns it this way.
      
      gcc/
      	PR target/100402
      	* config/i386/i386.c (ix86_compute_frame_layout): For a SEH target,
      	always return the establisher frame for __builtin_frame_address (0).
      gcc/testsuite/
      	* gcc.c-torture/execute/20210505-1.c: New test.
      e8d1ca7d
    • Ivan Sorokin's avatar
      x86: Build only one __cpu_model/__cpu_features2 variables · a0b4e09a
      Ivan Sorokin authored
      GCC -O2 generated quite bad code for this function:
      
      bool
      f (void)
      {
        return __builtin_cpu_supports("popcnt")
      	 && __builtin_cpu_supports("ssse3");
      }
      
      f:
      	movl	__cpu_model+12(%rip), %edx
      	movl	%edx, %eax
      	shrl	$6, %eax
      	andl	$1, %eax
      	andl	$4, %edx
      	movl	$0, %edx
      	cmove	%edx, %eax
      	ret
      
      The problem was caused by the fact that internally every invocation of
      __builtin_cpu_supports built a new variable __cpu_model and a new type
      __processor_model.  Because of this, GIMPLE level optimizers weren't able
      to CSE the loads of __cpu_model and optimize bit-operations properly.
      
      Improve GCC -O2 code generation by caching __cpu_model and__cpu_features2
      variables as well as their types:
      
      f:
              movl    __cpu_model+12(%rip), %eax
              andl    $68, %eax
              cmpl    $68, %eax
              sete    %al
              ret
      
      2021-05-05  Ivan Sorokin <vanyacpp@gmail.com>
      	    H.J. Lu <hjl.tools@gmail.com>
      
      gcc/
      
      	PR target/91400
      	* config/i386/i386-builtins.c (ix86_cpu_model_type_node): New.
      	(ix86_cpu_model_var): Likewise.
      	(ix86_cpu_features2_type_node): Likewise.
      	(ix86_cpu_features2_var): Likewise.
      	(fold_builtin_cpu): Cache __cpu_model and __cpu_features2 with
      	their types.
      
      gcc/testsuite/
      
      	PR target/91400
      	* gcc.target/i386/pr91400-1.c: New test.
      	* gcc.target/i386/pr91400-2.c: Likewise.
      a0b4e09a
    • Martin Sebor's avatar
      PR middle-end/100325 - missing warning with -O0 on sprintf overflow with pointer plus offset · 2254b323
      Martin Sebor authored
      gcc/ChangeLog:
      
      	* passes.def (pass_warn_printf): Run after SSA.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/tree-ssa/builtin-sprintf-warn-26.c: New test.
      2254b323
    • Patrick Palka's avatar
      libstdc++: Don't constrain some enable_borrowed_range specializations · 2b71ca68
      Patrick Palka authored
      These constraints are already present on the template we're partially
      specializing for.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/ranges_util.h (enable_borrowed_range<subrange>):
      	Remove constraints on this partial specialization.
      	* include/std/ranges (enable_borrowed_range<iota_view>):
      	Likewise.
      2b71ca68
    • Patrick Palka's avatar
      libstdc++: Implement LWG 3517/3520 for join_view/transform_view · 2663727d
      Patrick Palka authored
      libstdc++-v3/ChangeLog:
      
      	* include/std/ranges (transform_view::_Iterator::iter_swap):
      	Remove as per LWG 3520.
      	(join_view::_Iterator::iter_swap): Add indirectly_swappable
      	constraint as per LWG 3517.
      2663727d
    • Prathamesh Kulkarni's avatar
      arm/97903: Missed optimization in lowering test operation. · d9937da0
      Prathamesh Kulkarni authored
      gcc/ChangeLog:
      
      2021-05-05  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
      
      	* config/arm/neon.md (neon_vtst_combine<mode>): New pattern.
      	* config/arm/predicates.md (minus_one_operand): New predicate.
      d9937da0
    • Jeff Law's avatar
      Remove cc0 remnants from avr port · b927ffdd
      Jeff Law authored
      gcc/
      	* config/avr/avr.md: Remove references to CC_STATUS_INIT.
      b927ffdd
    • Stefan Schulze Frielinghaus's avatar
      PR rtl-optimization/100263: Ensure register can change mode · bb283170
      Stefan Schulze Frielinghaus authored
      For move2add_valid_value_p we also have to ask the target whether a
      register can be accessed in a different mode than it was set before.
      
      gcc/ChangeLog:
      
      	PR rtl-optimization/100263
      	* postreload.c (move2add_valid_value_p): Ensure register can
      	change mode.
      bb283170
    • Eric Botcazou's avatar
      Fix PR rtl-optimization/100411 · dfd2c92f
      Eric Botcazou authored
      This is the bootstrap failure of GCC 11 on MinGW64 configured with --enable-
      tune=nocona.  The bottom line is that SEH does not support CFI for epilogues
      but the x86 back-end nevertheless attaches it to instructions, so we have to
      filter it out and this is done by detecting the end of the prologue by means
      of the NOTE_INSN_PROLOGUE_END note.
      
      But the compiler manages to generate a second epilogue before this note in
      the RTL stream and this fools the aforementioned logic.  The root cause is
      cross-jumping, which inserts a jump before the end of the prologue, in fact
      just before the note; the rest (CFG cleanup, BB reordering, etc) is downhill
      from there.
      
      gcc/
      	PR rtl-optimization/100411
      	* cfgcleanup.c (try_crossjump_to_edge): Also skip end of prologue
      	and beginning of function markers.
      dfd2c92f
    • Jeff Law's avatar
      Remove NOTICE_UPDATE_CC remnants on cr16 · 14cf6aab
      Jeff Law authored
      gcc
      	* config/cr16/cr16.h (NOTICE_UPDATE_CC): Remove.
      	* config/cr16/cr16.c (notice_update_cc): Remove.
      	* config/cr16/cr16-protos.h (notice_update_cc): Remove.
      14cf6aab
    • Harald Anlauf's avatar
      PR fortran/100274 - ICE in gfc_conv_procedure_call, at fortran/trans-expr.c:6131 · a8b79cc9
      Harald Anlauf authored
      When the check for the length of formal and actual character arguments
      found a mismatch and emitted a warning, it would skip further checks
      like that could lead to errors.  Fix that by continuing the checking.
      Also catch a NULL pointer dereference.
      
      gcc/fortran/ChangeLog:
      
      	PR fortran/100274
      	* interface.c (gfc_compare_actual_formal): Continue checks after
      	emitting warning for argument length mismatch.
      	* trans-expr.c (gfc_conv_procedure_call): Check for NULL pointer
      	dereference.
      
      gcc/testsuite/ChangeLog:
      
      	PR fortran/100274
      	* gfortran.dg/argument_checking_25.f90: New test.
      a8b79cc9
    • Uros Bizjak's avatar
      i386: Implement integer vector compares for 64bit vectors [PR98218] · f3661f2d
      Uros Bizjak authored
      Implement integer vector compares for 64bit vectors for TARGET_MMX_WITH_SSE.
      
      2021-05-05  Uroš Bizjak  <ubizjak@gmail.com>
      
      gcc/
      	PR target/98218
      	* config/i386/i386-expand.c (ix86_expand_int_sse_cmp):
      	Handle V8QI, V4HI and V2SI modes.
      	* config/i386/i386.c (ix86_build_const_vector): Handle V2SImode.
      	(ix86_build_signbit_mask): Ditto.
      	* config/i386/mmx.md (MMXMODE14): New mode iterator.
      	(<smaxmin:code><MMXMODE14:mode>3): New expander.
      	(*mmx_<smaxmin:code><MMXMODE14:mode>3): New insn pattern.
      	(<umaxmin:code><MMXMODE24:mode>3): New expander.
      	(*mmx_<umaxmin:code><MMXMODE24:mode>3): New insn pattern.
      	(vec_cmp<MMXMODEI:mode><MMXMODEI:mode>): New expander.
      	(vec_cmpu<MMXMODEI:mode><MMXMODEI:mode>): Ditto.
      	(vcond<MMXMODEI:mode><MMXMODEI:mode>): Ditto.
      	(vcondu<MMXMODEI:mode><MMXMODEI:mode>): Ditto.
      	(vcond_mask_<MMXMODEI:mode><MMXMODEI:mode>): Ditto.
      
      gcc/testsuite/
      
      	PR target/98218
      	* gcc.target/i386/pr98218-1.c: New test.
      	* gcc.target/i386/pr98218-1a.c: Ditto.
      	* gcc.target/i386/pr98218-2.c: Ditto.
      	* gcc.target/i386/pr98218-2a.c: Ditto.
      	* gcc.target/i386/pr98218-3.c: Ditto.
      	* gcc.target/i386/pr98218-3a.c: Ditto.
      	* gcc.dg/vect/vect-bool-cmp.c (dg-final):
      	Scan vect tree dump for "LOOP VECTORIZED", not VECTORIZED.
      f3661f2d
    • Jonathan Wakely's avatar
      libstdc++: Add tests for std::invoke feature test macro · 29745bf0
      Jonathan Wakely authored
      libstdc++-v3/ChangeLog:
      
      	* testsuite/20_util/function_objects/invoke/3.cc: Check feature
      	test macro.
      	* testsuite/20_util/function_objects/invoke/version.cc: New test.
      29745bf0
    • Jonathan Wakely's avatar
      libstdc++: Use unsigned char argument to std::isdigit · d0d6ca01
      Jonathan Wakely authored
      Passing plain char to isdigit is undefined if the value is negative.
      
      libstdc++-v3/ChangeLog:
      
      	* include/std/charconv (__from_chars_alnum): Pass unsigned
      	char to std::isdigit.
      d0d6ca01
    • Eric Botcazou's avatar
      Minor formatting tweak · 0bd8a9ef
      Eric Botcazou authored
      gcc/testsuite/
      	* gnat.dg/debug17.adb: Minor tweak.
      0bd8a9ef
    • Eric Botcazou's avatar
      Generate debug info for local dynamic record types · 5747baa9
      Eric Botcazou authored
      In Ada you can embed VLAs in local record types and thus end up with
      dynamic offsets in record types, which are not well described in DWARF
      because 1) the temporaries generated for them by the gimplifier are
      naturally marked DECL_IGNORED_P and 2) when the types are referenced
      in nested subprograms, the DWARF back-end does not correctly handle
      the rewritten references.
      
      gcc/
      	* dwarf2out.c (loc_list_from_tree_1) <DECL>: During early DWARF, do
      	not expand the VALUE_EXPR of variables put in the non-local frame.
      	* gimplify.c (gimplify_type_sizes) <RECORD_TYPE>: If the type is not
      	to be ignored for debug info, ensure its variable offsets are not.
      gcc/testsuite/
      	* gnat.dg/debug8.adb: Minor tweak.
      	* gnat.dg/debug11.adb: Likewise.
      	* gnat.dg/debug16.adb: Likewise.
      	* gnat.dg/debug17.adb: New test.
      	* gnat.dg/specs/debug1.ads: Minor tweak.
      5747baa9
    • Tobias Burnus's avatar
      libgfortran/intrinsics/chmod.c: Silence unused var warning · dee371fd
      Tobias Burnus authored
      libgfortran/ChangeLog:
      
      	* intrinsics/chmod.c (chmod_internal): Only declare mode_mask var
      	if HAVE_UMASK.
      dee371fd
    • Robin Dapp's avatar
      testsuite: Add s390 to gcc.dg/vect/slp-21.c · 3db6989a
      Robin Dapp authored
      On s390 we vectorize 4 statements using SLP.  Add s390*-*-* to the
      appropriate dg-finals.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/vect/slp-21.c: Add s390.
      3db6989a
    • Piotr Trojanek's avatar
      [Ada] Fix expansion of attributes Input/Output for unchecked union types · d24ef4e6
      Piotr Trojanek authored
      gcc/ada/
      
      	* exp_attr.adb (Expand_N_Attribute_Reference): Fix expansion of
      	attributes Input and Output for unchecked unions.
      	* sem_case.ads: Fix typo "disriminant" and refill comment.
      d24ef4e6
    • Piotr Trojanek's avatar
      [Ada] Reuse Has_Defaulted_Discriminants where possible · 8adc8d9b
      Piotr Trojanek authored
      gcc/ada/
      
      	* exp_attr.adb, exp_ch9.adb, sem_ch3.adb: Reuse
      	Has_Defaulted_Discriminants.
      	* sem_ch4.adb (Analyze_Allocator): Reuse
      	Has_Defaulted_Discriminants (after reordering conjuncts); remove
      	redundant IF statement, whose condition is implied by
      	Has_Defaulted_Discriminants.
      	* sem_util.adb (Has_Defaulted_Discriminants): Has_Discriminants
      	implies that the First_Discriminant is present.
      	(Is_Fully_Initialized_Type): Reuse Has_Defaulted_Discriminants.
      8adc8d9b
    • Justin Squirek's avatar
      [Ada] Incorrect accessibility level on actual in procedure call · 0053d729
      Justin Squirek authored
      gcc/ada/
      
      	* exp_ch6.adb (Expand_Call_Helper): Add condition to check for
      	expanded actuals and remove dead code.
      0053d729
    • Piotr Trojanek's avatar
      [Ada] Detect unchecked union subcomponents in nested variant parts · e02f9af5
      Piotr Trojanek authored
      gcc/ada/
      
      	* exp_ch4.adb (Has_Unconstrained_UU_Component): Rewrite to
      	follow the Ada RM grammar.
      e02f9af5
    • Piotr Trojanek's avatar
      [Ada] Refine types of variables with call to Scope as their initial values · c3870f3b
      Piotr Trojanek authored
      gcc/ada/
      
      	* exp_ch4.adb (User_Defined_Primitive_Equality_Op): Refine type
      	of a local variable.
      	* exp_dbug.adb (Scope_Contains): Refine all types from Node_Id
      	to Entity_Id; rename parameters to match those of the
      	Scope_Within routine (which is similar but not the same); also,
      	simplify an OR ELSE into a membership test.
      c3870f3b
    • Piotr Trojanek's avatar
      [Ada] Detect unchecked union components with fully qualified names · 43f69ac8
      Piotr Trojanek authored
      gcc/ada/
      
      	* exp_ch4.adb (Component_Is_Unconstrained_UU): Detect both
      	qualified and unqualified names of unchecked union components.
      43f69ac8
    • Piotr Trojanek's avatar
      [Ada] Remove redundant checks for empty lists · 7faaabcc
      Piotr Trojanek authored
      gcc/ada/
      
      	* exp_ch4.adb (Variant_Is_Unconstrained_UU): Remove redundant
      	check for empty list.
      	* exp_disp.adb (Find_Entry_Index): Simplify by removing
      	redundant check and counting from zero; fix type of a local
      	variable.
      	* sem_ch12.adb (Save_Global_Descendant): Remove an unnecessary
      	special-case for empty lists.
      7faaabcc
    • Piotr Trojanek's avatar
      [Ada] Cleanup a statically true condition in expanded raise statement · a1198973
      Piotr Trojanek authored
      gcc/ada/
      
      	* exp_ch4.adb (Apply_Accessibility_Check): Skip a statically
      	true condition in expanded raise statement.
      a1198973
    • Bob Duff's avatar
      [Ada] Fix s-os_lib.adb so vectorizing compilation works · 67207bd6
      Bob Duff authored
      gcc/ada/
      
      	* libgnat/s-os_lib.adb (Missed_Drive_Letter): Simplify the code.
      67207bd6
    • Ed Schonberg's avatar
      [Ada] Spurious warning on useless assignment with target name · 680b9610
      Ed Schonberg authored
      gcc/ada/
      
      	* sem_ch5.adb (Analyze_Assignment): Do not emit the warning that
      	a previous value of the target object is useless if the
      	right-hand side of the assignment includes target names.
      680b9610
    • Eric Botcazou's avatar
      [Ada] Do not use hash function for enumeration Value with trampolines · 5ebae75f
      Eric Botcazou authored
      gcc/ada/
      
      	* exp_imgv.adb: Add with/use clauses for Targparm.
      	(Build_Enumeration_Image_Tables): Set type of Threshold to Nat and
      	initialize it to Nat'Last if the type is local and the target does
      	not support descriptors.  Adjust Threshold_For_Size similarly.
      	(Expand_Value_Attribute): Minor tweaks.
      5ebae75f
    • Ghjuvan Lacambre's avatar
      [Ada] Move Build_And_Insert_CUDA_Initialization to expansion phase · 8b7b6263
      Ghjuvan Lacambre authored
      gcc/ada/
      
      	* exp_ch7.adb (Expand_N_Package_Body): Add CUDA init call.
      	* sem_ch7.adb (Analyze_Package_Body_Helper): Remove CUDA init
      	call.
      8b7b6263
    • Ghjuvan Lacambre's avatar
      [Ada] Don't emit style errors when parens are required · d2b075f3
      Ghjuvan Lacambre authored
      gcc/ada/
      
      	* par-ch5.adb (P_Condition): Check if expression is declare
      	expression.
      d2b075f3
    • Piotr Trojanek's avatar
      [Ada] Simplify GNATmake by reusing GNAT.Ctrl_C · 5d0e32b0
      Piotr Trojanek authored
      gcc/ada/
      
      	* make.adb (Make): Use GNAT.Ctrl_C.Install_Handler instead of a
      	custom imported procedure.
      5d0e32b0
    • Eric Botcazou's avatar
      [Ada] Small cleanup in the Expand_Image_Attribute procedure · 003241bc
      Eric Botcazou authored
      gcc/ada/
      
      	* exp_imgv.adb (Is_User_Defined_Enumeration_Type): Delete.
      	(Expand_Image_Attribute): Move inline expansion into normal flow of
      	control, move down declarations and remove superfluous processing.
      003241bc
    • Piotr Trojanek's avatar
      [Ada] Qualify internal access-to-subprogram types as not null · 8c9f315a
      Piotr Trojanek authored
      gcc/ada/
      
      	* libgnat/g-alleve.adb (Bit_Operation): Now a not-null type.
      	* libgnat/g-sechas.adb (Fill_Buffer_Access): Likewise.
      	* libgnat/s-dwalin.adb (Callback): Likewise.
      8c9f315a
    • Ghjuvan Lacambre's avatar
      [Ada] Remove commented code · 41b8c207
      Ghjuvan Lacambre authored
      gcc/ada/
      
      	* exp_util.adb (Is_Possibly_Unaligned_Object): Remove commented
      	code.
      41b8c207
    • Ed Schonberg's avatar
      [Ada] Handle defaults in declare_expressions in postconditions · 052a00e8
      Ed Schonberg authored
      gcc/ada/
      
      	* sem_ch3.adb (Find_Type_Of_Object):  When In_Spec_Expression is
      	set and the object declaration generates a subtype indication,
      	build the corresponding subtype declaration and place it in tree
      	without the use of Insert_Actions, which is disabled in this
      	context.
      052a00e8
    • Eric Botcazou's avatar
      [Ada] Use inline expansion of Image for standard boolean by default · 0bfcf0b3
      Eric Botcazou authored
      gcc/ada/
      
      	* debug.adb (d_x): Document extended usage.
      	* exp_imgv.adb (Expand_Standard_Boolean_Image): New procedure.
      	(Expand_Image_Attribute): Call it to expand in line the attribute
      	for standard boolean by default.
      0bfcf0b3
    • Eric Botcazou's avatar
      [Ada] Use inline expansion of Image for enumeration types by default · 15de3bc0
      Eric Botcazou authored
      gcc/ada/
      
      	* debug.adb (d_x): Document new usage.
      	* exp_imgv.adb (Expand_User_Defined_Enumeration_Image): Add Typ
      	parameter and use it throughout the processing.
      	(Expand_Image_Attribute): Retrieve the underlying type of the
      	prefix and use the inline expansion for user-defined enumeration
      	types with a literal string by default.
      15de3bc0
    • Eric Botcazou's avatar
      [Ada] Tweak implementation of System.Double_Real.Split · 3a46d0ed
      Eric Botcazou authored
      gcc/ada/
      
      	* libgnat/s-dorepr.adb (Split): Declare a per-size temporary.
      	Add pragma Annotate.
      3a46d0ed
Loading