Re: [patch] Fix LRA/reload issue with -fnon-call-exceptions

2019-04-06 Thread Eric Botcazou
> I have backported it onto the 8 branch, where it fixes the failure (timeout)
> of gnat.dg/opt73.adb for PowerPC/Linux, after testing it on this platform.

And now onto the 7 branch, after testing on x86-64/Linux and PowerPC/Linux.

-- 
Eric Botcazou


Re: [PATCH] Add target-zlib to top-level configure, use zlib from libphobos

2019-04-06 Thread Iain Buclaw
On Sat, 6 Apr 2019 at 17:27, Matthias Klose  wrote:
>
> On 29.03.19 23:23, Iain Buclaw wrote:
> > On Mon, 18 Feb 2019 at 14:26, Matthias Klose  wrote:
> >>
> >>
> >> sorry, I didn't mean to propose to rename the option, so
> >> --with-target-system-zlib=auto sounds fine.
> >
> > OK, a bit belated, but here it is --with-target-system-zlib=auto.
>
> yes, this does the job.
>

Good.  I added documentation to install.texi.

-- 
Iain
---
ChangeLog:

2019-04-06  Iain Buclaw  

* configure.ac: Add target-zlib to target_libraries.
* configure: Regenerate.

gcc/ChangeLog:

2019-04-06  Iain Buclaw  

* doc/install.texi: Document --with-target-system-zlib.

libphobos/ChangeLog:

2019-04-06  Iain Buclaw  

* m4/druntime/libraries.m4 (DRUNTIME_LIBRARIES_ZLIB): Use
libz_convenience.a if not using system zlib.
* Makefile.in: Regenerate.
* configure: Regenerate.
* libdruntime/Makefile.in: Regenerate.
* src/Makefile.am: Remove ZLIB_CSOURCES and AM_CFLAGS.
* src/Makefile.in: Regenerate.
* testsuite/Makefile.in: Regenerate.

---
diff --git a/configure b/configure
index adf4fda0f69..1c5f9b502a8 100755
--- a/configure
+++ b/configure
@@ -2813,7 +2813,8 @@ target_libraries="target-libgcc \
 		target-libobjc \
 		target-libada \
 		target-libgo \
-		target-libphobos"
+		target-libphobos \
+		target-zlib"
 
 # these tools are built using the target libraries, and are intended to
 # run only in the target environment
diff --git a/configure.ac b/configure.ac
index 87f2aee0500..cffccd37805 100644
--- a/configure.ac
+++ b/configure.ac
@@ -163,7 +163,8 @@ target_libraries="target-libgcc \
 		target-libobjc \
 		target-libada \
 		target-libgo \
-		target-libphobos"
+		target-libphobos \
+		target-zlib"
 
 # these tools are built using the target libraries, and are intended to
 # run only in the target environment
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 8d7bee5f89b..3e749240dfe 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -2344,6 +2344,18 @@ If none of these options are specified, the library is assumed in
 default locations.
 @end table
 
+@subheading D-Specific Options
+
+The following options apply to the build of the D runtime library.
+
+@table @code
+@item --with-target-system-zlib
+Use installed @samp{zlib} rather than that included with GCC@.  This needs
+to be available for each multilib variant, unless configured with
+@option{--with-target-system-zlib=@samp{auto}} in which case the GCC@ included
+@samp{zlib} is used when the system installed library is not available.
+@end table
+
 @html
 
 
diff --git a/libphobos/Makefile.in b/libphobos/Makefile.in
index e7c156aa5eb..1cd4117f2ee 100644
--- a/libphobos/Makefile.in
+++ b/libphobos/Makefile.in
@@ -241,6 +241,7 @@ LIBBACKTRACE = @LIBBACKTRACE@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIBZ = @LIBZ@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
diff --git a/libphobos/configure b/libphobos/configure
index d86934b59a5..906d472c039 100755
--- a/libphobos/configure
+++ b/libphobos/configure
@@ -640,8 +640,7 @@ gdc_include_dir
 libphobos_toolexeclibdir
 libphobos_toolexecdir
 gcc_version
-DRUNTIME_ZLIB_SYSTEM_FALSE
-DRUNTIME_ZLIB_SYSTEM_TRUE
+LIBZ
 BACKTRACE_SUPPORTS_THREADS
 BACKTRACE_USES_MALLOC
 BACKTRACE_SUPPORTED
