[Bug bootstrap/93074] [10 regression] build FAIL with --enable-offload-targets=nvptx-none

2019-12-25 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93074

--- Comment #1 from Andrew Pinski  ---
According to
https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__DEVICE.html

cuDeviceGetName exists.
Maybe F31 has an older version of Cuda installed.

[Bug bootstrap/93074] New: [10 regression] build FAIL with --enable-offload-targets=nvptx-none

2019-12-25 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93074

Bug ID: 93074
   Summary: [10 regression] build FAIL with
--enable-offload-targets=nvptx-none
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r279700 PASS
r279735 FAIL

Fedora 31 x86_64

configure --disable-multilib --enable-offload-targets=nvptx-none

make
[...]
libtool: compile:  /home/dimhen/build/gcc_current/./gcc/xgcc
-B/home/dimhen/build/gcc_current/./gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/
-B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem
/usr/local/x86_64-pc-linux-gnu/include -isystem
/usr/local/x86_64-pc-linux-gnu/sys-include -fno-checking -DHAVE_CONFIG_H -I.
-I/home/dimhen/src/gcc_current/libgomp
-I/home/dimhen/src/gcc_current/libgomp/config/linux/x86
-I/home/dimhen/src/gcc_current/libgomp/config/linux
-I/home/dimhen/src/gcc_current/libgomp/config/posix
-I/home/dimhen/src/gcc_current/libgomp
-I/home/dimhen/src/gcc_current/libgomp/../include
-I/home/dimhen/src/gcc_current/libgomp/plugin/cuda -Wall -Werror
-ftls-model=initial-exec -pthread -DUSING_INITIAL_EXEC_TLS -g -O2 -MT
libgomp_plugin_nvptx_la-plugin-nvptx.lo -MD -MP -MF
.deps/libgomp_plugin_nvptx_la-plugin-nvptx.Tpo -c
/home/dimhen/src/gcc_current/libgomp/plugin/plugin-nvptx.c  -fPIC -DPIC -o
.libs/libgomp_plugin_nvptx_la-plugin-nvptx.o
/home/dimhen/src/gcc_current/libgomp/plugin/cuda-lib.def:11:16: error:
‘cuDeviceGetName’ undeclared here (not in a function); did you mean
‘cuDeviceGet’?
   11 | CUDA_ONE_CALL (cuDeviceGetName)

[Bug libgomp/93065] libgomp: destructor missing to delete goacc_cleanup_key

2019-12-25 Thread v.narang at samsung dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93065

--- Comment #1 from Vaneet Narang  ---
Bugfix patch shared:
https://gcc.gnu.org/ml/gcc-bugs/2019-12/msg02132.html

[Bug target/93073] New: ICE in extract_insn, at recog.c:2294 (error: unrecognizable insn)

2019-12-25 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93073

Bug ID: 93073
   Summary: ICE in extract_insn, at recog.c:2294 (error:
unrecognizable insn)
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: asolokha at gmx dot com
  Target Milestone: ---
Target: powerpc-*-linux-gnu

gcc-10.0.0-alpha20191222 snapshot (r279712), 8.2, 6.3 all ICE when compiling
the following testcase w/ -mvsx -O1 -ffinite-math-only -fno-trapping-math:

void
hi (void);

void
bv (long double o1, double sl, double ru)
{
  for (;;)
{
  double xx;

  xx = o1 == 0.0 ? sl : ru;
  if (xx == 0.0)
hi ();
}
}

% powerpc-e300c3-linux-gnu-gcc-10.0.0-alpha20191222 -mvsx -O1
-ffinite-math-only -fno-trapping-math -c six5p5jr.c
six5p5jr.c: In function 'bv':
six5p5jr.c:15:1: error: unrecognizable insn:
   15 | }
  | ^
(insn 9 8 10 2 (set (reg:TF 123)
(minus:TF (reg/v:TF 118 [ o1 ])
(reg:TF 122))) -1
 (nil))
