-mno-long-calls for mve_libcall tests

2020-12-24 Thread Alexandre Oliva


The implicit -mlong-calls used in our vxworks configurations changes
the call sequences from those expected in the mve_libcall testcases.

This patch brings the test output in line with the expectations, with
an explicit -mno-long-calls.

Regstrapped on x86_64-linux-gnu, also tested on arm-vxworks7r2.
Ok to install?


for  gcc/testsuite/ChangeLog

* gcc.target/arm/mve/intrinsics/mve_libcall1.c: Pass an
explicit -mno-long-calls.
* gcc.target/arm/mve/intrinsics/mve_libcall2.c: Likewise.
---
 .../gcc.target/arm/mve/intrinsics/mve_libcall1.c   |2 +-
 .../gcc.target/arm/mve/intrinsics/mve_libcall2.c   |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_libcall1.c 
b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_libcall1.c
index 4fd422c6afe6a..222007f7ee21d 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_libcall1.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_libcall1.c
@@ -1,6 +1,6 @@
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} 
} */
-/* { dg-additional-options "-march=armv8.1-m.main+mve -mfloat-abi=hard -mthumb 
-mfpu=auto --save-temps" } */
+/* { dg-additional-options "-march=armv8.1-m.main+mve -mfloat-abi=hard -mthumb 
-mfpu=auto -mno-long-calls --save-temps" } */
 
 float
 foo (float a, float b, float c)
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_libcall2.c 
b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_libcall2.c
index 3fd1329d384a9..42047a33fdfaa 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_libcall2.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_libcall2.c
@@ -1,6 +1,6 @@
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} 
} */
-/* { dg-additional-options "-march=armv8.1-m.main+mve -mfloat-abi=hard -mthumb 
-mfpu=auto --save-temps" } */
+/* { dg-additional-options "-march=armv8.1-m.main+mve -mfloat-abi=hard -mthumb 
-mfpu=auto -mno-long-calls --save-temps" } */
 
 double
 foo (double a, double b, double c)

-- 
Alexandre Oliva, happy hacker  https://FSFLA.org/blogs/lxo/
   Free Software Activist GNU Toolchain Engineer
Vim, Vi, Voltei pro Emacs -- GNUlius Caesar


-mno-long-calls for arm/no_unique_address tests

2020-12-24 Thread Alexandre Oliva


The implicit -mlong-calls from our vxworks configurations makes the
tail-call instructions differ from those expected by the
no_unique_address tests in gcc.target/arm.

This patch adds -mno-long-calls to the compilation commands, so that
we generate the expected sequences.

Regstrapped on x86_64-linux-gnu, also tested on arm-vxworks7r2.
Ok to install?


for  gcc/testsuite/ChangeLog

* gcc.target/arm/no_unique_address_1.C: Add -mno-long-calls.
* gcc.target/arm/no_unique_address_2.C: Likewise.
---
 gcc/testsuite/g++.target/arm/no_unique_address_1.C |2 +-
 gcc/testsuite/g++.target/arm/no_unique_address_2.C |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/g++.target/arm/no_unique_address_1.C 
b/gcc/testsuite/g++.target/arm/no_unique_address_1.C
index 038aa00a499e9..40fc68b374521 100644
--- a/gcc/testsuite/g++.target/arm/no_unique_address_1.C
+++ b/gcc/testsuite/g++.target/arm/no_unique_address_1.C
@@ -1,5 +1,5 @@
 /* { dg-require-effective-target arm_arch_v8a_hard_ok } */
-/* { dg-options "-std=c++11 -O -foptimize-sibling-calls" } */
+/* { dg-options "-std=c++11 -O -foptimize-sibling-calls -mno-long-calls" } */
 /* { dg-add-options arm_arch_v8a_hard } */
 /* { dg-final { check-function-bodies "**" "" "" } } */
 
diff --git a/gcc/testsuite/g++.target/arm/no_unique_address_2.C 
b/gcc/testsuite/g++.target/arm/no_unique_address_2.C
index 8be5de2539a38..b66b4d004965b 100644
--- a/gcc/testsuite/g++.target/arm/no_unique_address_2.C
+++ b/gcc/testsuite/g++.target/arm/no_unique_address_2.C
@@ -1,5 +1,5 @@
 /* { dg-require-effective-target arm_arch_v8a_hard_ok } */