@@ -1484,7 +1483,7 @@ Optional Packages:
   --without-libatomic Do not use libatomic in core.atomic (default: auto)
   --without-libbacktrace  Do not use libbacktrace in core.runtime (default:
   auto)
-  --with-target-system-zlib
+  --with-target-system-zlib={yes,no,auto}
   use installed libz (default: no)
   --with-cross-host=HOST  configuring with a cross compiler
 
@@ -11499,7 +11498,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11502 "configure"
+#line 11501 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11605,7 +11604,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11608 "configure"
+#line 11607 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -14864,79 +14863,94 @@ $as_echo "$druntime_cv_lib_sockets" >&6; }
   LIBS="$LIBS $druntime_cv_lib_sockets"
 
 
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+  LIBZ=""
+
 
 # Check whether --with-target-system-zlib was given.
 if test "${with_target_system_zlib+set}" = set; then :
   withval=$with_target_system_zlib;
+else
+  with_target_system_zlib=no
 fi
 
 
-  system_zlib=false
-  if test "x$with_target_system_zlib" = "xyes"; then :
+  case "$with_target_system_zlib" in
+yes|no|auto) ;;
+*) as_fn_error $? "Invalid argument for 

Re: *ping* [patch, fortran] Fix PR 87352, far too many deallocations

2019-04-06 Thread Steve Kargl
On Sat, Apr 06, 2019 at 04:49:55PM +0200, Thomas Koenig wrote:
> Am 31.03.19 um 18:16 schrieb Thomas Koenig:
> > Am 31.03.19 um 18:10 schrieb Thomas Koenig:
> >> Hello world,
> >>
> >> the attached patch
> > 
> > Now really attached.
> > 
> 
> Ping?

OK.

-- 
Steve


[SVE ACLE] Fix for PR88839

2019-04-06 Thread Prathamesh Kulkarni
Hi,
I committed attached patch, which fixes PR88839 to sve-acle-branch
after approval from Richard Sandiford offline.

Thanks,
Prathamesh
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index ec60e972f5f..f8d5270b982 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -16632,6 +16632,50 @@ aarch64_evpc_sve_tbl (struct expand_vec_perm_d *d)
   return true;
 }
 