during RTL pass: vregs
six5p5jr.c:15:1: internal compiler error: in extract_insn, at recog.c:2294
0x66ce5c _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/rtl-error.c:108
0x66ce7c _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/rtl-error.c:116
0x66b09d extract_insn(rtx_insn*)
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/recog.c:2294
0xad7323 instantiate_virtual_regs_in_insn
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/function.c:1607
0xad7323 instantiate_virtual_regs
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/function.c:1977
0xad7323 execute
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/function.c:2026

[Bug target/63805] ICE: in extract_insn, at recog.c:2327 with -mcpu=power8

2019-12-25 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63805

Arseny Solokha  changed:

   What|Removed |Added

 CC||asolokha at gmx dot com

--- Comment #16 from Arseny Solokha  ---
I cannot reproduce the ICE w/ any of the testcases posted here, using gcc 8.2
and the current trunk (10.0).

[Bug rtl-optimization/85674] ICE insn_min_length, at config/rs6000/rs6000.md:6661

2019-12-25 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85674

Arseny Solokha  changed:

   What|Removed |Added

  Known to work||10.0
  Known to fail||8.2.0, 9.0

--- Comment #1 from Arseny Solokha  ---
I cannot reproduce it w/ the current trunk.

[PATCH 1/1] libgomp: Add destructor to delete runtime env keys

2019-12-25 Thread Ayush Mittal
[BUG: 93065] libgomp: destructor missing to delete goacc_cleanup_key
libgomp constructor creates goacc_cleanup_key on dlopen but doesn't delete key 
on dlclose. 
dlopen and dlclose of libgomp.so exhausts pthread keys, which results in 
pthread_key_create failure.

pthread_key_delete needs to be called by libgomp destructor.

Signed-off-by: Ayush Mittal 
Signed-off-by: Vaneet Narang 
---
 libgomp/env.c   |  5 -
 libgomp/oacc-init.c | 10 ++
 libgomp/oacc-int.h  |  1 +
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/libgomp/env.c b/libgomp/env.c
index ac05c3b..be35e5e 100644
--- a/libgomp/env.c
+++ b/libgomp/env.c
@@ -1303,7 +1303,10 @@ initialize_env (void)
   goacc_runtime_initialize ();
 }
 
-
+static void __attribute__((destructor)) env_destroy(){
+   goacc_runtime_deinitialize();
+}
+
 /* The public OpenMP API routines that access these variables.  */
 
 void
diff --git a/libgomp/oacc-init.c b/libgomp/oacc-init.c
index 42d005d..9bd0c1a 100644
--- a/libgomp/oacc-init.c
+++ b/libgomp/oacc-init.c
@@ -658,6 +658,16 @@ goacc_runtime_initialize (void)
   goacc_host_init ();
 }
 
+attribute_hidden void 
+goacc_runtime_deinitialize() {
+
+#if !(defined HAVE_TLS || defined USE_EMUTLS)
+  pthread_key_delete (goacc_tls_key);
+#endif
+  pthread_key_delete(goacc_cleanup_key);
+
+}
+
 /* Compiler helper functions */
 
 attribute_hidden void
diff --git a/libgomp/oacc-int.h b/libgomp/oacc-int.h
index db0a937..732847a 100644
--- a/libgomp/oacc-int.h
+++ b/libgomp/oacc-int.h
@@ -94,6 +94,7 @@ goacc_thread (void)
 void goacc_register (struct gomp_device_descr *) __GOACC_NOTHROW;
 void goacc_attach_host_thread_to_device (int);
 void goacc_runtime_initialize (void);
+void goacc_runtime_deinitialize (void);
 void goacc_save_and_set_bind (acc_device_t);
 void goacc_restore_bind (void);
 void goacc_lazy_initialize (void);
-- 
1.9.1



[Bug rtl-optimization/91865] Combine misses opportunity to remove (sign_extend (zero_extend)) before searching for insn patterns

2019-12-25 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91865

Segher Boessenkool  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |segher at gcc dot 
gnu.org

--- Comment #4 from Segher Boessenkool  ---
Created attachment 47550
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47550=edit
simplify-rtx patch for extends of AND of hard reg

So I did a patch to make this work (in simplify-rtx) also for hard registers
(see attachment).