-/* { dg-options "-std=c++17 -O -foptimize-sibling-calls" } */
+/* { dg-options "-std=c++17 -O -foptimize-sibling-calls -mno-long-calls" } */
 /* { dg-add-options arm_arch_v8a_hard } */
 /* { dg-final { check-function-bodies "**" "" "" } } */
 

-- 
Alexandre Oliva, happy hacker  https://FSFLA.org/blogs/lxo/
   Free Software Activist GNU Toolchain Engineer
Vim, Vi, Voltei pro Emacs -- GNUlius Caesar


-mno-long-calls for arm/headmerge tests

2020-12-24 Thread Alexandre Oliva


The headmerge tests pass a constant to conditional calls, so that the
same constant is always passed to a function, though it's a different
function depending on which path is taken.

The test checks that the constant appears only once in the assembly
output, as a means to verify that the insns setting up the argument
are unified: they appear as separate insns up to jump2, where
crossjump identifies a common prefix to all conditional paths and
unifies them.

Alas, with -mlong-calls, that we enable in our arm-vxworks
configurations, the argument register is loaded after loading the
callee address into another register.  Since each path calls a
different function, there's no common initial code sequence for
crossjump to unify, and the argument register set up remains separate,
so the test fails.

Though it would surely be desirable for the compiler to perform the
unification of the argument register setting up, this patch merely
avoids the effects of -mlong-calls, with an explicit -mno-long-calls.

Regstrapped on x86_64-linux-gnu, also tested on arm-vxworks7r2.
Ok to install?


for  gcc/testsuite/ChangeLog

* gcc.target/arm/headmerge-1.c: Add -mno-long-calls.
* gcc.target/arm/headmerge-2.c: Likewise.
---
 gcc/testsuite/gcc.target/arm/headmerge-1.c |2 +-
 gcc/testsuite/gcc.target/arm/headmerge-2.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.target/arm/headmerge-1.c 
b/gcc/testsuite/gcc.target/arm/headmerge-1.c
index 218c6a21ebd27..319ccd254626d 100644
--- a/gcc/testsuite/gcc.target/arm/headmerge-1.c
+++ b/gcc/testsuite/gcc.target/arm/headmerge-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile }  */
-/* { dg-options "-O2" }  */
+/* { dg-options "-O2 -mno-long-calls" }  */
 /* { dg-final { scan-assembler-times "#120" 1 } } */
 
 extern void foo1 (int);
diff --git a/gcc/testsuite/gcc.target/arm/headmerge-2.c 
b/gcc/testsuite/gcc.target/arm/headmerge-2.c
index 17d8e9365c52e..a015eb0f56905 100644
--- a/gcc/testsuite/gcc.target/arm/headmerge-2.c
+++ b/gcc/testsuite/gcc.target/arm/headmerge-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile }  */
-/* { dg-options "-O2" }  */
+/* { dg-options "-O2 -mno-long-calls" }  */
 /* { dg-final { scan-assembler-times "120\n" 1 } } */
 
 extern void foo1 (int);

-- 
Alexandre Oliva, happy hacker  https://FSFLA.org/blogs/lxo/
   Free Software Activist GNU Toolchain Engineer
Vim, Vi, Voltei pro Emacs -- GNUlius Caesar


-mno-long-calls for expected regalloc in arm/fp16-aapcs-2.c test

2020-12-24 Thread Alexandre Oliva


The implicit -mlong-calls used in our arm-vxworks configurations
changes the register allocation patterns in the arm/fp16-aapcs-2.c
test: r3 ends up used in the long-call sequence, and we end up using
ip as a temporary, which doesn't match the expected mov patterns.

This patch adds an explicit -mno-long-calls for the generated code to
match the expectation.

Regstrapped on x86_64-linux-gnu, also tested on arm-vxworks7r2.
Ok to install?


for  gcc/testsuite/ChangeLog

* gcc.target/arm/fp16-aapcs-2.c: Use -mno-long-calls.
---
 gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c 
b/gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c
index 51a76fc069353..c34387f57828d 100644
--- a/gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c
+++ b/gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c
@@ -1,6 +1,6 @@
 /* { dg-do compile }  */
 /* { dg-require-effective-target arm_fp16_ok } */
-/* { dg-options "-mfloat-abi=softfp -O2" }  */
+/* { dg-options "-mfloat-abi=softfp -O2 -mno-long-calls" }  */
 /* { dg-add-options arm_fp16_ieee } */
 /* { dg-skip-if "incompatible float-abi" { arm*-*-* } { "-mfloat-abi=hard" } } 
*/
 

