[PATCH] configure: Require C++11 for building code generation tools

2020-08-20 Thread Vasee Vinayagamoorthy
Hello,

After commit [1] ("Redefine NULL to nullptr"), building gcc
fails when $CXX_FOR_BUILD is not using C++11 mode by default.
This happens with gcc-4.8 which is still supported.

This patch fixes this by adding -std=c++11 or its equivalent
to $CXX_FOR_BUILD using AX_CXX_COMPILE_STDCXX(11).

Tested by successful cross native build for aarch64-none-linux-gnu target.

OK for trunk?


ChangeLog:

2020-08-20  Ilya Leoshkevich  
    Vasee Vinayagamoorthy  

PR target/95700
* configure: Regenerate.
* configure.ac: Require C++11 for building code generation tools.

Regards
Vasee Vinayagamoorthy


PS: I do not have commit rights, therefore could I request
someone to commit it on my behalf if this patch is approved.
Thanks in advance.

[1] 
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=d59a576b8b5e12c3a56f0262912090e2921f5daa
diff --git a/configure b/configure
index a0c5aca9e8d..1023dc72fd4 100755
--- a/configure
+++ b/configure
@@ -6523,6 +6523,1011 @@ $as_echo "#define HAVE_CXX11 1" >>confdefs.h
 
 fi
 
+# Also require C++11 for building code generation tools.
+# Do nothing if "${build}" = "${host}", because in this case
+# CXX_FOR_BUILD="\$(CXX)", and $CXX is already set to the correct value above.
+if test "${build}" != "${host}"; then
+  saved_CXX=$CXX
+  saved_CXXCPP=$CXXCPP
+  CXX=$CXX_FOR_BUILD
+  CXXCPP=
+ax_cxx_compile_alternatives="11 0x"ax_cxx_compile_cxx11_required=true
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+  ac_success=no
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5
+$as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; }
+if ${ax_cv_cxx_compile_cxx11+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+
+// If the compiler admits that it is not ready for C++11, why torture it?
+// Hopefully, this will speed up the test.
+
+#ifndef __cplusplus
+
+#error "This is not a C++ compiler"
+
+#elif __cplusplus < 201103L
+
+#error "This is not a C++11 compiler"
+
+#else
+
+namespace cxx11
+{
+
+  namespace test_static_assert
+  {
+
+template 
+struct check
+{
+  static_assert(sizeof(int) <= sizeof(T), "not big enough");
+};
+
+  }
+
+  namespace test_final_override
+  {
+
+struct Base
+{
+  virtual ~Base() {}
+  virtual void f() {}
+};
+
+struct Derived : public Base
+{
+  virtual ~Derived() override {}
+  virtual void f() override {}
+};
+
+  }
+
+  namespace test_double_right_angle_brackets
+  {
+
+template < typename T >
+struct check {};
+
+typedef check single_type;
+typedef check> double_type;
+typedef check>> triple_type;
+typedef check>>> quadruple_type;
+
+  }
+
+  namespace test_decltype
+  {
+
+int
+f()
+{
+  int a = 1;
+  decltype(a) b = 2;
+  return a + b;
+}
+
+  }
+
+  namespace test_type_deduction
+  {
+
+template < typename T1, typename T2 >
+struct is_same
+{
+  static const bool value = false;
+};
+
+template < typename T >
+struct is_same
+{
+  static const bool value = true;
+};
+
+template < typename T1, typename T2 >
+auto
+add(T1 a1, T2 a2) -> decltype(a1 + a2)
+{
+  return a1 + a2;
+}
+
+int
+test(const int c, volatile int v)
+{
+  static_assert(is_same::value == true, "");
+  static_assert(is_same::value == false, "");
+  static_assert(is_same::value == false, "");
+  auto ac = c;
+  auto av = v;
+  auto sumi = ac + av + 'x';
+  auto sumf = ac + av + 1.0;
+  static_assert(is_same::value == true, "");
+  static_assert(is_same::value == true, "");
+  static_assert(is_same::value == true, "");
+  static_assert(is_same::value == false, "");
+  static_assert(is_same::value == true, "");
+  return (sumf > 0.0) ? sumi : add(c, v);
+}
+
+  }
+
+  namespace test_noexcept
+  {
+
+int f() { return 0; }
+int g() noexcept { return 0; }
+
+static_assert(noexcept(f()) == false, "");
+static_assert(noexcept(g()) == true, "");
+
+  }
+
+  namespace test_constexpr
+  {
+
+template < typename CharT >
+unsigned long constexpr
+strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
+{
+  return *s ? strlen_

Review request summary

2020-03-13 Thread Vasee Vinayagamoorthy
Hello,

The commit [1], as referenced below, which added a new test case,
contains a typo in the dg-final directive, which eventually causes
the gcc.log file to not be produced. This patch fixes the typo.

Tested by running regressions for aarch64-none-elf.

OK for trunk?




gcc/testsuite/ChangeLog:

2020-03-11  Vasee Vinayagamoorthy  

* gcc.target/aarch64/advsimd-intrinsics/bfcvt-nosimd.c: Fix DejaGnu 
typo.


Regards
Vasee Vinayagamoorthy

PS: I do not have commit rights, therefore could I request
someone to commit it on my behalf if this patch is approved.
Thanks in advance.

[1] 
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=1f520d3412962e22b0338461d82f41abba8a4f12
diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/bfcvt-nosimd.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/bfcvt-nosimd.c
index c2631a541ea..05c305840b6 100644
--- a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/bfcvt-nosimd.c
+++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/bfcvt-nosimd.c
@@ -1,7 +1,7 @@
 /* { dg-do assemble { target { aarch64*-*-* } } } */
 /* { dg-require-effective-target aarch64_asm_bf16_ok } */
 /* { dg-additional-options "-save-temps -march=armv8.2-a+bf16+nosimd" } */
-/* { dg-final { check-function-bodies "**" "" "-O[^0]" } } */
+/* { dg-final { check-function-bodies "**" "" {-O[^0]} } } */
 
 #include 
 


Re: [GCC][PATCH][AArch64] ACLE intrinsics for BFCVTN, BFCVTN2 (AArch64 AdvSIMD) and BFCVT (AArch64 FP)

2020-03-10 Thread Vasee Vinayagamoorthy
Hi,

I think this commit causes a failure on aarch64-none-elf due to a DejaGnu
typo in gcc.target/aarch64/advsimd-intrinsics/bfcvt-nosimd.c.

{ dg-final { check-function-bodies "**" "" "-O[^0]" } }

I think the square brackets need to be escaped or use {-O[^0]}.

Regards
Vasee

Fri, Mar 06, 2020 at 09:54:07AM +, Richard Sandiford wrote:
> Delia Burduv  writes:
> > Hi,
> >
> > Here is the latest version of the  patch. That test should now work.
> 
> Thanks, pushed.
> 
> Richard