But, we should not have this problem at all if make_more_copies would have
done its job.  It turns out that msp430 does not do register copies for the
arguments, but zero_extends instead.  Let me see how we can handle that
easily.

[Bug c/93072] [8/9/10 Regression] ICE: gimplifier segfault with undefined nested function

2019-12-25 Thread amonakov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93072

Alexander Monakov  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-12-25
 CC||amonakov at gcc dot gnu.org
Summary|ICE: Segmentation fault |[8/9/10 Regression] ICE:
   ||gimplifier segfault with
   ||undefined nested function
 Ever confirmed|0   |1

--- Comment #1 from Alexander Monakov  ---
ICEs since gcc-7; gcc-6 just diagnosed a nested function with no body as
invalid.

[Bug c/93072] New: ICE: Segmentation fault

2019-12-25 Thread anbu1024.me at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93072

Bug ID: 93072
   Summary: ICE: Segmentation fault
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 


void foo ( void ) { } 

static void bar ( void ) 
{ 
inline void foo ( void ) ; 

if ( foo == 0 ) ; 
} 



$ gcc-snapshot10 --version
gcc (GCC) 10.0.0 20191201 (experimental)
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



$ gcc-snapshot10 test.c 
test.c: In function ‘bar’:
test.c:5:13: internal compiler error: Segmentation fault
5 | static void bar ( void )
  | ^~~
0xd5be5f crash_signal
../../gcc-10-20191201/gcc/toplev.c:328
0xab2547 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
../../gcc-10-20191201/gcc/tree.h:3386
0xab2547 unshare_body
../../gcc-10-20191201/gcc/gimplify.c:955
0xab25e9 unshare_body
../../gcc-10-20191201/gcc/gimplify.c:962
0xad76c2 gimplify_body(tree_node*, bool)
../../gcc-10-20191201/gcc/gimplify.c:14601
0xad7b33 gimplify_function_tree(tree_node*)
../../gcc-10-20191201/gcc/gimplify.c:14757
0x923eb7 cgraph_node::analyze()
../../gcc-10-20191201/gcc/cgraphunit.c:669
0x9268ef analyze_functions
../../gcc-10-20191201/gcc/cgraphunit.c:1212
0x9274a2 symbol_table::finalize_compilation_unit()
../../gcc-10-20191201/gcc/cgraphunit.c:2925
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug tree-optimization/90004] [graphite] ICE: Segmentation fault (in scop_get_dependences(scop*))

2019-12-25 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90004

--- Comment #4 from Arseny Solokha  ---
(In reply to Arseny Solokha from comment #3)
> I cannot reproduce the first ICE w/ the current gcc trunk snapshot and isl
> 0.22 anymore.

I've finally managed to get the initial backtrace w/ isl 0.22.

subroutine ww (xk, ha, ku, bh)
  real :: ha, xk(5,0:12,0:12,0:12)
  integer :: f9, i5, c1, ku, bh

  do i5 = 1, bh
 do f9 = 1, ku
xk(0,f9,i5,0) = 0.0
xk(3,f9,i5,0) = ha
 enddo
  enddo
end subroutine ww

% powerpc-e300c3-linux-gnu-gfortran-10.0.0-alpha20191222 -O1
-floop-parallelize-all -fno-aggressive-loop-optimizations -w -c hwdwngqs.f90
during GIMPLE pass: graphite
hwdwngqs.f90:1:0:

1 | subroutine ww (xk, ha, ku, bh)
  | 
internal compiler error: Segmentation fault
0xe7c536 crash_signal
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/toplev.c:328
0x165638b scop_get_dependences(scop*)
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/graphite-dependences.c:316
0x1653957 translate_isl_ast_to_gimple::scop_to_isl_ast(scop*)
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/graphite-isl-ast-to-gimple.c:1399
0x1655282 graphite_regenerate_ast_isl(scop*)
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/graphite-isl-ast-to-gimple.c:1479
0x1650b6d graphite_transform_loops()
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/graphite.c:471
0x1651160 graphite_transforms
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/graphite.c:537
0x1651160 execute
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/graphite.c:614