-- 
Alexandre Oliva, happy hacker  https://FSFLA.org/blogs/lxo/
   Free Software Activist GNU Toolchain Engineer
Vim, Vi, Voltei pro Emacs -- GNUlius Caesar


use sigjmp_buf for analyzer sigsetjmp tests

2020-12-24 Thread Alexandre Oliva


The sigsetjmp analyzer tests use jmp_buf in sigsetjmp and siglongjmp
calls.  Not every system that supports sigsetjmp uses the same data
structure for setjmp and sigsetjmp, which results in type mismatches.

This patch changes the tests to use sigjmp_buf, that is the
POSIX-specific type for use with sigsetjmp and siglongjmp.

Regstrapped on x86_64-linux-gnu, also tested on arm-vxworks7r2.
Ok to install?


for  gcc/testsuite/ChnageLog

* gcc.dg/analyzer/sigsetjmp-5.c: Use sigjmp_buf.
* gcc.dg/analyzer/sigsetjmp-6.c: Likewise.
---
 gcc/testsuite/gcc.dg/analyzer/sigsetjmp-5.c |2 +-
 gcc/testsuite/gcc.dg/analyzer/sigsetjmp-6.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/analyzer/sigsetjmp-5.c 
b/gcc/testsuite/gcc.dg/analyzer/sigsetjmp-5.c
index d6a9910478ce4..494b81352a395 100644
--- a/gcc/testsuite/gcc.dg/analyzer/sigsetjmp-5.c
+++ b/gcc/testsuite/gcc.dg/analyzer/sigsetjmp-5.c
@@ -4,7 +4,7 @@
 #include 
 #include "analyzer-decls.h"
 
