1. 24 Jan, 2019 9 commits
    • [nvptx, libgomp] Fix memleak in GOMP_OFFLOAD_fini_device · 738c56d4
      I wrote a test-case:
      ...
      int
      main (void)
      {
        for (unsigned i = 0; i < 128; ++i)
          {
            acc_init (acc_device_nvidia);
            acc_shutdown (acc_device_nvidia);
          }
      
        return 0;
      }
      ...
      and ran it under valgrind.  The only leak location reported with a frequency
      of 128, was the allocation of ptx_devices in nvptx_init.
      
      Fix this by freeing ptx_devices in GOMP_OFFLOAD_fini_device, once
      instantiated_devices drops to 0.
      
      2019-01-24  Tom de Vries  <tdevries@suse.de>
      
      	* plugin/plugin-nvptx.c (GOMP_OFFLOAD_fini_device): Free ptx_devices
      	once instantiated_devices drops to 0.
      
      From-SVN: r268237
      Tom de Vries committed
    • re PR lto/87187 (FAIL: gfortran.dg/short_circuiting_3.f90 -g -flto (internal… · 0e2eb6ab
      re PR lto/87187 (FAIL: gfortran.dg/short_circuiting_3.f90   -g -flto  (internal compiler error) on darwin)
      
      2019-01-24  Richard Biener  <rguenther@suse.de>
      
      	PR lto/87187
      	* tree-streamer-out.c (write_ts_decl_common_tree_pointers):
      	When in "legacy" debug mode make sure to reset self-origins.
      
      From-SVN: r268236
      Richard Biener committed
    • Fix broken filename for .gcda files starting with '..' (PR gcov-profile/88994). · 12502bf2
      2019-01-24  Martin Liska  <mliska@suse.cz>
      
      	PR gcov-profile/88994
      	* gcov-io.c (mangle_path): Do not allocate a bigger buffer,
      	result will be always smaller or equal to the original.
      	* gcov.c (mangle_name): Fix else branch where we should
      	also copy to PTR and shift the pointer.
      
      From-SVN: r268233
      Martin Liska committed
    • re PR fortran/88929 (ICE on building MPICH 3.2 with GCC 9 with ISO_Fortran_binding) · 07fd2247
      2019-01-24  Paul Thomas  <pault@gcc.gnu.org>
      
      	PR fortran/88929
      	* trans-array.c (gfc_conv_descriptor_elem_len): New function.
      	* trans-array.h : Add prototype for above.
      	* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Take account of
      	assumed rank arrays being flagged by rank = -1 in expressions.
      	Intent in arrays need a pointer to a copy of the data to be
      	assigned to the descriptor passed for conversion. This should
      	then be freed, together with the CFI descriptor on return from
      	the C call.
      
      2019-01-24  Paul Thomas  <pault@gcc.gnu.org>
      
      	PR fortran/88929
      	* gfortran.dg/ISO_Fortran_binding_3.f90 : New test
      	* gfortran.dg/ISO_Fortran_binding_3.c : Subsidiary source.
      
      From-SVN: r268232
      Paul Thomas committed
    • re PR fortran/88929 (ICE on building MPICH 3.2 with GCC 9 with ISO_Fortran_binding) · db06a76e
      2019-01-24  Paul Thomas  <pault@gcc.gnu.org>
      
      	PR fortran/88929
      	* trans-array.c (gfc_conv_descriptor_elem_len): New function.
      	* trans-array.h : Add prototype for above.
      	* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Take account of
      	assumed rank arrays being flagged by rank = -1 in expressions.
      	Intent in arrays need a pointer to a copy of the data to be
      	assigned to the descriptor passed for conversion. This should
      	then be freed, together with the CFI descriptor on return from
      	the C call.
      
      2019-01-24  Paul Thomas  <pault@gcc.gnu.org>
      
      	PR fortran/88929
      	* gfortran.dg/ISO_Fortran_binding_3.f90 : New test
      	* gfortran.dg/ISO_Fortran_binding_3.c : Subsidiary source.
      
      From-SVN: r268231
      Paul Thomas committed
    • runtime: install SIGURG handler on C created threads · 52c9cfeb
          
          Precise stack scan uses SIGURG to trigger a stack scan. We need
          to have Go signal handler installed for SIGURG.
          
          Reviewed-on: https://go-review.googlesource.com/c/159097
      
      From-SVN: r268230
      Ian Lance Taylor committed
    • fix comments typo. · eea18a4e
      gcc/ChangeLog
      
      2019-01-24  Xiong Hu Luo  <luoxhu@linux.vnet.ibm.com>
      
      	* tree-ssa-dom.c (test_for_singularity): fix a comment typo.
      	* vr-values.c (find_case_label_ranges): fix a comment typo.
      
      From-SVN: r268229
      Xiong Hu Luo committed
    • fix tab alignment issue. · 275e9ad9
      ChangeLog
      
      	2019-01-24  Xiong Hu Luo  <luoxhu@linux.vnet.ibm.com>
      
      	* ChangeLog: replace space with tab.
      	* MAINTAINERS: delete 1 tab to keep alignment.
      
      From-SVN: r268228
      Xiong Hu Luo committed
    • Daily bump. · a0487095
      From-SVN: r268225
      GCC Administrator committed
  2. 23 Jan, 2019 21 commits
    • re PR target/85711 (ICE in aarch64_classify_address, at config/aarch64/aarch64.c:5678) · 76ca8d0f
      2019-01-23  Bin Cheng  <bin.cheng@arm.com>
      	    Steve Ellcey <sellcey@marvell.com>
      
      	PR target/85711
      	* recog.c (address_operand): Return false on wrong mode for address.
      	(constrain_operands): Check for mode with 'p' constraint.
      
      Co-Authored-By: Steve Ellcey <sellcey@marvell.com>
      
      From-SVN: r268219
      Bin Cheng committed
    • libgcc2.c: Correct DI/TI -> SF/DF conversions · 6395ba73
      FSTYPE FUNC (DWtype u) in libgcc2.c, which converts DI/TI to SF/DF, has
      
        /* No leading bits means u == minimum.  */
        if (count == 0)
          return -(Wtype_MAXp1_F * (Wtype_MAXp1_F / 2));
      
      in the third case (where actually count == 0 only means the high part is
      minimum).  It should be:
      
        /* No leading bits means u == minimum.  */
        if (count == 0)
          return Wtype_MAXp1_F * (FSTYPE) (hi | ((UWtype) u != 0));
      
      instead.
      
      gcc/testsuite/
      
      2019-01-23  H.J. Lu  <hongjiu.lu@intel.com>
      
      	PR libgcc/88931
      	* gcc.dg/torture/fp-int-convert-timode-1.c: New test.
      	* gcc.dg/torture/fp-int-convert-timode-2.c: Likewise.
      	* gcc.dg/torture/fp-int-convert-timode-3.c: Likewise.
      	* gcc.dg/torture/fp-int-convert-timode-4.c: Likewise.
      
      libgcc/
      
      2019-01-23  Joseph Myers  <joseph@codesourcery.com>
      
      	PR libgcc/88931
      	* libgcc2.c (FSTYPE FUNC (DWtype u)): Correct no leading bits
      	case.
      
      From-SVN: r268216
      H.J. Lu committed
    • re PR target/88998 (bad codegen with mmx instructions for unordered_map) · 3274c5a3
      	PR target/88998
      	* config/i386/sse.md (sse2_cvtpi2pd): Add SSE alternatives.
      	Disparage MMX alternative.
      	(sse2_cvtpd2pi): Ditto.
      	(sse2_cvttpd2pi): Ditto.
      
      testsuite/ChangeLog:
      
      	PR target/88998
      	* g++.target/i386/pr88998.c: New test.
      
      From-SVN: r268195
      Uros Bizjak committed
    • PR c++/88757 - qualified name treated wrongly as type. · 4aab0828
      	* parser.c (cp_parser_direct_declarator): don't treat qualified-ids
      	in parameter-list as types if name lookup for declarator-id didn't
      	find one or more function templates.
      
      	* g++.dg/cpp0x/dependent2.c: new test.
      	* g++.dg/cpp2a/typename10.c: remove dg-error.
      	* g++.dg/cpp2a/typename12.c: new test.
      	* g++.dg/template/static30.c: remove dg-error.
      
      From-SVN: r268192
      Marek Polacek committed
    • aarch64: fix use-after-free in -march=native (PR driver/89014) · 6770fa53
      Running:
        $ valgrind ./xgcc -B. -c test.c -march=native
      on aarch64 shows a use-after-free in host_detect_local_cpu due
      to the std::string result of aarch64_get_extension_string_for_isa_flags
      only living until immediately after a c_str call.
      
      This leads to corrupt "-march=" values being passed to cc1.
      
      This patch fixes the use-after-free, though it appears to also need
      Tamar's patch here:
        https://gcc.gnu.org/ml/gcc-patches/2018-12/msg01302.html
      in order to generate valid values for cc1.  This may have worked by
      accident in the past, if the corrupt "-march=" value happened to be
      0-terminated in the "right" place; with this patch it now appears
      to reliably break without Tamar's patch.
      
      gcc/ChangeLog:
      	PR driver/89014
      	* config/aarch64/driver-aarch64.c (host_detect_local_cpu): Fix
      	use-after-free of the result of
      	aarch64_get_extension_string_for_isa_flags.
      
      From-SVN: r268189
      David Malcolm committed
    • re PR c/44715 (Break in increment expression of "for" statement inconsistent with g++) · 372e6e6b
      	PR c/44715
      	* cp-gimplify.c (genericize_cp_loop): Call begin_bc_block only
      	after genericizing cond and incr expressions.
      
      	* doc/extend.texi: Document break and continue behavior in
      	statement expressions.
      
      	* c-c++-common/pr44715.c: New test.
      
      From-SVN: r268188
      Jakub Jelinek committed
    • re PR c++/88984 (ICE in genericize_switch_stmt, at cp/cp-gimplify.c:377) · d0f2db23
      	PR c++/88984
      	* cp-gimplify.c (genericize_switch_stmt): Move cond genericization
      	before the begin_bc_block call.
      
      	* c-c++-common/pr88984.c: New test.
      
      From-SVN: r268187
      Jakub Jelinek committed
    • re PR middle-end/89008 (O2 and O1 results differ for simple test) · ef192ae1
      2019-01-23  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/89008
      	* tree-ssa-reassoc.c (eliminate_using_constants): For * 0 do
      	not leave another stray operand.
      
      	* gcc.dg/torture/pr89008.c: New testcase.
      
      From-SVN: r268186
      Richard Biener committed
    • PR c++/87893 - constexpr ctor ICE on ARM. · 4d0c18c6
      	PR c++/88293 - ICE with comma expression.
      	* constexpr.c (initialized_type): Don't shortcut non-void type.
      	Handle COMPOUND_EXPR.
      	(cxx_eval_outermost_constant_expr): Return early for void type.
      
      From-SVN: r268185
      Jason Merrill committed
    • * BASE-VER: Bump to 9.0.1. · 561fd081
      From-SVN: r268184
      Jakub Jelinek committed
    • re PR sanitizer/89010 (Update URLs in libsanitizer/README.gcc) · a795cd3d
      	PR sanitizer/89010
      	* libsanitizer/README.gcc: Update to current https URLs.
      
      From-SVN: r268183
      Jonny Grant committed
    • cgraphunit.c (cgraph_node::expand_thunk): When expanding a GIMPLE thunk that… · 39791fb6
      cgraphunit.c (cgraph_node::expand_thunk): When expanding a GIMPLE thunk that returns by reference...
      
      	* cgraphunit.c (cgraph_node::expand_thunk): When expanding a GIMPLE
      	thunk that returns by reference, use the type of the return object
      	of the thunk instead of that of the alias to build the dereference.
      
      From-SVN: r268182
      Eric Botcazou committed
    • [ARC] atomics: Add operand to DMB instruction · b3e5901b
      Atomics use DMB instruction to enforce ordering of loads/stores.
      Currently gcc generates DMB w/o any arg which is a no-op. Fix that by
      generating DMB 3 which enforces R+W ordering. It is stricter than what
      acq/rel expect, but there's no other way.
      
      gcc/
      
      2019-xx-xx  Vineet Gupta <vgupta@synopsys.com>
      
             * config/arc/atomic.md: Add operand to DMB instruction
      
      From-SVN: r268181
      Vineet Gupta committed
    • [libbacktrace] Use size_t for low_offset/high_offset fields of struct unit · 3f5d2012
      2019-01-23  Tom de Vries  <tdevries@suse.de>
      
      	* dwarf.c (struct unit): Use size_t for low_offset/high_offset fields.
      	(units_search, find_unit): Use size_t for offset.
      	(build_address_map): Use size_t for unit_offset.
      
      From-SVN: r268180
      Tom de Vries committed
    • re PR tree-optimization/88964 (ICE in wide_int_to_tree_1, at tree.c:1561) · 37aa6856
      	PR tree-optimization/88964
      	* gimple-loop-interchange.cc (loop_cand::analyze_induction_var): Use
      	build_zero_cst instead of build_int_cst.  Return false for loop
      	invariants which honor signed zeros.
      
      	* gfortran.dg/pr88964.f90: New test.
      
      From-SVN: r268179
      Jakub Jelinek committed
    • [nvptx, libgomp] Fix cuMemAlloc with size zero · 4a75460b
      Consider test-case:
      ...
      int
      main (void)
      {
        #pragma acc parallel async
        ;
        #pragma acc parallel async
        ;
        #pragma acc wait
      
        return 0;
      }
      ...
      
      This fails with:
      ...
      libgomp: cuMemAlloc error: invalid argument
      Segmentation fault (core dumped)
      ...
      The cuMemAlloc error is due to the fact that we're try to allocate 0 bytes.
      
      Fix this by preventing calling map_push with size zero argument in nvptx_exec.
      
      This also has the consequence that for the abort-1.c test-case, we end up
      calling cuMemFree during map_fini for the struct cuda_map allocated in
      map_init, which fails because an abort happened.  Fix this by calling
      cuMemFree with CUDA_CALL_NOCHECK in cuda_map_destroy.
      
      2019-01-23  Tom de Vries  <tdevries@suse.de>
      
      	PR target/PR88946
      	* plugin/plugin-nvptx.c (cuda_map_destroy): Use CUDA_CALL_NOCHECK for
      	cuMemFree.
      	(nvptx_exec): Don't call map_push if mapnum == 0.
      	* testsuite/libgomp.oacc-c-c++-common/pr88946.c: New test.
      
      From-SVN: r268178
      Tom de Vries committed
    • [nvptx, libgomp] Fix assert (!s->map->active) in map_fini · 4fef8e4d
      There are currently two situations where this assert triggers:
      ...
      libgomp/plugin/plugin-nvptx.c: map_fini: Assertion `!s->map->active' failed.
      ...
      
      First, in abort-1.c, a parallel region triggering an abort:
      ...
      int
      main (void)
      {
        #pragma acc parallel
        abort ();
      
        return 0;
      }
      ...
      
      The abort is detected in nvptx_exec as the CUDA_ERROR_ILLEGAL_INSTRUCTION
      return status of the cuStreamSynchronize call after kernel launch, which is
      then handled by calling non-returning function GOMP_PLUGIN_fatal.
      Consequently, the map_pop in nvptx_exec that in case of cuStreamSynchronize
      success would remove or inactive the element added by the map_push earlier in
      nvptx_exec, does not trigger.  With the element no longer active, but still
      marked active and a member of s->map,  we run into the assert during
      GOMP_OFFLOAD_fini_device, which is triggered from atexit handler
      gomp_target_fini (which is triggered by the GOMP_PLUGIN_fatal mentioned above
      calling exit).
      
      Second, in pr88941.c, an async parallel region without wait:
      ...
      int
      main (void)
      {
        #pragma acc parallel async
        ;
      
        /* no #pragma acc wait */
        return 0;
      }
      ...
      
      Because nvptx_exec is handling an async region, it does not call map_pop for
      the element added by map_push, but schedules an kernel execution completion
      event to call map_pop.  Again, we run into the assert during
      GOMP_OFFLOAD_fini_device, which is triggered from atexit handler
      gomp_target_fini, but the exit in this case is triggered by returning from main.
      So either the kernel is still running, or the kernel has completed but the
      corresponding event that is supposed to call map_pop is stuck in the event
      queue, waiting for an event_gc.
      
      Fix this by removing the assert, and skipping the freeing of device memory if
      the map is still marked active (though in the async case, this is more a
      workaround than an fix).
      
      2019-01-23  Tom de Vries  <tdevries@suse.de>
      
      	PR target/88941
      	PR target/88939
      	* plugin/plugin-nvptx.c (cuda_map_destroy): Handle map->active case.
      	(map_fini): Remove "assert (!s->map->active)".
      	* testsuite/libgomp.oacc-c-c++-common/pr88941.c: New test.
      
      From-SVN: r268177
      Tom de Vries committed
    • [nvptx, libgomp] Fix map_push · 2ee6cb22
      The map field of a struct ptx_stream is a FIFO.  The FIFO is implemented as a
      single linked list, with pop-from-the-front semantics.
      
      The function map_pop pops an element, either by:
      - deallocating the element, if there is more than one element
      - or marking the element inactive, if there's only one element
      
      The responsibility of map_push is to push an element to the back, as well as
      selecting the element to push, by:
      - allocating an element, or
      - reusing the element at the front if inactive and big enough, or
      - dropping the element at the front if inactive and not big enough, and
        allocating one that's big enough
      
      The current implemention gets at least the first and most basic scenario wrong:
      
      > map = cuda_map_create (size);
      
      We create an element, and assign it to map.
      
      > for (t = s->map; t->next != NULL; t = t->next)
      >   ;
      
      We determine the last element in the fifo.
      
      > t->next = map;
      
      We append the new element.
      
      > s->map = map;
      
      But here, we throw away the rest of the FIFO, and declare the FIFO to be just
      the new element.
      
      This problem causes the test-case asyncwait-1.c to fail intermittently on some
      systems.  The pr87835.c test-case added here is a a minimized and modified
      version of asyncwait-1.c (avoiding the kernel construct) that is more likely to
      fail.
      
      Fix this by rewriting map_pop more robustly, by:
      - seperating the function in two phases: select element, push element
      - when reusing or dropping an element, making sure that the element is cleanly
        popped from the queue
      - rewriting the push element part in such a way that it can handle all cases
        without needing if statements, such that each line is exercised for each of
        the three cases.
      
      2019-01-23  Tom de Vries  <tdevries@suse.de>
      
      	PR target/87835
      	* plugin/plugin-nvptx.c (map_push): Fix adding of allocated element.
      	* testsuite/libgomp.oacc-c-c++-common/pr87835.c: New test.
      
      From-SVN: r268176
      Tom de Vries committed
    • Warray-bounds-2.c: Include headers only if they exist. · c262f6b7
      gcc/testsuite/ChangeLog:
      
      	* c-c++-common/Warray-bounds-2.c: Include headers only if they exist.
      	* c-c++-common/Warray-bounds-3.c: Make xfails conditional on target
      	non_strict_align.
      	* c-c++-common/Wrestrict-2.c: Include headers only if they exist.
      	* c-c++-common/Wrestrict.c: Make xfails conditional on target
      	non_strict_align.
      
      From-SVN: r268175
      Martin Sebor committed
    • Daily bump. · e6c26d64
      From-SVN: r268174
      GCC Administrator committed
  3. 22 Jan, 2019 10 commits