+/* Try to implement D using SVE SEL instruction.  */
+
+static bool
+aarch64_evpc_sel (struct expand_vec_perm_d *d)
+{
+  machine_mode vmode = d->vmode;
+  int nunits = GET_MODE_UNIT_SIZE (vmode);
+
+  if (d->vec_flags != VEC_SVE_DATA
+  || nunits > 8)
+return false;
+
+  int n_patterns = d->perm.encoding ().npatterns ();
+  poly_int64 vec_len = d->perm.length ();
+
+  for (int i = 0; i < n_patterns; ++i)
+if (!known_eq (d->perm[i], i)
+	&& !known_eq (d->perm[i], vec_len + i))
+  return false;
+
+  for (int i = n_patterns; i < n_patterns * 2; i++)
+if (!d->perm.series_p (i, n_patterns, i, n_patterns)
+	&& !d->perm.series_p (i, n_patterns, vec_len + i, n_patterns))
+  return false;
+
+  if (d->testing_p)
+return true;
+
+  machine_mode pred_mode = aarch64_sve_pred_mode (nunits).require ();
+
+  rtx_vector_builder builder (pred_mode, n_patterns, 2);
+  for (int i = 0; i < n_patterns * 2; i++)
+{
+  rtx elem = known_eq (d->perm[i], i) ? CONST1_RTX (BImode)
+	  : CONST0_RTX (BImode);
+  builder.quick_push (elem);
+}
+
+  rtx const_vec = builder.build ();
+  rtx pred = force_reg (pred_mode, const_vec);
+  emit_insn (gen_vcond_mask (vmode, vmode, d->target, d->op1, d->op0, pred));
+  return true;
+}
+
 static bool
 aarch64_expand_vec_perm_const_1 (struct expand_vec_perm_d *d)
 {
@@ -16664,6 +16708,8 @@ aarch64_expand_vec_perm_const_1 (struct expand_vec_perm_d *d)
 	return true;
   else if (aarch64_evpc_trn (d))
 	return true;
+  else if (aarch64_evpc_sel (d))
+	return true;
   if (d->vec_flags == VEC_SVE_DATA)
 	return aarch64_evpc_sve_tbl (d);
   else if (d->vec_flags == VEC_ADVSIMD)
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/sel_1.c b/gcc/testsuite/gcc.target/aarch64/sve/sel_1.c
new file mode 100644
index 000..e651e5b93b6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/sel_1.c
@@ -0,0 +1,27 @@
+/* { dg-do assemble { target aarch64_asm_sve_ok } } */
+/* { dg-options "-O2 -msve-vector-bits=256 --save-temps" } */
+
+#include 
+
+typedef int8_t vnx16qi __attribute__((vector_size (32)));
+
+/* Predicate vector: 1 0 1 0 ... */
+
+#define MASK_32		{ 0, 33, 2, 35, 4, 37, 6, 39, 8, 41,			\
+			  10, 43, 12, 45, 14, 47, 16, 49, 18, 51, 		\
+			  20, 53, 22, 55, 24, 57, 26, 59, 28, 61, 30, 63 }
+
+#define INDEX_32 vnx16qi
+
+#define PERMUTE(type, nunits)		\
+type permute_##type (type x, type y)	\
+{	\
+  return __builtin_shuffle (x, y, (INDEX_##nunits) MASK_##nunits);	\
+}
+
+PERMUTE(vnx16qi, 32)
+
+/* { dg-final { scan-assembler-not {\ttbl\t} } } */
+
+/* { dg-final { scan-assembler-times {\tsel\tz[0-9]+\.b, p[0-9]+, z[0-9]+\.b, z[0-9]+\.b\n} 1 } } */
+/* { dg-final { scan-assembler-times {\tptrue\tp[0-9]+\.h, vl16\n} 1 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/sel_2.c b/gcc/testsuite/gcc.target/aarch64/sve/sel_2.c
new file mode 100644
index 000..05391474a92
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/sel_2.c
@@ -0,0 +1,41 @@
+/* { dg-do assemble { target aarch64_asm_sve_ok } } */
+/* { dg-options "-O2 -msve-vector-bits=256 --save-temps" } */
+
+#include 
+
+typedef int8_t vnx16qi __attribute__((vector_size (32)));
+typedef int16_t vnx8hi __attribute__((vector_size (32)));
+typedef int32_t vnx4si __attribute__((vector_size (32)));
+
+typedef _Float16 vnx8hf __attribute__((vector_size (32)));
+typedef float vnx4sf __attribute__((vector_size (32)));
+
+/* Predicate vector: 1 0 0 0 ... */
+
+#define MASK_32		{ 0, 33, 34, 35, 4, 37, 38, 39, 8, 41, 42, 43, 12,		\
+			  45, 46, 47, 16, 49, 50, 51, 20, 53, 54, 55, 24,		\
+			  57, 58, 59, 28, 61, 62, 63 } 
+
+/* Predicate vector: 1 0 1 0 ... */
+
+#define MASK_16		{0, 17, 2, 19, 4, 21, 6, 23, 8, 25, 10, 27, 12, 29, 14, 31}
+
+#define INDEX_32 vnx16qi
+#define INDEX_16 vnx8hi
+
+#define PERMUTE(type, nunits)		\
+type permute_##type (type x, type y)	\
+{	\
+  return __builtin_shuffle (x, y, (INDEX_##nunits) MASK_##nunits);	\
+}
+
+PERMUTE(vnx16qi, 32)
+PERMUTE(vnx8hi, 16)
+PERMUTE(vnx8hf, 16)
+
+/* { dg-final { scan-assembler-not {\ttbl\t} } } */
+
+/* { dg-final { scan-assembler-times {\tsel\tz[0-9]+\.b, p[0-9]+, z[0-9]+\.b, z[0-9]+\.b\n} 1 } } */
+/* { dg-final { scan-assembler-times {\tsel\tz[0-9]+\.h, p[0-9]+, z[0-9]+\.h, z[0-9]+\.h\n} 2 } } */
+
+/* { dg-final { scan-assembler-times {\tptrue\tp[0-9]+\.s, vl8\n} 3 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/sel_3.c b/gcc/testsuite/gcc.target/aarch64/sve/sel_3.c
new file mode 100644
index 000..a87492d9df1
--- /dev/null
+++ 

Re: [PATCH] Add target-zlib to top-level configure, use zlib from libphobos

2019-04-06 Thread Matthias Klose
On 29.03.19 23:23, Iain Buclaw wrote:
> On Mon, 18 Feb 2019 at 14:26, Matthias Klose  wrote:
>>
>>
>> sorry, I didn't mean to propose to rename the option, so
>> --with-target-system-zlib=auto sounds fine.
> 
> OK, a bit belated, but here it is --with-target-system-zlib=auto.

yes, this does the job.



*ping* [patch, fortran] Fix PR 87352, far too many deallocations

2019-04-06 Thread Thomas Koenig

Am 31.03.19 um 18:16 schrieb Thomas Koenig:

Am 31.03.19 um 18:10 schrieb Thomas Koenig:

Hello world,

the attached patch


Now really attached.



Ping?



[ patch, fortran, committed] Fix PR 89981, rejects valid

2019-04-06 Thread Thomas Koenig

Hello world,

I have attached the patch below as obvious and simple (it is a
one-liner). The problem was a latent bug exposed by my recent
commit for PR 78865, where the check for subroutine entries
was done on the main symbol instead of the entry.  Provision
for doing this for the entry master were already in place,
I simply added the condition for the entry itself.

I will wait a week or so before committing to gcc-8, the only
other affected branch.

Regards

Thomas

2019-04-06  Thomas Koenig  

PR fortran/89981
* resolve.c (resolve_global_procedure): If the global symbol is an
ENTRY, also look up its name among the entries.

2019-04-06  Thomas Koenig  

PR fortran/89981
* gfortran.dg/entry_22.f90: New test.
Index: resolve.c
===
--- resolve.c	(Revision 269895)
+++ resolve.c	(Arbeitskopie)
@@ -2546,7 +2546,7 @@ resolve_global_procedure (gfc_symbol *sym, locus *
 	  if (gsym->binding_label && gsym->sym_name != def_sym->name)
 	gfc_find_symbol (gsym->sym_name, gsym->ns, 0, _sym);
 
-	  if (def_sym->attr.entry_master)
+	  if (def_sym->attr.entry_master || def_sym->attr.entry)
 	{
 	  gfc_entry_list *entry;
 	  for (entry = gsym->ns->entries; entry; entry = entry->next)
! { dg-do compile }
! { dg-additional-options "-pedantic" }
! PR fortran/89981 - this used to give a wrong warning (error with
! -pedantic)
program main
  call bar(i)
  call baz(i) ! { dg-error "Type mismatch in argument" }
end program main
subroutine foo(r)
  entry bar(i)
  entry baz(r)
end subroutine foo


Re: [PATCH] Fix PR83033

2019-04-06 Thread Richard Earnshaw (lists)
On 06/04/2019 00:00, Richard Earnshaw (lists) wrote:
> On 05/04/2019 16:53, Andrea Corallo wrote:
>>
>> Richard Earnshaw (lists) writes:
>>
>>> On 29/03/2019 11:01, Andrea Corallo wrote:
 Hi all,
 simple patch addressing minor style issue into 
 gcc/config/aarch64/cortex-a57-fma-steering.c.

 make BOOT_CFLAGS='-mcpu=cortex-a57' bootstrap

 Okay for trunk?

 Bests
   Andrea


 2019-03-29  Andrea Corallo  

PR target/83033
* config/aarch64/cortex-a57-fma-steering.c
(fma_forest): Fix missing copy constructor.
(fma_root_node): Likewise.
(func_fma_steering): Likewise.

>>>
>>> These should be commented, even if it's as simple as "Prohibit copy
>>> construction."
>>>
>>> R.
>>
>>>

>>
>> Hi Richard,
>> here we go.
>>
> 
> Really?  I don't see any change since the last version... :-(
> 

Ah, you've just changed the ChangeLog entries.  By comments, I meant in
the source code, so that it's clear these don't exist.  ChangeLog update
is good too.

R.

> R.
> 
>> Bests
>>   Andrea
>>
>> 2019-03-29  Andrea Corallo  
>>
>>  PR target/83033
>>  * config/aarch64/cortex-a57-fma-steering.c
>>  (fma_forest): Prohibit copy construction.
>>  (fma_root_node): Prohibit copy construction.
>>  (func_fma_steering): Prohibit copy construction.
>>
>