-static jmp_buf env;
+static sigjmp_buf env;
 
 static void inner (void)
 {
diff --git a/gcc/testsuite/gcc.dg/analyzer/sigsetjmp-6.c 
b/gcc/testsuite/gcc.dg/analyzer/sigsetjmp-6.c
index f89277efc4847..f5507a3618926 100644
--- a/gcc/testsuite/gcc.dg/analyzer/sigsetjmp-6.c
+++ b/gcc/testsuite/gcc.dg/analyzer/sigsetjmp-6.c
@@ -6,7 +6,7 @@
 
 extern int foo (int) __attribute__ ((__pure__));
 
-static jmp_buf env;
+static sigjmp_buf env;
 
 static void inner (void)
 {


-- 
Alexandre Oliva, happy hacker  https://FSFLA.org/blogs/lxo/
   Free Software Activist GNU Toolchain Engineer
Vim, Vi, Voltei pro Emacs -- GNUlius Caesar


declare getpass in analyzer/sensitive-1.c test

2020-12-24 Thread Alexandre Oliva


The getpass function is not available on all systems; and not
necessarily declared in unistd.h, as expected by the sensitive-1
analyzer test.

Since this is a compile-only test, it doesn't really matter if the
function is defined in the system libraries.  All we need is a
declaration, to avoid warnings from calling an undeclared function.
This patch adds the declaration, in a way that is most unlikely to
conflict with any existing declaration.

Regstrapped on x86_64-linux-gnu, also tested on arm-vxworks7r2.
Ok to install?


for  gcc/testsuite/ChangeLog

* gcc.dg/analyzer/sensitive-1.c: Declare getpass.
---
 gcc/testsuite/gcc.dg/analyzer/sensitive-1.c |5 +
 1 file changed, 5 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c 
b/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
index 81144af620edf..c66af9276174f 100644
--- a/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
+++ b/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
@@ -6,6 +6,11 @@
 
 #include 
 
+/* Declare getpass, in case unistd doesn't declare it.
+   Parenthesize it, in case it's a macro.
+   Don't use a prototype, to avoid const mismatches.  */
+extern char *(getpass) ();
+
 char test_1 (FILE *logfile)
 {
   char *password = getpass (">"); /* { dg-message "\\(1\\) sensitive value 
acquired here" } */

-- 
Alexandre Oliva, happy hacker  https://FSFLA.org/blogs/lxo/
   Free Software Activist GNU Toolchain Engineer
Vim, Vi, Voltei pro Emacs -- GNUlius Caesar


[pushed] Darwin : Adjust handling of MACOSX_DEPLOYMENT_TARGET for macOS 11.

2020-12-24 Thread Iain Sandoe


(resending, this never seemed to make it to patches@)

The shift to macOS version 11 also means that '11' without any
following '.x' is accepted as a valid version number.  This adjusts
the validation code to accept this and map it to 11.0.0 which
matches what the clang toolchain appears to do.

tested on x86_64-darwin20, x86_64-darwin16
pushed to master
thanks
Iain

gcc/ChangeLog:

* config/darwin-driver.c (validate_macosx_version_min): Allow
MACOSX_DEPLOYMENT_TARGET=11.
(darwin_default_min_version): Adjust warning spelling to avoid
an apostrophe.
---
 gcc/config/darwin-driver.c | 23 ---
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/gcc/config/darwin-driver.c b/gcc/config/darwin-driver.c
index 4a9426ef273..c5ad44191aa 100644
--- a/gcc/config/darwin-driver.c
+++ b/gcc/config/darwin-driver.c
@@ -43,13 +43,13 @@ static const char *
 validate_macosx_version_min (const char *version_str)
 {
   size_t version_len;
-  unsigned long major, minor, tiny = 0;
+  unsigned long major, minor = 0, tiny = 0;
   char *end;
   const char *old_version = version_str;
   bool need_rewrite = false;
 
   version_len = strlen (version_str);
-  if (version_len < 4) /* The minimum would be 10.x  */
+  if (version_len < 2) /* The minimum would be 11  */
 return NULL;
 
   /* Version string must consist of digits and periods only.  */
@@ -63,18 +63,27 @@ validate_macosx_version_min (const char *version_str)
 need_rewrite = true;
 
   major = strtoul (version_str, , 10);
-  version_str = end + ((*end == '.') ? 1 : 0);
 
   if (major < 10 || major > 11 ) /* MacOS 10 and 11 are known. */
 return NULL;
 
-  /* Version string components must be present and numeric.  */
-  if (!ISDIGIT (version_str[0]))
+  /* Skip a separating period, if there's one.  */
+  version_str = end + ((*end == '.') ? 1 : 0);
+
+  if (major == 11 && *end != '\0' && !ISDIGIT (version_str[0]))
+ /* For MacOS 11, we allow just the major number, but if the minor is
+   there it must be numeric.  */
+return NULL;
+  else if (major == 11 && *end == '\0')
+/* We will rewrite 11 =>  11.0.0.  */
+need_rewrite = true;
+  else if (major == 10 && (*end == '\0' || !ISDIGIT (version_str[0])))
+/* Otherwise, minor version components must be present and numeric.  */
 return NULL;
 
   /* If we have one or more leading zeros on a component, then rewrite the
  version string.  */
-  if (version_str[0] == '0' && version_str[1] != '\0'
+  if (*end != '\0' && version_str[0] == '0' && version_str[1] != '\0'
   && version_str[1] != '.')
 need_rewrite = true;
 
@@ -220,7 +229,7 @@ darwin_default_min_version (void)
   const char *checked = validate_macosx_version_min (new_flag);
   if (checked == NULL)
{
- warning (0, "couldn%'t understand version %s", new_flag);
+ warning (0, "could not understand version %s", new_flag);
  return NULL;
}
   new_flag = xstrndup (checked, strlen (checked));
-- 
2.24.1




Re: Patch RFA: Support non-ASCII file names in git-changelog

2020-12-24 Thread Joel Brobecker
> > I have no idea who that is (if it is a single user at all,
> > if it isn't any user with git write permissions).
> 
> CCing Joel, he should help us how to set a git config
> that will be used by the server hooks.

I am not sure that requiring both the server and the user to agree
on a non-default configuration value would be a practical idea.

>From what I understand of the problem, I think the proper fix
is really to adapt the git-changelog script to avoid the need
for any assumption about the user's configuration. In particular,
how does the script get the list of files? Poking around, it looks like
you guys are using the GitPython module, which I'm not familiar with,
unfortunately.  But as a reference point, the git-hooks simply use
the -z option to get the information in raw format, and thus avoids
the problem of filename quoting entirely. Does GitPython support
something similar? For instance, browing the GitPython documentation,
I found attributes a_raw_path and b_raw_path. Could that be the
solution (instead of using a_path and b_path?

Either way, the solution will be independent of the git-hooks,
as I don't think they are actually involved, here.

-- 
Joel


Re: [PATCH] Fix ICE in warn_dealloc_offset

2020-12-24 Thread Martin Liška

On 12/23/20 6:18 PM, Martin Sebor wrote:

Thanks for looking into it!  I'm actually just testing the very same
fix.  It's taken me a while to come up with a non-LTO test case but
below is what I've got.


All right. You were faster, anyway thank you for the fix.

Martin