[committed] Fix failure of c-c++-common/analyzer/stdarg-pr111289-int.c on hpux

2024-03-28 Thread John David Anglin
Fixes conflicting declarations of mode_t.

Tested on hppa-unknown-linux-gnu and hppa64-hp-hpux11.11.
Committed to trunk.

Dave
---

Fix failure of c-c++-common/analyzer/stdarg-pr111289-int.c on hpux

2024-03-28  John David Anglin  

gcc/testsuite/ChangeLog:

PR analyzer/111289
* c-c++-common/analyzer/stdarg-pr111289-int.c: Don't include
.

diff --git a/gcc/testsuite/c-c++-common/analyzer/stdarg-pr111289-int.c 
b/gcc/testsuite/c-c++-common/analyzer/stdarg-pr111289-int.c
index 33d83169c3e..8faa58c9480 100644
--- a/gcc/testsuite/c-c++-common/analyzer/stdarg-pr111289-int.c
+++ b/gcc/testsuite/c-c++-common/analyzer/stdarg-pr111289-int.c
@@ -1,6 +1,5 @@
 #include 
 #include 
-#include 
 
 typedef unsigned int mode_t;
 


signature.asc
Description: PGP signature


[committed] hppa: Fix LO_SUM DLTIND14R address support in PRINT_OPERAND_ADDRESS

2024-03-23 Thread John David Anglin
Tested on hppa-unknown-linux-gnu and hppa64-hp-hpux11.11.  Committed
to trunk.

Dave
---

hppa: Fix LO_SUM DLTIND14R address support in PRINT_OPERAND_ADDRESS 

This bug was hidden since LO_SUM DLTIND14R addresses are normally
handled by the A constraint in the move patterns.

2024-03-23  John David Anglin  

gcc/ChangeLog:

* config/pa/pa.cc (pa_output_global_address): Handle
UNSPEC_DLTIND14R addresses.
* config/pa/pa.h (PRINT_OPERAND_ADDRESS): Output "RT'" for
UNSPEC_DLTIND14R address.

diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc
index d7666103de8..f9b1906efb4 100644
--- a/gcc/config/pa/pa.cc
+++ b/gcc/config/pa/pa.cc
@@ -5784,7 +5784,12 @@ pa_output_global_address (FILE *file, rtx x, int 
round_constant)
   if (GET_CODE (x) == HIGH)
 x = XEXP (x, 0);
 
-  if (GET_CODE (x) == SYMBOL_REF && read_only_operand (x, VOIDmode))
+  if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_DLTIND14R)
+{
+  x = XVECEXP (x, 0, 0);
+  output_addr_const (file, x);
+}
+  else if (GET_CODE (x) == SYMBOL_REF && read_only_operand (x, VOIDmode))
 output_addr_const (file, x);
   else if (GET_CODE (x) == SYMBOL_REF && !flag_pic)
 {
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 403f16c5cb5..127a0d1966d 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -1247,12 +1247,15 @@ do {
 \
   reg_names [REGNO (XEXP (addr, 0))]); \
   break;   \
 case LO_SUM:   \
-  if (!symbolic_operand (XEXP (addr, 1), VOIDmode))
\
+  if (GET_CODE (XEXP (addr, 1)) == UNSPEC  \
+ && XINT (XEXP (addr, 1), 1) == UNSPEC_DLTIND14R)  \
+   fputs ("RT'", FILE);\
+  else if (!symbolic_operand (XEXP (addr, 1), VOIDmode))   \
fputs ("R'", FILE); \
   else if (flag_pic == 0)  \
fputs ("RR'", FILE);\
   else \
-   fputs ("RT'", FILE);\
+   gcc_unreachable (); \
   pa_output_global_address (FILE, XEXP (addr, 1), 0);  \
   fputs ("(", FILE);   \
   output_operand (XEXP (addr, 0), 0);  \


signature.asc
Description: PGP signature


[committed] hppa: Improve handling of REG+D addresses when generating PA 2.0 code

2024-03-17 Thread John David Anglin
Tested on hppa-unknown-linux-gnu.  Committed to trunk.

Dave
---

hppa: Improve handling of REG+D addresses when generating PA 2.0 code

In looking at PR 112415, it became clear that improvements could be
made in the handling of loads and stores using REG+D addresses.  A
change in 2002 conflated two issues:

1) We can't generate insns with 14-bit displacements before reload
completes when generating PA 1.x code since floating-point loads and
stores only support 5-bit offsets in PA 1.x.

2) The GNU ELF 32-bit linker lacks relocation support for PA 2.0
floating point instructions with 14-bit displacements.  These
relocations affect instructions with symbolic references.

The result of the change was to block creation of PA 2.0 instructions
with 14-bit REG_D displacements for SImode, DImode, SFmode and DFmode
on the GNU linux target before reload.  This was unnecessary as these
instructions don't need relocation.

This change revise the INT14_OK_STRICT define to allow creation
of instructions with 14-bit REG+D addresses before reload when
generating PA 2.0 code.

2024-03-17  John David Anglin  

gcc/ChangeLog:

PR rtl-optimization/112415
* config/pa/pa.cc (pa_emit_move_sequence): Revise condition
for symbolic memory operands.
(pa_legitimate_address_p): Revise LO_SUM condition.
* config/pa/pa.h (INT14_OK_STRICT): Revise define.  Move
comment about GNU linker to predicates.md.
* config/pa/predicates.md (floating_point_store_memory_operand):
Revise condition for symbolic memory operands.  Update
comment.

diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc
index 129289f8e62..d7666103de8 100644
--- a/gcc/config/pa/pa.cc
+++ b/gcc/config/pa/pa.cc
@@ -2039,7 +2039,8 @@ pa_emit_move_sequence (rtx *operands, machine_mode mode, 
rtx scratch_reg)
  op1 = replace_equiv_address (op1, scratch_reg);
}
}
-  else if ((!INT14_OK_STRICT && symbolic_memory_operand (op1, VOIDmode))
+  else if (((TARGET_ELF32 || !TARGET_PA_20)
+   && symbolic_memory_operand (op1, VOIDmode))
   || IS_LO_SUM_DLT_ADDR_P (XEXP (op1, 0))
   || IS_INDEX_ADDR_P (XEXP (op1, 0)))
{
@@ -2088,7 +2089,8 @@ pa_emit_move_sequence (rtx *operands, machine_mode mode, 
rtx scratch_reg)
  op0 = replace_equiv_address (op0, scratch_reg);
}
}
-  else if ((!INT14_OK_STRICT && symbolic_memory_operand (op0, VOIDmode))
+  else if (((TARGET_ELF32 || !TARGET_PA_20)
+   && symbolic_memory_operand (op0, VOIDmode))
   || IS_LO_SUM_DLT_ADDR_P (XEXP (op0, 0))
   || IS_INDEX_ADDR_P (XEXP (op0, 0)))
{
@@ -11032,18 +11040,22 @@ pa_legitimate_address_p (machine_mode mode, rtx x, 
bool strict, code_helper)
  && (strict ? STRICT_REG_OK_FOR_BASE_P (y)
 : REG_OK_FOR_BASE_P (y)))
{
+ y = XEXP (x, 1);
+
  /* Needed for -fPIC */
  if (mode == Pmode
- && GET_CODE (XEXP (x, 1)) == UNSPEC)
+ && GET_CODE (y) == UNSPEC)
return true;
 
- if (!INT14_OK_STRICT
- && (strict || !(reload_in_progress || reload_completed))
+ /* Before reload, we need support for 14-bit floating
+point loads and stores, and associated relocations.  */
+ if ((TARGET_ELF32 || !INT14_OK_STRICT)
+ && !reload_completed
  && mode != QImode
  && mode != HImode)
return false;
 
- if (CONSTANT_P (XEXP (x, 1)))
+ if (CONSTANT_P (y))
return true;
}
   return false;
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 7abaeae269e..403f16c5cb5 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -828,19 +828,8 @@ extern int may_call_alloca;
 
 /* Nonzero if 14-bit offsets can be used for all loads and stores.
This is not possible when generating PA 1.x code as floating point
-   accesses only support 5-bit offsets.  Note that we do not forbid
-   the use of 14-bit offsets prior to reload.  Instead, we use secondary
-   reloads to fix REG+D memory addresses for floating-point accesses.
-
-   FIXME: the GNU ELF linker clobbers the LSB of the FP register number
-   in PA 2.0 floating-point insns with long displacements.  This is
-   because R_PARISC_DPREL14WR and other relocations like it are not
-   yet supported by GNU ld.  For now, we reject long displacements
-   on this target.  */
-
-#define INT14_OK_STRICT \
-  (TARGET_SOFT_FLOAT   \
-   || (TARGET_PA_20 && !TARGET_ELF32 && !TARGET_ELF64))
+   accesses only support 5-bit offsets.  */
+#define INT14_OK_STRICT (TARGET_SOFT_FLOAT || TARGET_PA_20)
 
 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
and check its validity for a

[committed] hppa: Fix complaint about non-delegitimized UNSPEC UNSPEC_TP

2024-03-17 Thread John David Anglin
Tested on hppa-unknown-linux-gnu.  Committed to trunk.

Dave
---

hppa: Fix complaint about non-delegitimized UNSPEC UNSPEC_TP

2024-03-17  John David Anglin  

gcc/ChangeLog:

* config/pa/pa.cc (pa_delegitimize_address): Delegitimize UNSPEC_TP.

diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc
index 129289f8e62..d7666103de8 100644
--- a/gcc/config/pa/pa.cc
+++ b/gcc/config/pa/pa.cc
@@ -10707,7 +10709,13 @@ pa_trampoline_adjust_address (rtx addr)
 static rtx
 pa_delegitimize_address (rtx orig_x)
 {
-  rtx x = delegitimize_mem_from_attrs (orig_x);
+  rtx x;
+
+  if (GET_CODE (orig_x) == UNSPEC
+  && XINT (orig_x, 1) == UNSPEC_TP)
+orig_x = XVECEXP (orig_x, 0, 0);
+
+  x = delegitimize_mem_from_attrs (orig_x);
 
   if (GET_CODE (x) == LO_SUM
   && GET_CODE (XEXP (x, 1)) == UNSPEC


signature.asc
Description: PGP signature


[committed] hppa: Fix REG+D address support before reload

2024-03-14 Thread John David Anglin
Tested on hppa-unknown-linux-gnu.  Committed to trunk.

Dave
---

hppa: Fix REG+D address support before reload

When generating PA 1.x code or code for GNU ld, floating-point
accesses only support 5-bit displacements but integer accesses
support 14-bit displacements.  I mistakenly assumed reload
could fix an invalid 14-bit displacement in a floating-point
access but this is not the case.

2024-03-14  John David Anglin  

gcc/ChangeLog:

PR target/114288
* config/pa/pa.cc (pa_legitimate_address_p): Don't allow
14-bit displacements before reload for modes that may use
a floating-point load or store.

diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc
index 694123e37c9..129289f8e62 100644
--- a/gcc/config/pa/pa.cc
+++ b/gcc/config/pa/pa.cc
@@ -10968,20 +10968,15 @@ pa_legitimate_address_p (machine_mode mode, rtx x, 
bool strict, code_helper)
 
  /* Long 14-bit displacements always okay for these cases.  */
  if (INT14_OK_STRICT
+ || reload_completed
  || mode == QImode
  || mode == HImode)
return true;
 
- /* A secondary reload may be needed to adjust the displacement
-of floating-point accesses when STRICT is nonzero.  */
- if (strict)
-   return false;
-
- /* We get significantly better code if we allow long displacements
-before reload for all accesses.  Instructions must satisfy their
-constraints after reload, so we must have an integer access.
-Return true for both cases.  */
- return true;
+ /* We have to limit displacements to those supported by
+both floating-point and integer accesses as reload can't
+fix invalid displacements.  See PR114288.  */
+ return false;
}
 
   if (!TARGET_DISABLE_INDEXING


signature.asc
Description: PGP signature


Re: [committed] Set num_threads to 50 on 32-bit hppa in two libgomp loop tests

2024-03-01 Thread John David Anglin

On 2024-03-01 3:44 a.m., Jakub Jelinek wrote:

Isn't this just that you have 50 in there?

No.  It's okay.

The problem is we run out of memory caused by a "ulimit -s 81920" statement 
that I had
in .bashrc.  The test pass with default stack allocation.

clone(child_stack=0x3191040, 
flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, 
parent_tid=[1108], tls=0x81918c0, child_tidptr=0x8191468) = 1108

rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
mmap2(NULL, 83890176, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 
-1 ENOMEM (Cannot allocate memory)

Will revert change to tests.

Dave

--
John David Anglin  dave.ang...@bell.net



Re: [committed] Set num_threads to 50 on 32-bit hppa in two libgomp loop tests

2024-02-29 Thread John David Anglin

On 2024-02-29 6:02 p.m., Thomas Schwinge wrote:

Hi!

On 2024-02-01T19:20:57+, John David Anglin  wrote:

Tested on hppa-unknown-linux-gnu.  Committed to trunk.
Set num_threads to 50 on 32-bit hppa in two libgomp loop tests

We support a maximum of 50 threads on 32-bit hppa.

What happens if you go higher?  Curious, what/why is that architectural
limit of 50 threads?

One gets an EAGAIN error at 51.  I don't know why 50 is the architectural limit 
on hppa-linux.
I had asked Helge previously but didn't get an answer.  As far as I can tell, 
limit isn't set by glibc.

It seems 64 is supported on all other targets.


I wonder: shouldn't that cap at 50 threads happen inside libgomp,
generally, instead of per test case and user code (!)?  Per my
understanding, OpenMP 'num_threads' specifies a *desired* number of
threads; the implementation may limit that value.

Sounds like a good suggestion.

Dave

--
John David Anglin  dave.ang...@bell.net



[PATCH] libstdc++-v3: Fix cmath math declarations and stub support for hppa64-*-hpux11*

2024-02-29 Thread John David Anglin
This change fixes the C99 math function support in  on
hppa64-*-hpux11*.

Tested on hppa64-hp-hpux11.11 and x86_64-linux-gnu.  See:
https://gcc.gnu.org/pipermail/gcc-testresults/2024-February/809158.html
https://gcc.gnu.org/pipermail/gcc-testresults/2024-February/809101.html

Okay for trunk?

Dave
---

Fix cmath math declarations and stub support for hppa64-*-hpux11*

This change fixes the following issues:

1) When the target host system doesn't support the full set of C99
functions, the stub replacements are not declared by cmath.  As a
result, stub replacements do not become members of namespace std.

2) Some using statements for float and long double C99 functions
are surrounded by a _GLIBCXX_HAVE_* #ifdef.  For example,
#ifdef _GLIBCXX_HAVE_ACOSF
  using ::acosf;
#endif
As a result, missing float and long double functions never become
a member of std even though there is stub support for all of them.

3) Undefs for acosf, acosl, etc, are missing.  Adding these should
allow PR86553 to be fixed.

4) Added AC_DEFINE statements for HAVE_CBRTF, HAVE_COPYSIGNF,
HAVE_HYPOTF, HAVE_LOG2F and HAVE_NEXTAFTERF to crossconfig.m4
for hpux host.

5) Added additional checks to linkage.m4.

6) Added stubs for missing float, double and long double C99
functions.

PR libstdc++/114101

libstdc++-v3/ChangeLog:

* config/os/hpux/os_defines.h (_GLIBCXX_USE_C99_MATH_FUNCS): Define.
(_GLIBCXX_USE_C99_MATH_TR1): Define.
(_GLIBCXX_USE_BUILTIN_FMA): Define if _PA_RISC2_0 host.
(_GLIBCXX_USE_BUILTIN_FMAF): Likewise.
* crossconfig.m4: Add AC_DEFINE statements for HAVE_CBRTF,
HAVE_COPYSIGNF, HAVE_HYPOTF, HAVE_LOG2F and HAVE_NEXTAFTERF.
* include/c_global/cmath: Add #undef statements for acosf,
acosl, etc.  Add declarations for acosf, acosl, etc.  Likewise,
add declarations for acoshf, acoshl, etc, for C++11.
* libstdc++-v3/include/tr1/cmath: Add declarations for acosf,
acosl, etc.
* linkage.m4: Add checks for fma, nexttoward, scalbln, tgamma,
cbrtf, copysignf, expm1f, log2f, nanf, nextafterf, nexttowardf,
expm1l, ilogbl, nanl, nextafterl, nexttowardl, scalblnl,
scalbnl.
* src/c++98/Makefile.am: Add math_stubs_double.cc to sources.
* src/c++98/math_stubs_double.cc: New file.
* src/c++98/math_stubs_float.cc (scalbnf): New stub.
(lgammaf, tgammaf, erff, erfcf, remquof, fdimf, nearbyintf,
exp2f, rintf, lrintf, llrintf, fmaxf, fminf, log1pf, truncf,
asinhf, acoshf, atanhf, scalblnf, lroundf, llroundf, roundf,
remainderf, logbf, ilogbf, expm1f, nextafterf, nexttowardf,
nanf): Likewise.
* src/c++98/math_stubs_long_double.cc (ilogbl): New stub.
(lgammal, log1pl, nanl, nearbyintl, nextafterl, nexttowardl,
scalblnl, scalbnl, tgammal): Likewise.
* configure: Regenerate.
* config.h.in: Regenerate.
* src/c++98/Makefile.in: Regenerate.

diff --git a/libstdc++-v3/config/os/hpux/os_defines.h 
b/libstdc++-v3/config/os/hpux/os_defines.h
index 38c1c38af0c..9ab1af42bda 100644
--- a/libstdc++-v3/config/os/hpux/os_defines.h
+++ b/libstdc++-v3/config/os/hpux/os_defines.h
@@ -79,6 +79,18 @@ namespace std
 
 #define _GLIBCXX_USE_LONG_LONG 1
 
+// Import C99 functions in  in  in namespace std in C++11.
+// Missing functions are handled by stubs.  The fma, nexttoward, scalbln
+// and tgamma are missing in HP-UX 11.  Many float variants are supported.
+#define _GLIBCXX_USE_C99_MATH_FUNCS 1
+#define _GLIBCXX_USE_C99_MATH_TR1 1
+
+#ifdef _PA_RISC2_0
+// Float and double fma are supported directly in hardware.
+#define _GLIBCXX_USE_BUILTIN_FMA 1
+#define _GLIBCXX_USE_BUILTIN_FMAF 1
+#endif
+
 // HPUX on IA64 requires vtable to be 64 bit aligned even at 32 bit
 // mode.  We need to pad the vtable structure to achieve this.
 #if !defined(_LP64) && defined (__ia64__)
diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4
index b3269cb88e0..c6b08be5df5 100644
--- a/libstdc++-v3/crossconfig.m4
+++ b/libstdc++-v3/crossconfig.m4
@@ -152,14 +152,10 @@ case "${host}" in
 AC_DEFINE(HAVE_ACOSF)
 AC_DEFINE(HAVE_ASINF)
 AC_DEFINE(HAVE_ATANF)
+AC_DEFINE(HAVE_ATAN2F)
 AC_DEFINE(HAVE_COSF)
 AC_DEFINE(HAVE_COSHF)
-AC_DEFINE(HAVE_SINF)
-AC_DEFINE(HAVE_SINHF)
-AC_DEFINE(HAVE_TANF)
-AC_DEFINE(HAVE_TANHF)
 AC_DEFINE(HAVE_EXPF)
-AC_DEFINE(HAVE_ATAN2F)
 AC_DEFINE(HAVE_FABSF)
 AC_DEFINE(HAVE_FMODF)
 AC_DEFINE(HAVE_FREXPF)
@@ -167,7 +163,16 @@ case "${host}" in
 AC_DEFINE(HAVE_LOG10F)
 AC_DEFINE(HAVE_MODF)
 AC_DEFINE(HAVE_POWF)
+AC_DEFINE(HAVE_SINF)
+AC_DEFINE(HAVE_SINHF)
 AC_DEFINE(HAVE_SQRTF)
+AC_DEFINE(HAVE_TANF)
+AC_DEFINE(HAVE_TANHF)
+AC_DEFINE(HAVE_CBRTF)
+AC_DEFINE(HAVE_COPYSIGNF)
+AC_DEFINE(HAVE_HYPOTF)
+AC_DEFINE(HAVE_LOG2F)
+AC_DEFINE(HAVE_NEXTAFTERF)
 
 # GLIBCXX_CHECK_STDLIB_SUPPORT
 

[committed] Fix gcc.c-torture/execute/ieee/cdivchkf.c on hpux

2024-02-11 Thread John David Anglin
Tested on hppa64-hp-hpux11.11 and hppa-unknown-linux-gnu.
Committed to trunk.

Dave
---

Fix gcc.c-torture/execute/ieee/cdivchkf.c on hpux

2024-02-11  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.c-torture/execute/ieee/cdivchkf.c: Use ilogb and
__builtin_fmax instead of ilogbf and __builtin_fmaxf.

diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/cdivchkf.c 
b/gcc/testsuite/gcc.c-torture/execute/ieee/cdivchkf.c
index adf1ed91dc7..86ef69f8771 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/cdivchkf.c
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/cdivchkf.c
@@ -8,7 +8,7 @@
 extern void abort (void);
 extern void exit (int);
 
-extern int ilogbf (float);
+extern int ilogb (double);
 int match (float _Complex, float _Complex);
 
 #define SMALL FLT_MIN
@@ -22,7 +22,8 @@ int match (float _Complex, float _Complex);
 int match (float _Complex c, float _Complex z)
 {
   float rz, iz, rc, ic;
-  float rerr, ierr, rmax;
+  float rerr, ierr;
+  double rmax;
   int biterr;
   rz = __real__ z;
   iz = __imag__ z;
@@ -54,11 +55,11 @@ int match (float _Complex c, float _Complex z)
 {
   ierr = __builtin_fabsf (iz - ic) / SMALL;
 }
-  rmax = __builtin_fmaxf(rerr, ierr);
+  rmax = __builtin_fmax (rerr, ierr);
   biterr = 0;
   if ( rmax != 0.0)  
 {
-  biterr = ilogbf (rmax) + MAXBIT + 1;
+  biterr = ilogb (rmax) + MAXBIT + 1;
 }
 
   if (biterr >= ERRLIM)


signature.asc
Description: PGP signature


[committed] libgomp: Define config_path for hppa*-*-linux*

2024-02-11 Thread John David Anglin
Tested on hppa-unknown-linux-gnu.  Committed to trunk.

Dave
---

libgomp: Define config_path for hppa*-*-linux*

2024-02-11  John David Anglin  

libgomp/ChangeLog:

PR libgomp/113843
* configure.tgt (hppa*-*-linux*): Define config_path.

diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt
index 2cd7272fcd8..46af75f978f 100644
--- a/libgomp/configure.tgt
+++ b/libgomp/configure.tgt
@@ -52,6 +52,10 @@ if test x$enable_linux_futex = xyes; then
config_path="linux posix"
;;
 
+hppa*-*-linux*)
+   config_path="linux posix"
+   ;;
+
 ia64*-*-linux*)
config_path="linux/ia64 linux posix"
;;


signature.asc
Description: PGP signature


[committed] Fix xfail for 32-bit hppa*-*-* in gcc.dg/pr84877.c

2024-02-03 Thread John David Anglin
Tested on hppa-unknown-linux-gnu.  Committed to trunk.

Dave
---

Fix xfail for 32-bit hppa*-*-* in gcc.dg/pr84877.c

2024-02-03  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/pr84877.c: Adjust xfail parentheses.

diff --git a/gcc/testsuite/gcc.dg/pr84877.c b/gcc/testsuite/gcc.dg/pr84877.c
index 68681206e73..e82991f42dd 100644
--- a/gcc/testsuite/gcc.dg/pr84877.c
+++ b/gcc/testsuite/gcc.dg/pr84877.c
@@ -1,4 +1,4 @@
-/* { dg-do run { xfail { cris-*-* sparc*-*-* } || { { ! lp64 } && hppa*-*-* } 
} } */
+/* { dg-do run { xfail { { cris-*-* sparc*-*-* } || { { ! lp64 } && hppa*-*-* 
} } } } */
 /* { dg-options "-O2" } */
 
 #include 


signature.asc
Description: PGP signature


[committed] libatomic: Provide FPU exception defines for hppa

2024-02-03 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

libatomic: Provide FPU exception defines for hppa

The exception defines in  do not match the exception bits
in the FPU status register on hppa-linux and hppa64-hpux11.11.  On
linux, they match the trap enable bits.  On 64-bit hpux, they match
the exception bits for IA64.  The IA64 bits are in a different
order and location than HPPA.  HP uses table look ups to reorder
the bits in code to test and raise exceptions.

All the architectures that I looked at just pass the FPU status
register to __atomic_feraiseexcept().  The simplest approach for
hppa is to define FE_INEXACT, etc, to match the status register
and not include .

2024-02-03  John David Anglin  

libatomic/ChangeLog:

PR target/59778
* configure.tgt (hppa*): Set ARCH.
* config/pa/fenv.c: New file.

diff --git a/libatomic/config/pa/fenv.c b/libatomic/config/pa/fenv.c
new file mode 100644
index 000..232e8416ffd
--- /dev/null
+++ b/libatomic/config/pa/fenv.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2012-2024 Free Software Foundation, Inc.
+
+   This file is part of the GNU Atomic Library (libatomic).
+
+   Libatomic is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   Libatomic is distributed in the hope that it will be useful, but WITHOUT ANY
+   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+   FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+   more details.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "libatomic_i.h"
+
+#define FE_INEXACT (1<<27)
+#define FE_UNDERFLOW   (1<<28)
+#define FE_OVERFLOW(1<<29)
+#define FE_DIVBYZERO   (1<<30)
+#define FE_INVALID (1<<31)
+
+/* Raise the supported floating-point exceptions from EXCEPTS.  Other
+   bits in EXCEPTS are ignored.  */
+
+void
+__atomic_feraiseexcept (int excepts __attribute__ ((unused)))
+{
+  volatile float r __attribute__ ((unused));
+#ifdef FE_INVALID
+  if (excepts & FE_INVALID)
+  {
+volatile float zero = 0.0f;
+r = zero / zero;
+  }
+#endif
+#ifdef FE_DIVBYZERO
+  if (excepts & FE_DIVBYZERO)
+{
+  volatile float zero = 0.0f;
+  r = 1.0f / zero;
+}
+#endif
+#ifdef FE_OVERFLOW
+  if (excepts & FE_OVERFLOW)
+{
+  volatile float max = __FLT_MAX__;
+  r = max * max;
+}
+#endif
+#ifdef FE_UNDERFLOW
+  if (excepts & FE_UNDERFLOW)
+{
+  volatile float min = __FLT_MIN__;
+  r = min * min;
+}
+#endif
+#ifdef FE_INEXACT
+  if (excepts & FE_INEXACT)
+{
+  volatile float three = 3.0f;
+  r = 1.0f / three;
+}
+#endif
+}
diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt
index 67a5f2dff80..4237f283fe4 100644
--- a/libatomic/configure.tgt
+++ b/libatomic/configure.tgt
@@ -36,6 +36,7 @@ case "${target_cpu}" in
XCFLAGS="${XCFLAGS} -mfp-trap-mode=sui"
ARCH=alpha
;;
+  hppa*)   ARCH=pa ;;
   rs6000 | powerpc*)   ARCH=powerpc ;;
   riscv*)  ARCH=riscv ;;
   sh*) ARCH=sh ;;


signature.asc
Description: PGP signature


[committed] hppa: Implement TARGET_ATOMIC_ASSIGN_EXPAND_FENV

2024-02-02 Thread John David Anglin
Tested on hppa-unknown-linux-gnu and hppa64-hp-hpux11.11.

This is the first step in fixing PR target/59778.  libatomic/fenv.c
needs fixing for hppa so exceptions are correctly raised.

Committed to trunk.

Dave
---

hppa: Implement TARGET_ATOMIC_ASSIGN_EXPAND_FENV

This change implements __builtin_get_fpsr() and __builtin_set_fpsr(x)
to get and set the floating-point status register.  They are used to
implement pa_atomic_assign_expand_fenv().

2024-02-02  John David Anglin  

gcc/ChangeLog:

PR target/59778
* config/pa/pa.cc (enum pa_builtins): Add PA_BUILTIN_GET_FPSR
and PA_BUILTIN_SET_FPSR builtins.
* (pa_builtins_icode): Declare.
* (def_builtin, pa_fpu_init_builtins): New.
* (pa_init_builtins): Initialize FPU builtins.
* (pa_builtin_decl, pa_expand_builtin_1): New.
* (pa_expand_builtin): Handle PA_BUILTIN_GET_FPSR and
PA_BUILTIN_SET_FPSR builtins.
* (pa_atomic_assign_expand_fenv): New.
* config/pa/pa.md (UNSPECV_GET_FPSR, UNSPECV_SET_FPSR): New
UNSPECV constants.
(get_fpsr, put_fpsr): New expanders.
(get_fpsr_32, get_fpsr_64, set_fpsr_32, set_fpsr_64): New
insn patterns.

diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc
index c58b0a0d75e..694123e37c9 100644
--- a/gcc/config/pa/pa.cc
+++ b/gcc/config/pa/pa.cc
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "target.h"
 #include "rtl.h"
 #include "tree.h"
+#include "gimple.h"
 #include "df.h"
 #include "tm_p.h"
 #include "stringpool.h"
@@ -142,6 +143,7 @@ static void pa_asm_out_destructor (rtx, int);
 #endif
 static void pa_init_builtins (void);
 static rtx pa_expand_builtin (tree, rtx, rtx, machine_mode mode, int);
+static tree pa_builtin_decl (unsigned, bool);
 static rtx hppa_builtin_saveregs (void);
 static void hppa_va_start (tree, rtx);
 static tree hppa_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *);
@@ -205,6 +207,7 @@ static bool pa_modes_tieable_p (machine_mode, machine_mode);
 static bool pa_can_change_mode_class (machine_mode, machine_mode, reg_class_t);
 static HOST_WIDE_INT pa_starting_frame_offset (void);
 static section* pa_elf_select_rtx_section(machine_mode, rtx, unsigned 
HOST_WIDE_INT) ATTRIBUTE_UNUSED;
+static void pa_atomic_assign_expand_fenv (tree *, tree *, tree *);
 
 /* The following extra sections are only used for SOM.  */
 static GTY(()) section *som_readonly_data_section;
@@ -314,9 +317,10 @@ static size_t n_deferred_plabels = 0;
 
 #undef TARGET_INIT_BUILTINS
 #define TARGET_INIT_BUILTINS pa_init_builtins
-
 #undef TARGET_EXPAND_BUILTIN
 #define TARGET_EXPAND_BUILTIN pa_expand_builtin
+#undef  TARGET_BUILTIN_DECL
+#define TARGET_BUILTIN_DECL  pa_builtin_decl
 
 #undef TARGET_REGISTER_MOVE_COST
 #define TARGET_REGISTER_MOVE_COST hppa_register_move_cost
@@ -426,6 +430,9 @@ static size_t n_deferred_plabels = 0;
 #undef TARGET_HAVE_SPECULATION_SAFE_VALUE
 #define TARGET_HAVE_SPECULATION_SAFE_VALUE speculation_safe_value_not_needed
 
+#undef TARGET_ATOMIC_ASSIGN_EXPAND_FENV
+#define TARGET_ATOMIC_ASSIGN_EXPAND_FENV pa_atomic_assign_expand_fenv
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* Parse the -mfixed-range= option string.  */
@@ -592,6 +599,10 @@ pa_option_override (void)
 
 enum pa_builtins
 {
+  /* FPU builtins.  */
+  PA_BUILTIN_GET_FPSR,
+  PA_BUILTIN_SET_FPSR,
+
   PA_BUILTIN_COPYSIGNQ,
   PA_BUILTIN_FABSQ,
   PA_BUILTIN_INFQ,
@@ -600,10 +611,48 @@ enum pa_builtins
 };
 
 static GTY(()) tree pa_builtins[(int) PA_BUILTIN_max];
+static GTY(()) enum insn_code pa_builtins_icode[(int) PA_BUILTIN_max];
+
+/* Add a PA  builtin function with NAME, ICODE, CODE and TYPE.  Return the
+   function decl or NULL_TREE if the builtin was not added.  */
+
+static tree
+def_builtin (const char *name, enum insn_code icode, enum pa_builtins code,
+tree type)
+{
+  tree t
+= add_builtin_function (name, type, code, BUILT_IN_MD, NULL, NULL_TREE);
+
+  if (t)
+{
+  pa_builtins[code] = t;
+  pa_builtins_icode[code] = icode;
+}
+
+  return t;
+}
+
+/* Create builtin functions for FPU instructions.  */
+
+static void
+pa_fpu_init_builtins (void)
+{
+  tree ftype;
+
+  ftype = build_function_type_list (unsigned_type_node, 0);
+  def_builtin ("__builtin_get_fpsr", CODE_FOR_get_fpsr,
+  PA_BUILTIN_GET_FPSR, ftype);
+  ftype = build_function_type_list (void_type_node, unsigned_type_node, 0);
+  def_builtin ("__builtin_set_fpsr", CODE_FOR_set_fpsr,
+  PA_BUILTIN_SET_FPSR, ftype);
+}
 
 static void
 pa_init_builtins (void)
 {
+  if (!TARGET_SOFT_FLOAT)
+pa_fpu_init_builtins ();
+
 #ifdef DONT_HAVE_FPUTC_UNLOCKED
   {
 tree decl = builtin_decl_explicit (BUILT_IN_PUTC_UNLOCKED);
@@ -663,6 +712,92 @@ pa_init_builtins (void)
 }
 }
 
+/* Implement TARGET_BUILTIN_DECL.  */
+
+static tree
+pa_builtin_decl (unsigned i

[committed] Set num_threads to 50 on 32-bit hppa in two libgomp loop tests

2024-02-01 Thread John David Anglin
Tested on hppa-unknown-linux-gnu.  Committed to trunk.

Dave
---

Set num_threads to 50 on 32-bit hppa in two libgomp loop tests

We support a maximum of 50 threads on 32-bit hppa.

2024-02-01  John David Anglin  

libgomp/ChangeLog:

* testsuite/libgomp.c++/loop-3.C: Set num_threads to 50
on 32-bit hppa.
* testsuite/libgomp.c/omp-loop03.c: Likewise.

diff --git a/libgomp/testsuite/libgomp.c++/loop-3.C 
b/libgomp/testsuite/libgomp.c++/loop-3.C
index fa50f099f3f..3f460f114bf 100644
--- a/libgomp/testsuite/libgomp.c++/loop-3.C
+++ b/libgomp/testsuite/libgomp.c++/loop-3.C
@@ -1,3 +1,9 @@
+#if defined(__hppa__) && !defined(__LP64__)
+#define NUM_THREADS 50
+#else
+#define NUM_THREADS 64
+#endif
+
 extern "C" void abort (void);
 int a;
 
@@ -19,7 +25,7 @@ foo ()
 int
 main (void)
 {
-#pragma omp parallel num_threads (64)
+#pragma omp parallel num_threads (NUM_THREADS)
   foo ();
 
   return 0;
diff --git a/libgomp/testsuite/libgomp.c/omp-loop03.c 
b/libgomp/testsuite/libgomp.c/omp-loop03.c
index 7bb9a194331..9879981cf4a 100644
--- a/libgomp/testsuite/libgomp.c/omp-loop03.c
+++ b/libgomp/testsuite/libgomp.c/omp-loop03.c
@@ -1,3 +1,9 @@
+#if defined(__hppa__) && !defined(__LP64__)
+#define NUM_THREADS 50
+#else
+#define NUM_THREADS 64
+#endif
+
 extern void abort (void);
 int a;
 
@@ -19,7 +25,7 @@ foo ()
 int
 main (void)
 {
-#pragma omp parallel num_threads (64)
+#pragma omp parallel num_threads (NUM_THREADS)
   foo ();
 
   return 0;


signature.asc
Description: PGP signature


[committed] xfail gnat.dg/trampoline3.adb scan-assembler-not check on hppa*-*-*

2024-02-01 Thread John David Anglin
Tested on hppa-unknown-linux-gnu.  Committed to trunk.

Dave
---

xfail gnat.dg/trampoline3.adb scan-assembler-not check on hppa*-*-*

We still require an executable stack for trampolines on hppa*-*-*.

2024-02-01  John David Anglin  

gcc/testsuite/ChangeLog:

* gnat.dg/trampoline3.adb: xfail scan-assembler-not
check on hppa*-*-*.

diff --git a/gcc/testsuite/gnat.dg/trampoline3.adb 
b/gcc/testsuite/gnat.dg/trampoline3.adb
index 28057662452..10b6e5d4a41 100644
--- a/gcc/testsuite/gnat.dg/trampoline3.adb
+++ b/gcc/testsuite/gnat.dg/trampoline3.adb
@@ -19,4 +19,4 @@ begin
   I := P(0);
 end;
 
--- { dg-final { scan-assembler-not "GNU-stack.*x" } }
+-- { dg-final { scan-assembler-not "GNU-stack.*x" { xfail hppa*-*-* } } }


signature.asc
Description: PGP signature


[committed] hppa: Fix bug in atomic_storedi_1 pattern

2024-02-01 Thread John David Anglin
Tested on hppa-unknown-linux-gnu.  Committed to trunk.

Dave
---

hppa: Fix bug in atomic_storedi_1 pattern

The first alternative stores the floating-point status register 
in the destination.  It should store zero.  We need to copy %fr0
to another floating-point register to initialize it to zero.

2024-02-01  John David Anglin  

gcc/ChangeLog:

* config/pa/pa.md (atomic_storedi_1): Fix bug in
alternative 1.

diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 52ad0c3776d..aecdcc98b6a 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -10723,13 +10723,13 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
 (define_insn "atomic_storedi_1"
   [(set (mem:DI (match_operand:SI 0 "register_operand" "r,r"))
 (match_operand:DI 1 "reg_or_0_operand" "M,r"))
-   (clobber (match_scratch:DI 2 "=X,f"))]
+   (clobber (match_scratch:DI 2 "=f,f"))]
   "!TARGET_64BIT && !TARGET_SOFT_FLOAT"
   "@
-   {fstds|fstd} %%fr0,0(%0)
+   fcpy,dbl %%fr0,%2\n\t{fstds|fstd} %2,0(%0)
{stws|stw} %1,-16(%%sp)\n\t{stws|stw} %R1,-12(%%sp)\n\t{fldds|fldd} 
-16(%%sp),%2\n\t{fstds|fstd} %2,0(%0)"
   [(set_attr "type" "move,move")
-   (set_attr "length" "4,16")])
+   (set_attr "length" "8,16")])
 
 ;; PA 2.0 hardware supports out-of-order execution of loads and stores, so
 ;; we need memory barriers to enforce program order for memory references


signature.asc
Description: PGP signature


[committed] Add -gno-strict-dwarf to dg-options in various btf enum tests

2024-01-22 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Add -gno-strict-dwarf to dg-options in various btf enum tests

The -gno-strict-dwarf option is needed to ensure enum signedness
is added to type_die.

2024-01-22  John David Anglin  

gcc/testsuite/ChangeLog:

PR debug/113382
* gcc.dg/debug/btf/btf-bitfields-3.c: Add -gno-strict-dwarf
option to dg-options.
* gcc.dg/debug/btf/btf-enum-1.c: Likewise.
* gcc.dg/debug/btf/btf-enum-small.c: Likewise.
* gcc.dg/debug/btf/btf-enum64-1.c: Likewise.

diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-3.c 
b/gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-3.c
index 78b8b7d49ad..08622b771e6 100644
--- a/gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-3.c
+++ b/gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-3.c
@@ -14,7 +14,7 @@
*/
 
 /* { dg-do compile } */
-/* { dg-options "-O0 -gbtf -dA" } */
+/* { dg-options "-O0 -gbtf -gno-strict-dwarf -dA" } */
 
 /* Enum with 4 members.  */
 /* { dg-final { scan-assembler-times "\[\t \]0x604\[\t 
\]+\[^\n\]*btt_info" 1 } } */
diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-enum-1.c 
b/gcc/testsuite/gcc.dg/debug/btf/btf-enum-1.c
index 021ce0345e4..7873c8837a0 100644
--- a/gcc/testsuite/gcc.dg/debug/btf/btf-enum-1.c
+++ b/gcc/testsuite/gcc.dg/debug/btf/btf-enum-1.c
@@ -1,7 +1,7 @@
 /* Test BTF generation for enums.  */
 
 /* { dg-do compile } */
-/* { dg-options "-O0 -gbtf -fno-short-enums -dA" } */
+/* { dg-options "-O0 -gbtf -gno-strict-dwarf -fno-short-enums -dA" } */
 
 /* { dg-final { scan-assembler-times "\[\t \]0x604\[\t 
\]+\[^\n\]*btt_info" 1 } } */
 /* { dg-final { scan-assembler-times "\[\t \]0x8603\[\t 
\]+\[^\n\]*btt_info" 1 } } */
diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-enum-small.c 
b/gcc/testsuite/gcc.dg/debug/btf/btf-enum-small.c
index eb8a1bd2c43..ccc92c92ba9 100644
--- a/gcc/testsuite/gcc.dg/debug/btf/btf-enum-small.c
+++ b/gcc/testsuite/gcc.dg/debug/btf/btf-enum-small.c
@@ -1,7 +1,7 @@
 /* Test BTF generation for small enums.  */
 
 /* { dg-do compile } */
-/* { dg-options "-O2 -gbtf -dA" } */
+/* { dg-options "-O2 -gbtf -gno-strict-dwarf -dA" } */
 
 /* { dg-final { scan-assembler-not "bte_value_lo32" } } */
 /* { dg-final { scan-assembler-not "bte_value_hi32" } } */
diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-enum64-1.c 
b/gcc/testsuite/gcc.dg/debug/btf/btf-enum64-1.c
index 5d1487c1183..3ba885af17f 100644
--- a/gcc/testsuite/gcc.dg/debug/btf/btf-enum64-1.c
+++ b/gcc/testsuite/gcc.dg/debug/btf/btf-enum64-1.c
@@ -1,7 +1,7 @@
 /* Test BTF generation for 64 bits enums.  */
 
 /* { dg-do compile } */
-/* { dg-options "-O0 -gbtf -dA" } */
+/* { dg-options "-O0 -gbtf -gno-strict-dwarf -dA" } */
 
 /* { dg-final { scan-assembler-times "\[\t \].size\[\t \]_?myenum1,\[\t \]8" 1 
} } */
 /* { dg-final { scan-assembler-times "\[\t \].size\[\t \]_?myenum2,\[\t \]8" 1 
} } */


signature.asc
Description: PGP signature


[committed] Remove several xfails for 32-bit hppa*-*-*

2024-01-20 Thread John David Anglin
Tested on hppa-unknown-linux-gnu.  Committed to trunk.

Dave
---

Remove several xfails for 32-bit hppa*-*-*

These arise because 32-bit ELF targets were changed from
callee copies to caller copies.

2024-01-20  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/ipa/iinline-4.c: Remove dg-final xfail for
32-bit hppa*-*-*.
* gcc.dg/ipa/inline-5.c: Likewise.
* gcc.dg/ipa/ipcp-cstagg-7.c: Likewise.
* gcc.dg/tree-ssa/vector-4.c: Likewise.

diff --git a/gcc/testsuite/gcc.dg/ipa/iinline-4.c 
b/gcc/testsuite/gcc.dg/ipa/iinline-4.c
index f50ffa58221..c78163dbeff 100644
--- a/gcc/testsuite/gcc.dg/ipa/iinline-4.c
+++ b/gcc/testsuite/gcc.dg/ipa/iinline-4.c
@@ -214,7 +214,7 @@ int test7 (void)
 /* { dg-final { scan-ipa-dump "hooray1\[^\\n\]*inline copy in test1"  "inline" 
 } } */
 /* { dg-final { scan-ipa-dump "hooray2\[^\\n\]*inline copy in test2"  "inline" 
 } } */
 /* { dg-final { scan-ipa-dump "hooray3\[^\\n\]*inline copy in test3"  "inline" 
 } } */
-/* { dg-final { scan-ipa-dump "hooray4\[^\\n\]*inline copy in test4"  "inline" 
 { xfail { { hppa*-*-* } && { ! lp64 } } } } } */
+/* { dg-final { scan-ipa-dump "hooray4\[^\\n\]*inline copy in test4"  "inline" 
 } } */
 /* { dg-final { scan-ipa-dump "hooray5\[^\\n\]*inline copy in test5"  "inline" 
 } } */
 /* { dg-final { scan-ipa-dump "hooray6\[^\\n\]*inline copy in test6"  "inline" 
 } } */
 /* { dg-final { scan-ipa-dump "hooray7\[^\\n\]*inline copy in test7"  "inline" 
 } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/inline-5.c 
b/gcc/testsuite/gcc.dg/ipa/inline-5.c
index 559e258955e..390ba499d67 100644
--- a/gcc/testsuite/gcc.dg/ipa/inline-5.c
+++ b/gcc/testsuite/gcc.dg/ipa/inline-5.c
@@ -34,5 +34,5 @@ accessreference (struct a *a)
 /* Will be eliminated by inlining */
 }
 
-/* { dg-final { scan-ipa-dump-times "Will be eliminated" 4 "fnsummary" { xfail 
{ { hppa*-*-* } && { ! lp64 } } } } } */
+/* { dg-final { scan-ipa-dump-times "Will be eliminated" 4 "fnsummary" } } */
 /* { dg-final { scan-ipa-dump-times "50. will be eliminated" 1 "fnsummary"  } 
} */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipcp-cstagg-7.c 
b/gcc/testsuite/gcc.dg/ipa/ipcp-cstagg-7.c
index b08c420cd86..6af8bda6d8e 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipcp-cstagg-7.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipcp-cstagg-7.c
@@ -62,4 +62,4 @@ h (int x)
   return bar (s, x);
 }
 
-/* { dg-final { scan-ipa-dump-times "Discovered an indirect call to a known 
target" 3 "cp" { xfail { hppa*-*-* && { ! lp64 } } } } } */
+/* { dg-final { scan-ipa-dump-times "Discovered an indirect call to a known 
target" 3 "cp" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vector-4.c 
b/gcc/testsuite/gcc.dg/tree-ssa/vector-4.c
index 00ddd2995be..982a2a47d6a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/vector-4.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/vector-4.c
@@ -10,7 +10,6 @@ v4si vs (v4si a, v4si b)
 }
 
 /* The compound literal should be placed directly in the vec_perm.  */
-/* Test is xfailed on 32-bit hppa*-*-* because target-callee-copies.  */
-/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR ;" 1 
"gimple" { target { ! mmix-knuth-mmixware } xfail { hppa*-*-* && { ! lp64 } } } 
} } */
+/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR ;" 1 
"gimple" { target { ! mmix-knuth-mmixware } } } } */
 /* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR ;" 1 "gimple" { target mmix-knuth-mmixware } } } */
 


signature.asc
Description: PGP signature


[committed] Increase timeout by 2 in libgomp.fortran/alloc-comp-3.f90 on hppa*-*-*

2024-01-20 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Increase timeout by 2 in libgomp.fortran/alloc-comp-3.f90 on hppa*-*-*

2024-01-20  John David Anglin  

libgomp/ChangeLog:

* testsuite/libgomp.fortran/alloc-comp-3.f90: Increase
timeout by 2 on hppa*-*-*.

diff --git a/libgomp/testsuite/libgomp.fortran/alloc-comp-3.f90 
b/libgomp/testsuite/libgomp.fortran/alloc-comp-3.f90
index 0185859cb26..eb418e83d9e 100644
--- a/libgomp/testsuite/libgomp.fortran/alloc-comp-3.f90
+++ b/libgomp/testsuite/libgomp.fortran/alloc-comp-3.f90
@@ -2,6 +2,7 @@
 ! Don't cycle by default through all options, just test -O0 and -O2,
 ! as this is quite large test.
 ! { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O0" "-O2" } }
+! { dg-timeout-factor 2.0 { target hppa*-*-* } }
 
 module m
   type dl


signature.asc
Description: PGP signature


[committed] Don't run libgomp.c/simd-math-1.c on hppa*-*-hpux*

2024-01-20 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Don't run libgomp.c/simd-math-1.c on hppa*-*-hpux*

hppa*-*-hpux* lacks necessary math functions.

2024-01-20  John David Anglin  

libgomp/ChangeLog:

* testsuite/libgomp.c/simd-math-1.c: Don't run on
hppa*-*-hpux*.

diff --git a/libgomp/testsuite/libgomp.c/simd-math-1.c 
b/libgomp/testsuite/libgomp.c/simd-math-1.c
index 42a008c80fc..b30df09caf6 100644
--- a/libgomp/testsuite/libgomp.c/simd-math-1.c
+++ b/libgomp/testsuite/libgomp.c/simd-math-1.c
@@ -1,7 +1,7 @@
 /* Check that the SIMD versions of math routines give the same (or
sufficiently close) results as their scalar equivalents.  */
 
-/* { dg-do run } */
+/* { dg-do run { target { ! hppa*-*-hpux* } } } */
 /* { dg-options "-O2 -ftree-vectorize -fno-math-errno" } */
 /* { dg-additional-options 
-foffload-options=amdgcn-amdhsa=-mstack-size=300 { target 
offload_target_amdgcn } } */
 /* { dg-additional-options "-DNONSTDFUNC=1" { target 
nonstandard_math_functions } } */


signature.asc
Description: PGP signature


[committed] xfail scan-tree-dump-times checks on hppa*64*-*-* in gcc.dg/tree-ssa/slsr-13.c

2024-01-20 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

xfail scan-tree-dump-times checks on hppa*64*-*-* in gcc.dg/tree-ssa/slsr-13.c

2024-01-20  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/slsr-13.c: xfail scan-tree-dump-times
checks on hppa*64*-*-*.

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/slsr-13.c 
b/gcc/testsuite/gcc.dg/tree-ssa/slsr-13.c
index 4133694174c..93749d6e856 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/slsr-13.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/slsr-13.c
@@ -20,5 +20,5 @@ f (int s, int c)
   return x;
 }
 
-/* { dg-final { scan-tree-dump-times " \\* 4" 2 "optimized" } } */
-/* { dg-final { scan-tree-dump-times " \\* 5" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " \\* 4" 2 "optimized" {xfail 
hppa*64*-*-* } } } */
+/* { dg-final { scan-tree-dump-times " \\* 5" 0 "optimized" {xfail 
hppa*64*-*-* } } } */


signature.asc
Description: PGP signature


[committed] Require target lra in gcc.dg/torture/pr110422.c

2024-01-20 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Require target lra in gcc.dg/torture/pr110422.c

LRA is required for asm goto.

2024-01-20  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/torture/pr110422.c: Require target lra.

diff --git a/gcc/testsuite/gcc.dg/torture/pr110422.c 
b/gcc/testsuite/gcc.dg/torture/pr110422.c
index 2e171a7a19e..2a653bdfce3 100644
--- a/gcc/testsuite/gcc.dg/torture/pr110422.c
+++ b/gcc/testsuite/gcc.dg/torture/pr110422.c
@@ -1,4 +1,4 @@
-/* { dg-do compile } */
+/* { dg-do compile { target lra } } */
 
 struct T { int x; };
 int foo(void) {


signature.asc
Description: PGP signature


[committed] Limit dg-xfail-run-if for *-*-hpux11.[012]* to -O0

2024-01-19 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Limit dg-xfail-run-if for *-*-hpux11.[012]* to -O0

2024-01-19  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/torture/pr47917.c: Limit dg-xfail-run-if for
hpux11.[012]* to -O0.

diff --git a/gcc/testsuite/gcc.dg/torture/pr47917.c 
b/gcc/testsuite/gcc.dg/torture/pr47917.c
index 5724907ba1c..32c99c6a2d2 100644
--- a/gcc/testsuite/gcc.dg/torture/pr47917.c
+++ b/gcc/testsuite/gcc.dg/torture/pr47917.c
@@ -2,7 +2,7 @@
 /* { dg-options "-std=c99" } */
 /* { dg-options "-std=gnu99" { target *-*-hpux* } } */
 /* { dg-additional-options "-D__USE_MINGW_ANSI_STDIO=1" { target *-*-mingw* } 
} */
-/* { dg-xfail-run-if "non-conforming C99 snprintf" { *-*-hpux11.[012]* } } */
+/* { dg-xfail-run-if "non-conforming C99 snprintf" { *-*-hpux11.[012]* } { 
"-O0" } } */
 
 /* PR middle-end/47917 */
 


signature.asc
Description: PGP signature


[committed] Change dg-options for hpux to define _HPUX_SOURCE in gcc.dg/pthread-init-2.c

2024-01-19 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Change dg-options for hpux to define _HPUX_SOURCE in gcc.dg/pthread-init-2.c

Pthreads on hpux needs _HPUX_SOURCE define for id_t and spu_t types.

2024-01-19  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/pthread-init-2.c: Change dg-options for hpux
to define _HPUX_SOURCE.

diff --git a/gcc/testsuite/gcc.dg/pthread-init-2.c 
b/gcc/testsuite/gcc.dg/pthread-init-2.c
index d7cd66b5c02..c934fb525f9 100644
--- a/gcc/testsuite/gcc.dg/pthread-init-2.c
+++ b/gcc/testsuite/gcc.dg/pthread-init-2.c
@@ -7,7 +7,8 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target pthread_h } */
 /* { dg-options "-Wextra -Wall -ansi" } */
-/* { dg-options "-Wextra -Wall -ansi -D_POSIX_C_SOURCE=199506L" { target { 
*-*-hpux* } } } */
+/* We need to define _HPUX_SOURCE on hpux11.11 for id_t and spu_t types.  */
+/* { dg-options "-Wextra -Wall -ansi -D_HPUX_SOURCE" { target { *-*-hpux* } } 
} */
 /* { dg-options "-Wextra -Wall -ansi -D_XOPEN_SOURCE=500" { target { 
powerpc-ibm-aix* } } } */
 /* The definition of PTHREAD_MUTEX_INITIALIZER is missing an initializer for
mutexAttr.mutexAttrType in kernel mode for various VxWorks versions.  */


signature.asc
Description: PGP signature


[committed] Only xfail gcc.dg/pr84877.c on 32-bit hppa*-*-*

2024-01-19 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Only xfail gcc.dg/pr84877.c on 32-bit hppa*-*-*

2024-01-19  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/pr84877.c: Only xfail on 32-bit hppa*-*-*.

diff --git a/gcc/testsuite/gcc.dg/pr84877.c b/gcc/testsuite/gcc.dg/pr84877.c
index d1fb84763c8..68681206e73 100644
--- a/gcc/testsuite/gcc.dg/pr84877.c
+++ b/gcc/testsuite/gcc.dg/pr84877.c
@@ -1,4 +1,4 @@
-/* { dg-do run { xfail { cris-*-* hppa*-*-* sparc*-*-* } } } */
+/* { dg-do run { xfail { cris-*-* sparc*-*-* } || { { ! lp64 } && hppa*-*-* } 
} } */
 /* { dg-options "-O2" } */
 
 #include 


signature.asc
Description: PGP signature


[committed] Skip gcc.dg/analyzer/pr94688.c on hppa*64*-*-*

2024-01-19 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Skip gcc.dg/analyzer/pr94688.c on hppa*64*-*-*

2024-01-19  John David Anglin  

gcc/testsuite/ChangeLog:

PR analyzer/112705
* gcc.dg/analyzer/pr94688.c: Skip on hppa*64*-*-*.

diff --git a/gcc/testsuite/gcc.dg/analyzer/pr94688.c 
b/gcc/testsuite/gcc.dg/analyzer/pr94688.c
index f553b8cfdad..8ea8bc3b288 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr94688.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr94688.c
@@ -1,3 +1,4 @@
+/* { dg-skip-if "PR112705" { hppa*64*-*-* } } */
 int a, b;
 void d();
 void c()


signature.asc
Description: PGP signature


[committed] Add .data.rel.ro.local to read only sections in gcc.dg/array-quals-1.c

2024-01-16 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Add .data.rel.ro.local to read only sections in gcc.dg/array-quals-1.c

2024-01-16  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/array-quals-1.c: Add .data.rel.ro.local to read only
sections.

diff --git a/gcc/testsuite/gcc.dg/array-quals-1.c 
b/gcc/testsuite/gcc.dg/array-quals-1.c
index b9b55f774bc..e379f6121b7 100644
--- a/gcc/testsuite/gcc.dg/array-quals-1.c
+++ b/gcc/testsuite/gcc.dg/array-quals-1.c
@@ -30,23 +30,23 @@ cia d1 = { 7, 8 };
 static cia e[2] = { { 1, 2 }, { 3, 4 } };
 /* { dg-final { scan-assembler-symbol-section {^_?e1$} 
{^\.(const|rodata|srodata|sdata)|\[RO\]} } } */
 cia e1[2] = { { 1, 2 }, { 3, 4 } };
-/* { dg-final { scan-assembler-symbol-section {^_?p$} 
{^\.(const|rodata|srodata|sdata)|\[RW\]} } } */
+/* { dg-final { scan-assembler-symbol-section {^_?p$} 
{^\.(const|rodata|srodata|sdata|data.rel.ro.local)|\[RW\]} } } */
 void *const p = 
-/* { dg-final { scan-assembler-symbol-section {^_?q$} 
{^\.(const|rodata|srodata|sdata)|\[RW\]} } } */
+/* { dg-final { scan-assembler-symbol-section {^_?q$} 
{^\.(const|rodata|srodata|sdata|data.rel.ro.local)|\[RW\]} } } */
 void *const q = 
-/* { dg-final { scan-assembler-symbol-section {^_?r$} 
{^\.(const|rodata|srodata|sdata)|\[RW\]} } } */
+/* { dg-final { scan-assembler-symbol-section {^_?r$} 
{^\.(const|rodata|srodata|sdata|data.rel.ro.local)|\[RW\]} } } */
 void *const r = 
-/* { dg-final { scan-assembler-symbol-section {^_?s$} 
{^\.(const|rodata|srodata|sdata)|\[RW\]} } } */
+/* { dg-final { scan-assembler-symbol-section {^_?s$} 
{^\.(const|rodata|srodata|sdata|data.rel.ro.local)|\[RW\]} } } */
 void *const s = 
-/* { dg-final { scan-assembler-symbol-section {^_?t$} 
{^\.(const|rodata|srodata|sdata)|\[RW\]} } } */
+/* { dg-final { scan-assembler-symbol-section {^_?t$} 
{^\.(const|rodata|srodata|sdata|data.rel.ro.local)|\[RW\]} } } */
 void *const t = 
-/* { dg-final { scan-assembler-symbol-section {^_?p1$} 
{^\.(const|rodata|srodata|sdata)|\[RW\]} } } */
+/* { dg-final { scan-assembler-symbol-section {^_?p1$} 
{^\.(const|rodata|srodata|sdata|data.rel.ro.local)|\[RW\]} } } */
 void *const p1 = 
-/* { dg-final { scan-assembler-symbol-section {^_?q1$} 
{^\.(const|rodata|srodata|sdata)|\[RW\]} } } */
+/* { dg-final { scan-assembler-symbol-section {^_?q1$} 
{^\.(const|rodata|srodata|sdata|data.rel.ro.local)|\[RW\]} } } */
 void *const q1 = 
-/* { dg-final { scan-assembler-symbol-section {^_?r1$} 
{^\.(const|rodata|srodata|sdata)|\[RW\]} } } */
+/* { dg-final { scan-assembler-symbol-section {^_?r1$} 
{^\.(const|rodata|srodata|sdata|data.rel.ro.local)|\[RW\]} } } */
 void *const r1 = 
-/* { dg-final { scan-assembler-symbol-section {^_?s1$} 
{^\.(const|rodata|srodata|sdata)|\[RW\]} } } */
+/* { dg-final { scan-assembler-symbol-section {^_?s1$} 
{^\.(const|rodata|srodata|sdata|data.rel.ro.local)|\[RW\]} } } */
 void *const s1 = 
-/* { dg-final { scan-assembler-symbol-section {^_?t1$} 
{^\.(const|rodata|srodata|sdata)|\[RW\]} } } */
+/* { dg-final { scan-assembler-symbol-section {^_?t1$} 
{^\.(const|rodata|srodata|sdata|data.rel.ro.local)|\[RW\]} } } */
 void *const t1 = 


signature.asc
Description: PGP signature


[committed] Remove xfail for hppa*-*-hpux* from stdatomic-flag.c and stdatomic-flag-2.c

2024-01-16 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Remove xfail for hppa*-*-hpux* from stdatomic-flag.c and stdatomic-flag-2.c

Tests now pass on hppa64-hp-hpux11.11.

2024-01-16  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/atomic/stdatomic-flag.c: Remove xfail.
* gcc.dg/atomic/stdatomic-flag-2.c: Likewise.

diff --git a/gcc/testsuite/gcc.dg/atomic/stdatomic-flag-2.c 
b/gcc/testsuite/gcc.dg/atomic/stdatomic-flag-2.c
index aeae6b7b5ad..e4e3a6ef33d 100644
--- a/gcc/testsuite/gcc.dg/atomic/stdatomic-flag-2.c
+++ b/gcc/testsuite/gcc.dg/atomic/stdatomic-flag-2.c
@@ -1,7 +1,7 @@
 /* Test atomic_flag routines for existence and execution.  Out-of-line
function calls.  */
 /* The test needs a lockless atomic implementation.  */
-/* { dg-do run { xfail hppa*-*-hpux* } } */
+/* { dg-do run } */
 /* { dg-options "-std=c11 -pedantic-errors" } */
 
 #include 
diff --git a/gcc/testsuite/gcc.dg/atomic/stdatomic-flag.c 
b/gcc/testsuite/gcc.dg/atomic/stdatomic-flag.c
index 515d5d8dd5a..bd28ba56c24 100644
--- a/gcc/testsuite/gcc.dg/atomic/stdatomic-flag.c
+++ b/gcc/testsuite/gcc.dg/atomic/stdatomic-flag.c
@@ -1,6 +1,6 @@
 /* Test atomic_flag routines for existence and execution.  */
 /* The test needs a lockless atomic implementation.  */
-/* { dg-do run { xfail hppa*-*-hpux* } } */
+/* { dg-do run } */
 /* { dg-options "-std=c11 -pedantic-errors" } */
 
 #include 


signature.asc
Description: PGP signature


[committed] xfail scan-tree-dump-not throw in g++.dg/pr99966.C on hppa*64*-*-*

2024-01-16 Thread John David Anglin
Tested on hppa64-hpux11.11.  Committed to trunk.

Dave
---

xfail scan-tree-dump-not throw in g++.dg/pr99966.C on hppa*64*-*-*

2024-01-16  John David Anglin  

gcc/testsuite/ChangeLog:

PR tree-optimization/110794
* g++.dg/pr99966.C: xfail scan-tree-dump-not throw on hppa*64*-*-*.

diff --git a/gcc/testsuite/g++.dg/pr99966.C b/gcc/testsuite/g++.dg/pr99966.C
index 4d689822b87..d111c0acf11 100644
--- a/gcc/testsuite/g++.dg/pr99966.C
+++ b/gcc/testsuite/g++.dg/pr99966.C
@@ -20,4 +20,4 @@ uint64_t f(std::vector& data, size_t start, size_t 
end){
 return total;
 }
 
-/* { dg-final { scan-tree-dump-not "throw" "vrp1"} } */
+/* { dg-final { scan-tree-dump-not "throw" "vrp1" { xfail hppa*64*-*-* } } } */


signature.asc
Description: PGP signature


[committed] Require target lto in several tests

2024-01-16 Thread John David Anglin
Tested on hppa64-hp-hpux11.11 with lto disabled.  Committed to trunk.

Dave
---

Require target lto in several tests

2024-01-16  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/c23-tag-alias-2.c: Require target lto.
* gcc.dg/c23-tag-alias-3.c: Likewise.
* gcc.dg/gnu23-tag-alias-3.c: Likewise.
* gcc.dg/scantest-lto.c: Likewise.

diff --git a/gcc/testsuite/gcc.dg/c23-tag-alias-2.c 
b/gcc/testsuite/gcc.dg/c23-tag-alias-2.c
index 64ff67d8552..1a4097b629d 100644
--- a/gcc/testsuite/gcc.dg/c23-tag-alias-2.c
+++ b/gcc/testsuite/gcc.dg/c23-tag-alias-2.c
@@ -1,4 +1,4 @@
-/* { dg-do run }
+/* { dg-do run { target lto } }
  * { dg-options "-std=c23 -flto -O2" }
  */
 
diff --git a/gcc/testsuite/gcc.dg/c23-tag-alias-3.c 
b/gcc/testsuite/gcc.dg/c23-tag-alias-3.c
index b9fe6f3b407..76bc4dfcd23 100644
--- a/gcc/testsuite/gcc.dg/c23-tag-alias-3.c
+++ b/gcc/testsuite/gcc.dg/c23-tag-alias-3.c
@@ -1,4 +1,4 @@
-/* { dg-do run }
+/* { dg-do run { target lto } }
  * { dg-options "-std=c23 -O2" }
  */
 
diff --git a/gcc/testsuite/gcc.dg/gnu23-tag-alias-3.c 
b/gcc/testsuite/gcc.dg/gnu23-tag-alias-3.c
index c2fd4e930ef..9d7e7e11c7f 100644
--- a/gcc/testsuite/gcc.dg/gnu23-tag-alias-3.c
+++ b/gcc/testsuite/gcc.dg/gnu23-tag-alias-3.c
@@ -1,4 +1,4 @@
-/* { dg-do run }
+/* { dg-do run { target lto } }
  * { dg-options "-std=gnu23 -flto -O2" }
  */
 
diff --git a/gcc/testsuite/gcc.dg/scantest-lto.c 
b/gcc/testsuite/gcc.dg/scantest-lto.c
index 5f8abaf77f3..46c21f20bfc 100644
--- a/gcc/testsuite/gcc.dg/scantest-lto.c
+++ b/gcc/testsuite/gcc.dg/scantest-lto.c
@@ -1,3 +1,4 @@
+/* { dg-do compile { target lto } }
 /* { dg-options "-O2 -flto" } */
 
 void foo ()


signature.asc
Description: PGP signature


[committed] Skip various cmp-mem-const tests on lp64 hppa*-*-*

2024-01-16 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Skip various cmp-mem-const tests on lp64 hppa*-*-*

Prior optimization already reduced the constant.

2024-01-16  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/cmp-mem-const-3.c: Skip on lp64 hppa*-*-*.
* gcc.dg/cmp-mem-const-4.c: Likewise.
* gcc.dg/cmp-mem-const-5.c: Likewise.
* gcc.dg/cmp-mem-const-6.c: Likewise.

diff --git a/gcc/testsuite/gcc.dg/cmp-mem-const-3.c 
b/gcc/testsuite/gcc.dg/cmp-mem-const-3.c
index c60ecdb4026..5469f10712e 100644
--- a/gcc/testsuite/gcc.dg/cmp-mem-const-3.c
+++ b/gcc/testsuite/gcc.dg/cmp-mem-const-3.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { lp64 && { ! sparc*-*-* } } } } */
+/* { dg-do compile { target { lp64 && { ! { sparc*-*-* hppa*-*-* } } } } } */
 /* Excluding sparc since there we do not end up with a comparison of memory and
a constant which means that the optimization is not applicable.  */
 /* { dg-options "-O2 -fdump-rtl-combine-details" } */
diff --git a/gcc/testsuite/gcc.dg/cmp-mem-const-4.c 
b/gcc/testsuite/gcc.dg/cmp-mem-const-4.c
index 7aa403d76d9..9ea094e20eb 100644
--- a/gcc/testsuite/gcc.dg/cmp-mem-const-4.c
+++ b/gcc/testsuite/gcc.dg/cmp-mem-const-4.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { lp64 && { ! sparc*-*-* } } } } */
+/* { dg-do compile { target { lp64 && { ! { sparc*-*-* hppa*-*-* } } } } } */
 /* Excluding sparc since there we do not end up with a comparison of memory and
a constant which means that the optimization is not applicable.  */
 /* { dg-options "-O2 -fdump-rtl-combine-details" } */
diff --git a/gcc/testsuite/gcc.dg/cmp-mem-const-5.c 
b/gcc/testsuite/gcc.dg/cmp-mem-const-5.c
index 4316dcb5605..5a9096ef84d 100644
--- a/gcc/testsuite/gcc.dg/cmp-mem-const-5.c
+++ b/gcc/testsuite/gcc.dg/cmp-mem-const-5.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { lp64 && { ! sparc*-*-* } } } } */
+/* { dg-do compile { target { lp64 && { ! { sparc*-*-* hppa*-*-* } } } } } */
 /* Excluding sparc since there a prior optimization already reduced the
constant, i.e., nothing left for us.  */
 /* { dg-options "-O2 -fdump-rtl-combine-details" } */
diff --git a/gcc/testsuite/gcc.dg/cmp-mem-const-6.c 
b/gcc/testsuite/gcc.dg/cmp-mem-const-6.c
index d9046af79eb..381195361e0 100644
--- a/gcc/testsuite/gcc.dg/cmp-mem-const-6.c
+++ b/gcc/testsuite/gcc.dg/cmp-mem-const-6.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { lp64 && { ! sparc*-*-* } } } } */
+/* { dg-do compile { target { lp64 && { ! { sparc*-*-* hppa*-*-* } } } } } */
 /* Excluding sparc since there a prior optimization already reduced the
constant, i.e., nothing left for us.  */
 /* { dg-options "-O2 -fdump-rtl-combine-details" } */


signature.asc
Description: PGP signature


[committed] xfail all scan-tree-dump-times checks on hppa*64*-*-* in sra-17.c and sra-18.c

2024-01-16 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

xfail all scan-tree-dump-times checks on hppa*64*-*-* in sra-17.c and sra-18.c

2024-01-16  John David Anglin  

gcc/testsuite/ChangeLog:

PR tree-optimization/91624
* gcc.dg/tree-ssa/sra-17.c: xfail all scan-tree-dump-times
checks on hppa*64*-*-*.
* gcc.dg/tree-ssa/sra-18.c: Likewise.

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/sra-17.c 
b/gcc/testsuite/gcc.dg/tree-ssa/sra-17.c
index b0d4811e77b..f1c74274b30 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/sra-17.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/sra-17.c
@@ -17,5 +17,5 @@ main (int argc, char **argv)
   abort ();
 }
 
-/* { dg-final { scan-tree-dump-times "Removing load: a = \\\*.?L.?C.?.?.?0;" 1 
"esra" } } */
-/* { dg-final { scan-tree-dump-times "SR\[.$\]\[0-9_\]+ = 
\\\*.?L.?C.?.?.?0\\\[" 4 "esra" } } */
+/* { dg-final { scan-tree-dump-times "Removing load: a = \\\*.?L.?C.?.?.?0;" 1 
"esra" { xfail hppa*64*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "SR\[.$\]\[0-9_\]+ = 
\\\*.?L.?C.?.?.?0\\\[" 4 "esra" { xfail hppa*64*-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/sra-18.c 
b/gcc/testsuite/gcc.dg/tree-ssa/sra-18.c
index 2cdeae6e9e7..3077485a8db 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/sra-18.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/sra-18.c
@@ -23,8 +23,8 @@ main (int argc, char **argv)
   abort ();
 }
 
-/* { dg-final { scan-tree-dump-times "Removing load: a = \\\*.?L.?C.?.?.?0;" 1 
"esra" } } */
-/* { dg-final { scan-tree-dump-times "SR\[.$\]\[0-9_\]+ = 
\\\*.?L.?C.?.?.?0\\.b\\\[0\\\]\\.f\\\[0\\\]\\.x" 1 "esra" } } */
-/* { dg-final { scan-tree-dump-times "SR\[.$\]\[0-9_\]+ = 
\\\*.?L.?C.?.?.?0\\.b\\\[0\\\]\\.f\\\[1\\\]\\.x" 1 "esra" } } */
-/* { dg-final { scan-tree-dump-times "SR\[.$\]\[0-9_\]+ = 
\\\*.?L.?C.?.?.?0\\.b\\\[1\\\]\\.f\\\[0\\\]\\.x" 1 "esra" } } */
-/* { dg-final { scan-tree-dump-times "SR\[.$\]\[0-9_\]+ = 
\\\*.?L.?C.?.?.?0\\.b\\\[1\\\]\\.f\\\[1\\\]\\.x" 1 "esra" } } */
+/* { dg-final { scan-tree-dump-times "Removing load: a = \\\*.?L.?C.?.?.?0;" 1 
"esra" { xfail hppa*64*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "SR\[.$\]\[0-9_\]+ = 
\\\*.?L.?C.?.?.?0\\.b\\\[0\\\]\\.f\\\[0\\\]\\.x" 1 "esra" { xfail hppa*64*-*-* 
} } } */
+/* { dg-final { scan-tree-dump-times "SR\[.$\]\[0-9_\]+ = 
\\\*.?L.?C.?.?.?0\\.b\\\[0\\\]\\.f\\\[1\\\]\\.x" 1 "esra" { xfail hppa*64*-*-* 
} } } */
+/* { dg-final { scan-tree-dump-times "SR\[.$\]\[0-9_\]+ = 
\\\*.?L.?C.?.?.?0\\.b\\\[1\\\]\\.f\\\[0\\\]\\.x" 1 "esra" { xfail hppa*64*-*-* 
} } } */
+/* { dg-final { scan-tree-dump-times "SR\[.$\]\[0-9_\]+ = 
\\\*.?L.?C.?.?.?0\\.b\\\[1\\\]\\.f\\\[1\\\]\\.x" 1 "esra" { xfail hppa*64*-*-* 
} } } */


signature.asc
Description: PGP signature


[committed] Disable tests for strdup/strndup on __hpux__ in various builtin-object-size tests

2024-01-14 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Disable tests for strdup/strndup on __hpux__

hppa*-*-hpux* doesn't have strdup or strndup.

2024-01-14  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/builtin-object-size-1.c: Disable tests for strdup/strndup
on __hpux__.
* gcc.dg/builtin-object-size-2.c: Likewise.
* gcc.dg/builtin-object-size-3.c: Likewise.
* gcc.dg/builtin-object-size-4.c: Likewise.

diff --git a/gcc/testsuite/gcc.dg/builtin-object-size-1.c 
b/gcc/testsuite/gcc.dg/builtin-object-size-1.c
index 64c4bc4da39..4f7d4c0b370 100644
--- a/gcc/testsuite/gcc.dg/builtin-object-size-1.c
+++ b/gcc/testsuite/gcc.dg/builtin-object-size-1.c
@@ -621,7 +621,7 @@ test10 (void)
 }
 }
 
-#ifndef __AVR__ /* avr has no strndup */
+#if !defined(__AVR__) && !defined(__hpux__) /* avr and hpux have no strndup */
 /* Tests for strdup/strndup.  */
 size_t
 __attribute__ ((noinline))
@@ -726,7 +726,7 @@ main (void)
   test8 ();
   test9 (1);
   test10 ();
-#ifndef __AVR__ /* avr has no strndup */
+#if !defined(__AVR__) && !defined(__hpux__) /* avr and hpux have no strndup */
   test11 ();
 #endif
   DONE ();
diff --git a/gcc/testsuite/gcc.dg/builtin-object-size-2.c 
b/gcc/testsuite/gcc.dg/builtin-object-size-2.c
index da10b6b0632..37d3dcc6f56 100644
--- a/gcc/testsuite/gcc.dg/builtin-object-size-2.c
+++ b/gcc/testsuite/gcc.dg/builtin-object-size-2.c
@@ -536,7 +536,7 @@ test8 (unsigned cond)
 #endif
 }
 
-#ifndef __AVR__ /* avr has no strndup */
+#if !defined(__AVR__) && !defined(__hpux__) /* avr and hpux have no strndup */
 /* Tests for strdup/strndup.  */
 size_t
 __attribute__ ((noinline))
@@ -639,7 +639,7 @@ main (void)
   test6 ();
   test7 ();
   test8 (1);
-#ifndef __AVR__ /* avr has no strndup */
+#if !defined(__AVR__) && !defined(__hpux__) /* avr and hpux have no strndup */
   test9 ();
 #endif
   DONE ();
diff --git a/gcc/testsuite/gcc.dg/builtin-object-size-3.c 
b/gcc/testsuite/gcc.dg/builtin-object-size-3.c
index f23873bec38..f4d1ebf7027 100644
--- a/gcc/testsuite/gcc.dg/builtin-object-size-3.c
+++ b/gcc/testsuite/gcc.dg/builtin-object-size-3.c
@@ -628,7 +628,7 @@ test10 (void)
 }
 }
 
-#ifndef __AVR__ /* avr has no strndup */
+#if !defined(__AVR__) && !defined(__hpux__) /* avr and hpux have no strndup */
 /* Tests for strdup/strndup.  */
 size_t
 __attribute__ ((noinline))
@@ -734,7 +734,7 @@ main (void)
   test8 ();
   test9 (1);
   test10 ();
-#ifndef __AVR__ /* avr has no strndup */
+#if !defined(__AVR__) && !defined(__hpux__) /* avr and hpux have no strndup */
   test11 ();
 #endif
   DONE ();
diff --git a/gcc/testsuite/gcc.dg/builtin-object-size-4.c 
b/gcc/testsuite/gcc.dg/builtin-object-size-4.c
index dcb042f34b6..2887dd15042 100644
--- a/gcc/testsuite/gcc.dg/builtin-object-size-4.c
+++ b/gcc/testsuite/gcc.dg/builtin-object-size-4.c
@@ -509,7 +509,7 @@ test8 (unsigned cond)
 #endif
 }
 
-#ifndef __AVR__ /* avr has no strndup */
+#if !defined(__AVR__) && !defined(__hpux__) /* avr and hpux have no strndup */
 /* Tests for strdup/strndup.  */
 size_t
 __attribute__ ((noinline))
@@ -612,7 +612,7 @@ main (void)
   test6 ();
   test7 ();
   test8 (1);
-#ifndef __AVR__ /* avr has no strndup */
+#if !defined(__AVR__) && !defined(__hpux__) /* avr and hpux have no strndup */
   test9 ();
 #endif
   DONE ();


signature.asc
Description: PGP signature


[committed] Skip several gcc.dg/builtin-dynamic-object-size tests on hppa*-*-hpux*

2024-01-14 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Skip several gcc.dg/builtin-dynamic-object-size tests on hppa*-*-hpux*

hppa*-*-hpux* doesn't have strdup or strndup.

2024-01-14  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/builtin-dynamic-object-size-0.c: Skip on hppa*-*-hpux*.
* gcc.dg/builtin-dynamic-object-size-1.c: Likewise.
* gcc.dg/builtin-dynamic-object-size-2.c: Likewise.
* gcc.dg/builtin-dynamic-object-size-3.c: Likewise.
* gcc.dg/builtin-dynamic-object-size-4.c: Likewise.

diff --git a/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-0.c 
b/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-0.c
index c3ac6230d4d..173e7c755f4 100644
--- a/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-0.c
+++ b/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-0.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2" } */
 /* { dg-require-effective-target size20plus } */
+/* { dg-skip-if "no strndup" { hppa*-*-hpux* } } */
 
 #include "builtin-object-size-common.h"
 
diff --git a/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-1.c 
b/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-1.c
index 8f17c8edcaf..ffa59985024 100644
--- a/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-1.c
+++ b/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-1.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -Wno-stringop-overread" } */
 /* { dg-require-effective-target alloca } */
+/* { dg-skip-if "no strndup" { hppa*-*-hpux* } } */
 
 #define __builtin_object_size __builtin_dynamic_object_size
 #include "builtin-object-size-1.c"
diff --git a/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-2.c 
b/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-2.c
index 3677782ff1c..fff32da7aea 100644
--- a/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-2.c
+++ b/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-2.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -Wno-stringop-overread" } */
 /* { dg-require-effective-target alloca } */
+/* { dg-skip-if "no strndup" { hppa*-*-hpux* } } */
 
 #define __builtin_object_size __builtin_dynamic_object_size
 #include "builtin-object-size-2.c"
diff --git a/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-3.c 
b/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-3.c
index 5b6987b7773..ac223d67b10 100644
--- a/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-3.c
+++ b/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-3.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -Wno-stringop-overread" } */
 /* { dg-require-effective-target alloca } */
+/* { dg-skip-if "no strndup" { hppa*-*-hpux* } } */
 
 #define __builtin_object_size __builtin_dynamic_object_size
 #include "builtin-object-size-3.c"
diff --git a/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-4.c 
b/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-4.c
index 9d796224e96..fdf4284ae11 100644
--- a/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-4.c
+++ b/gcc/testsuite/gcc.dg/builtin-dynamic-object-size-4.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -Wno-stringop-overread" } */
 /* { dg-require-effective-target alloca } */
+/* { dg-skip-if "no strndup" { hppa*-*-hpux* } } */
 
 #define __builtin_object_size __builtin_dynamic_object_size
 #include "builtin-object-size-4.c"


signature.asc
Description: PGP signature


[committed] Fix dg-warning on hppa*64*-*-*

2024-01-14 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Fix dg-warning on hppa*64*-*-*

2024-01-14  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/Wattributes-6.c: Fix dg-warning on hppa*64*-*-*.

diff --git a/gcc/testsuite/gcc.dg/Wattributes-6.c 
b/gcc/testsuite/gcc.dg/Wattributes-6.c
index 978f3f938e9..49a085def9e 100644
--- a/gcc/testsuite/gcc.dg/Wattributes-6.c
+++ b/gcc/testsuite/gcc.dg/Wattributes-6.c
@@ -408,7 +408,7 @@ finline_hot_noret_align (int);  /* { dg-warning "ignoring 
attribute .warn_unused
/* { dg-note"previous declaration here" "" 
{ target *-*-* } .-1 } */
 
 inline int ATTR ((aligned (4)))
-  finline_hot_noret_align (int);  /* { dg-warning "ignoring attribute .aligned 
\\(4\\). because it conflicts with attribute .aligned \\(8\\)." "" { target { ! 
{ hppa*64*-*-* } } } } */
+  finline_hot_noret_align (int);  /* { dg-warning "ignoring attribute .aligned 
\\(4\\). because it conflicts with attribute .aligned \\(8\\)." "" } */
 
 inline int ATTR ((aligned (8)))
 finline_hot_noret_align (int);  /* { dg-note   "previous declaration here" } */


signature.asc
Description: PGP signature


[committed] Skip several analyzer socket tests on hppa*-*-hpux*

2024-01-14 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Skip several analyzer socket tests on hppa*-*-hpux*

2024-01-14  John David Anglin  

gcc/testsuite/ChangeLog:

PR analyzer/113150
* c-c++-common/analyzer/fd-glibc-byte-stream-socket.c: Skip
on hppa*-*-hpux*.
* c-c++-common/analyzer/fd-manpage-getaddrinfo-client.c: Likewise.
* c-c++-common/analyzer/fd-mappage-getaddrinfo-server.c: Likewise.
* c-c++-common/analyzer/fd-symbolic-socket.c: Likewise.
* gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c: Likewise.

diff --git a/gcc/testsuite/c-c++-common/analyzer/fd-glibc-byte-stream-socket.c 
b/gcc/testsuite/c-c++-common/analyzer/fd-glibc-byte-stream-socket.c
index d9666f99edd..fab8426acb9 100644
--- a/gcc/testsuite/c-c++-common/analyzer/fd-glibc-byte-stream-socket.c
+++ b/gcc/testsuite/c-c++-common/analyzer/fd-glibc-byte-stream-socket.c
@@ -1,6 +1,6 @@
 /* Example from glibc manual (16.9.6).  */
 /* { dg-require-effective-target sockets } */
-/* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-skip-if "" { hppa*-*-hpux* powerpc*-*-aix* } } */
 
 #include 
 #include 
diff --git 
a/gcc/testsuite/c-c++-common/analyzer/fd-manpage-getaddrinfo-client.c 
b/gcc/testsuite/c-c++-common/analyzer/fd-manpage-getaddrinfo-client.c
index 16da9333074..21dfe977db8 100644
--- a/gcc/testsuite/c-c++-common/analyzer/fd-manpage-getaddrinfo-client.c
+++ b/gcc/testsuite/c-c++-common/analyzer/fd-manpage-getaddrinfo-client.c
@@ -28,7 +28,7 @@ the source, must acknowledge the copyright and authors of 
this work.
 
 /* { dg-require-effective-target sockets } */
 /* { dg-additional-options "-Wno-analyzer-too-complex" } */
-/* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-skip-if "" { hppa*-*-hpux* powerpc*-*-aix* } } */
 
 #include 
 #include 
diff --git 
a/gcc/testsuite/c-c++-common/analyzer/fd-mappage-getaddrinfo-server.c 
b/gcc/testsuite/c-c++-common/analyzer/fd-mappage-getaddrinfo-server.c
index c02ee6ff643..2e9cec4abf0 100644
--- a/gcc/testsuite/c-c++-common/analyzer/fd-mappage-getaddrinfo-server.c
+++ b/gcc/testsuite/c-c++-common/analyzer/fd-mappage-getaddrinfo-server.c
@@ -27,7 +27,7 @@ the source, must acknowledge the copyright and authors of 
this work.
 */
 
 /* { dg-require-effective-target sockets } */
-/* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-skip-if "" { hppa*-*-hpux* powerpc*-*-aix* } } */
 
 #include 
 #include 
diff --git a/gcc/testsuite/c-c++-common/analyzer/fd-symbolic-socket.c 
b/gcc/testsuite/c-c++-common/analyzer/fd-symbolic-socket.c
index d7dc46a2d47..32264fd9701 100644
--- a/gcc/testsuite/c-c++-common/analyzer/fd-symbolic-socket.c
+++ b/gcc/testsuite/c-c++-common/analyzer/fd-symbolic-socket.c
@@ -1,5 +1,5 @@
 /* { dg-require-effective-target sockets } */
-/* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-skip-if "" { hppa*-*-hpux* powerpc*-*-aix* } } */
 
 #include 
 #include 
diff --git 
a/gcc/testsuite/gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c 
b/gcc/testsuite/gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c
index d8b697d323e..fcbcc740170 100644
--- a/gcc/testsuite/gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c
+++ b/gcc/testsuite/gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c
@@ -1,7 +1,7 @@
 /* Example from glibc manual (16.9.7).  */
 /* { dg-require-effective-target sockets } */
 /* { dg-additional-options "-Wno-analyzer-too-complex" } */
-/* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-skip-if "" { hppa*-*-hpux* powerpc*-*-aix* } } */
 
 #include 
 #include 


signature.asc
Description: PGP signature


[committed] hppa64: Fix fmt_f_default_field_width_3.f90 and fmt_g_default_field_width_3.f90

2024-01-13 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

hppa64: Fix fmt_f_default_field_width_3.f90 and fmt_g_default_field_width_3.f90

The hppa*64*-*-hpux* target is not included in the set of fortran_real_16
targets because it doesn't have cosl.  However, these tests don't need
cosl, etc.

2024-01-13  John David Anglin  

gcc/testsuite/ChangeLog:

* gfortran.dg/fmt_f_default_field_width_3.f90: Add hppa*64*-*-hpux*
to real_16 dg-error targets.
* gfortran.dg/fmt_g_default_field_width_3.f90: Likewise.

diff --git a/gcc/testsuite/gfortran.dg/fmt_f_default_field_width_3.f90 
b/gcc/testsuite/gfortran.dg/fmt_f_default_field_width_3.f90
index 3e7d8f64d43..46f271e0c60 100644
--- a/gcc/testsuite/gfortran.dg/fmt_f_default_field_width_3.f90
+++ b/gcc/testsuite/gfortran.dg/fmt_f_default_field_width_3.f90
@@ -30,6 +30,6 @@ program test
 
 #ifdef __GFC_REAL_16__
 real_16 = 4.18
-write(buffer, fmt) ':',real_16,':' ! { dg-error "Nonnegative width 
required"  "" { target fortran_real_16 } }
+write(buffer, fmt) ':',real_16,':' ! { dg-error "Nonnegative width 
required"  "" { target { fortran_real_16 || { hppa*64*-*-hpux* } } } }
 #endif
 end
diff --git a/gcc/testsuite/gfortran.dg/fmt_g_default_field_width_3.f90 
b/gcc/testsuite/gfortran.dg/fmt_g_default_field_width_3.f90
index 95a05981941..22fe1a35d65 100644
--- a/gcc/testsuite/gfortran.dg/fmt_g_default_field_width_3.f90
+++ b/gcc/testsuite/gfortran.dg/fmt_g_default_field_width_3.f90
@@ -33,6 +33,6 @@ program test
 
 #ifdef __GFC_REAL_16__
 real_16 = 4.18
-write(buffer, fmt) ':',real_16,':' ! { dg-error "Positive width required" 
"" { target fortran_real_16 } }
+write(buffer, fmt) ':',real_16,':' ! { dg-error "Positive width required" 
"" { target { fortran_real_16 || { hppa*64*-*-hpux* } } } }
 #endif
 end


signature.asc
Description: PGP signature


[committed] xfail dg-final "Sunk statements: 5" on hppa*64*-*-*

2024-01-08 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

xfail dg-final "Sunk statements: 5" on hppa*64*-*-*

2024-01-08  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/ssa-sink-18.c: xfail dg-final "Sunk statements: 5"
on hppa*64*-*-*.

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-18.c 
b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-18.c
index 1372100882e..b199df26a0f 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-18.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-18.c
@@ -215,4 +215,4 @@ compute_on_bytes (uint8_t *in_data, int in_len, uint8_t 
*out_data, int out_len)
 base+index addressing modes, so the ip[len] address computation can't be
 made from the IV computation above.  powerpc64le similarly is affected.  */
 
- /* { dg-final { scan-tree-dump-times "Sunk statements: 5" 1 "sink2" { target 
lp64 xfail { riscv64-*-* powerpc64le-*-* } } } } */
+ /* { dg-final { scan-tree-dump-times "Sunk statements: 5" 1 "sink2" { target 
lp64 xfail { riscv64-*-* powerpc64le-*-* hppa*64*-*-* } } } } */


signature.asc
Description: PGP signature


[committed] Skip gfortran.dg/dec_math.f90 on hppa*-*-hpux*

2024-01-08 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Skip gfortran.dg/dec_math.f90 on hppa

hppa*-*-hpux* doesn't have any long double trig functions.

2024-01-08  John David Anglin  

gcc/testsuite/ChangeLog:

* gfortran.dg/dec_math.f90: Skip on hppa*-*-hpux*.

diff --git a/gcc/testsuite/gfortran.dg/dec_math.f90 
b/gcc/testsuite/gfortran.dg/dec_math.f90
index d95233a5169..393e7def88e 100644
--- a/gcc/testsuite/gfortran.dg/dec_math.f90
+++ b/gcc/testsuite/gfortran.dg/dec_math.f90
@@ -1,5 +1,6 @@
 ! { dg-options "-cpp -std=gnu" }
 ! { dg-do run { xfail i?86-*-freebsd* } }
+! { dg-skip-if "No long double libc functions" { hppa*-*-hpux* } }
 !
 ! Test extra math intrinsics formerly offered by -fdec-math,
 ! now included with -std=gnu or -std=legacy.


signature.asc
Description: PGP signature


[committed] hppa: Fix bind_c_coms.f90 and bind_c_vars.f90 tests on hppa

2024-01-08 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

hppa: Fix bind_c_coms.f90 and bind_c_vars.f90 tests on hppa

Commit 6271dd98 changed the default from -fcommon to -fno-common.
This silently changed the alignment of uninitialized BSS data on
hppa where the alignment of common data must be greater or equal
to the alignment of the largest type that will fit in the block.
For example, the alignment of `double d[2];' changed from 16 to 8
on hppa64.

The hppa architecture requires strict alignment and the linker
warns about inconsistent alignment of variables.  This change broke
the gfortran.dg/bind_c_coms.f90 and gfortran.dg/bind_c_vars.f90
tests.  These tests check whether bind_c works between fortran
and C.

Adding the -fcommon option fixes the tests.  Probably, gcc and HP
C are now by default inconsistent but that's water under the bridge.

2024-01-08  John David Anglin  

gcc/testsuite/ChangeLog:

PR testsuite/94253
* gfortran.dg/bind_c_coms.f90: Add -fcommon option on hppa*-*-*.
* gfortran.dg/bind_c_vars.f90: Likewise.

diff --git a/gcc/testsuite/gfortran.dg/bind_c_coms.f90 
b/gcc/testsuite/gfortran.dg/bind_c_coms.f90
index 85ead9fb636..2f9714947c7 100644
--- a/gcc/testsuite/gfortran.dg/bind_c_coms.f90
+++ b/gcc/testsuite/gfortran.dg/bind_c_coms.f90
@@ -3,6 +3,7 @@
 ! { dg-options "-w" }
 ! the -w option is to prevent the warning about long long ints
 module bind_c_coms
+! { dg-additional-options "-fcommon" { target hppa*-*-hpux* } }
   use, intrinsic :: iso_c_binding
   implicit none
 
diff --git a/gcc/testsuite/gfortran.dg/bind_c_vars.f90 
b/gcc/testsuite/gfortran.dg/bind_c_vars.f90
index 4f4a0cfd795..ede3ffd8c21 100644
--- a/gcc/testsuite/gfortran.dg/bind_c_vars.f90
+++ b/gcc/testsuite/gfortran.dg/bind_c_vars.f90
@@ -1,6 +1,7 @@
 ! { dg-do run }
 ! { dg-additional-sources bind_c_vars_driver.c }
 module bind_c_vars
+! { dg-additional-options "-fcommon" { target hppa*-*-hpux* } }
   use, intrinsic :: iso_c_binding
   implicit none
 


signature.asc
Description: PGP signature


[committed] hppa: Fix pr110279-1.c on hppa

2023-12-24 Thread John David Anglin
This test needs fma support.  It is only available on hppa in PA 2.0.

Tested on hppa-unknown-linux-gnu.  Committed to trunk.

Dave
---

hppa: Fix pr110279-1.c on hppa

2023-12-24  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/pr110279-1.c: Add -march=2.0 option on hppa*-*-*.

diff --git a/gcc/testsuite/gcc.dg/pr110279-1.c 
b/gcc/testsuite/gcc.dg/pr110279-1.c
index f25b6aec967..291824c0a48 100644
--- a/gcc/testsuite/gcc.dg/pr110279-1.c
+++ b/gcc/testsuite/gcc.dg/pr110279-1.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-Ofast --param avoid-fma-max-bits=512 --param 
tree-reassoc-width=4 -fdump-tree-widening_mul-details" } */
 /* { dg-additional-options "-march=armv8.2-a" { target aarch64-*-* } } */
+/* { dg-additional-options "-march=2.0" { target hppa*-*-* } } */
 
 #define LOOP_COUNT 8
 typedef double data_e;


signature.asc
Description: PGP signature


Re: [PATCH,doc] install: Drop hppa*-hp-hpux10, remove old notes on hppa*-hp-hpux11

2023-12-17 Thread John David Anglin

On 2023-12-17 2:28 a.m., Gerald Pfeifer wrote:

Hi Dave,

based on our earlier e-mail, I understand we don't support hppa*-hp-hpux10
any longer, so let's remove them from the installation docs.

On the way remove references to GCC 2.95 and 3.0 from hppa*-hp-hpux11.

Okay?

The sentence about 64-bit libffi for hpux also can be removed.  I ported it a 
few years
ago.

Otherwise, the change is okay.



(I believe it would be great if you could have a look at that part of the
installation docs. I'm pretty confident there is quite a bit more we can
garbage collect or simplify.)

Maybe I can do it tomorrow.

Dave



Gerald


gcc:
PR target/69374
* doc/install.texi (Specific) : Remove section.
(Specific) : Remove references to GCC 2.95 and 3.0.
---
  gcc/doc/install.texi | 18 --
  1 file changed, 18 deletions(-)

diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 84d8834a9b5..17cef5a2bae 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -3742,8 +3742,6 @@ information have to.
  @item
  @uref{#hppa-hp-hpux,,hppa*-hp-hpux*}
  @item
-@uref{#hppa-hp-hpux10,,hppa*-hp-hpux10}
-@item
  @uref{#hppa-hp-hpux11,,hppa*-hp-hpux11}
  @item
  @uref{#x-x-linux-gnu,,*-*-linux-gnu}
@@ -4152,27 +4150,11 @@ a list of the predefines used with each standard.
  
  More specific information to @samp{hppa*-hp-hpux*} targets follows.
  
-@html

-
-@end html
-@anchor{hppa-hp-hpux10}
-@heading hppa*-hp-hpux10
-For hpux10.20, we @emph{highly} recommend you pick up the latest sed patch
-@code{PHCO_19798} from HP@.
-
-The C++ ABI has changed incompatibly in GCC 4.0.  COMDAT subspaces are
-used for one-only code and data.  This resolves many of the previous
-problems in using C++ on this target.  However, the ABI is not compatible
-with the one implemented under HP-UX 11 using secondary definitions.
-
  @html
  
  @end html
  @anchor{hppa-hp-hpux11}
  @heading hppa*-hp-hpux11
-GCC 3.0 and up support HP-UX 11.  GCC 2.95.x is not supported and cannot
-be used to compile GCC 3.0 and up.
-
  The libffi library haven't been ported to 64-bit HP-UX@ and doesn't build.
  
  Refer to @uref{binaries.html,,binaries} for information about obtaining



--
John David Anglin  dave.ang...@bell.net



Re: [PATCH] install: Streamline the hppa*-hp-hpux* section

2023-12-16 Thread John David Anglin

Hi Gerald,

I have one comment.  The only target currently supported is hppa64-hp-hpux11*.
While gas is required, only the HP ld works.

Otherwise, the change looks fine.

Dave

On 2023-12-16 8:35 p.m., Gerald Pfeifer wrote:

John, Jeff,

I suggest to streamline the hppa*-hp-hpux* installation instructions as
follows. Okay?

In fact in the following sections there is even more, and more specific
material, which would be great could you have a look at and help trim.

Gerald



>From 52149282c3a77ccda6385f06f36323c71b26491a Mon Sep 17 00:00:00 2001
From: Gerald Pfeifer 
Date: Sun, 17 Dec 2023 09:33:40 +0800
Subject: [PATCH] install: Streamline the hppa*-hp-hpux* section

gcc:

PR target/69374
* doc/install.texi (Specific) : Remove a note on
 GCC 4.3.
Remove details on how the HP assembler, which we document as not
 working, breaks.
---
  gcc/doc/install.texi | 17 -
  1 file changed, 17 deletions(-)

diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 5ec81098d47..70d46feabf6 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -4121,8 +4121,6 @@ longer a multiple of 2 bytes.
  @end html
  @anchor{hppa-hp-hpux}
  @heading hppa*-hp-hpux*
-Support for HP-UX version 9 and older was discontinued in GCC 3.4.
-
  We require using gas/binutils on all hppa platforms.  Version 2.19 or
  later is recommended.
  
@@ -4130,21 +4128,6 @@ It may be helpful to configure GCC with the

  @uref{./configure.html#with-gnu-as,,@option{--with-gnu-as}} and
  @option{--with-as=@dots{}} options to ensure that GCC can find GAS@.
  
-The HP assembler should not be used with GCC.  It is rarely tested and may

-not work.  It shouldn't be used with any languages other than C due to its
-many limitations.
-
-Specifically, @option{-g} does not work (HP-UX uses a peculiar debugging
-format which GCC does not know about).  It also inserts timestamps
-into each object file it creates, causing the 3-stage comparison test to
-fail during a bootstrap.  You should be able to continue by saying
-@samp{make all-host all-target} after getting the failure from @samp{make}.
-
-Various GCC features are not supported.  For example, it does not support weak
-symbols or alias definitions.  As a result, explicit template instantiations
-are required when using C++.  This makes it difficult if not impossible to
-build many C++ applications.
-
  There are two default scheduling models for instructions.  These are
  PROCESSOR_7100LC and PROCESSOR_8000.  They are selected from the pa-risc
  architecture specified for the target machine when configuring.



--
John David Anglin  dave.ang...@bell.net



[committed] Fix c-c++-common/fhardened-[12].c test fails on hppa

2023-12-06 Thread John David Anglin
Tested on hppa-unknown-linux-gnu.  Committed to trunk.

Dave
---

Fix c-c++-common/fhardened-[12].c test fails on hppa

The -fstack-protector and -fstack-protector-strong options are
not supported on hppa since the stack grows up.

2023-12-06  John David Anglin  

gcc/testsuite/ChangeLog:

* c-c++-common/fhardened-1.c: Ignore __SSP_STRONG__ define
if __hppa__ is defined.
* c-c++-common/fhardened-2.c: Ignore __SSP__ define
if __hppa__ is defined.

diff --git a/gcc/testsuite/c-c++-common/fhardened-1.c 
b/gcc/testsuite/c-c++-common/fhardened-1.c
index 7e6740655fe..23478be76b2 100644
--- a/gcc/testsuite/c-c++-common/fhardened-1.c
+++ b/gcc/testsuite/c-c++-common/fhardened-1.c
@@ -1,7 +1,7 @@
 /* { dg-do compile { target *-*-linux* *-*-gnu* } } */
 /* { dg-options "-fhardened -O" } */
 
-#ifndef __SSP_STRONG__
+#if !defined(__SSP_STRONG__) && !defined(__hppa__)
 # error "-fstack-protector-strong not enabled"
 #endif
 
diff --git a/gcc/testsuite/c-c++-common/fhardened-2.c 
b/gcc/testsuite/c-c++-common/fhardened-2.c
index 280ff96eb15..6ac66f9f6b7 100644
--- a/gcc/testsuite/c-c++-common/fhardened-2.c
+++ b/gcc/testsuite/c-c++-common/fhardened-2.c
@@ -4,7 +4,7 @@
 #ifdef __SSP_STRONG__
 # error "-fstack-protector-strong enabled when it should not be"
 #endif
-#ifndef __SSP__
+#if !defined(__SSP__) && !defined(__hppa__)
 # error "-fstack-protector not enabled"
 #endif
 


signature.asc
Description: PGP signature


[committed] Skip analyzer strndup test on hppa*-*-hpux*

2023-11-26 Thread John David Anglin
Test on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Skip analyzer strndup test on hppa*-*-hpux*

2023-11-26  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/analyzer/strndup-1.c: Skip on hppa*-*-hpux*.

diff --git a/gcc/testsuite/gcc.dg/analyzer/strndup-1.c 
b/gcc/testsuite/gcc.dg/analyzer/strndup-1.c
index 8cf7a42bf53..85ccae85d83 100644
--- a/gcc/testsuite/gcc.dg/analyzer/strndup-1.c
+++ b/gcc/testsuite/gcc.dg/analyzer/strndup-1.c
@@ -1,4 +1,4 @@
-/* { dg-skip-if "no strndup in libc" { *-*-darwin[789]* *-*-darwin10* 
*-*-mingw* *-*-vxworks* } } */
+/* { dg-skip-if "no strndup in libc" { *-*-darwin[789]* *-*-darwin10* 
hppa*-*-hpux* *-*-mingw* *-*-vxworks* } } */
 
 #include 
 #include 


signature.asc
Description: PGP signature


[committed] Skip analyzer socket tests on hppa*-*-hpux*

2023-11-26 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Skip analyzer socket tests on hppa*-*-hpux*

2023-11-26  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/analyzer/fd-glibc-datagram-client.c: Skip on hppa*-*-hpux*.
* gcc.dg/analyzer/fd-glibc-datagram-socket.c: Likewise.

diff --git a/gcc/testsuite/gcc.dg/analyzer/fd-glibc-datagram-client.c 
b/gcc/testsuite/gcc.dg/analyzer/fd-glibc-datagram-client.c
index fa98e3c045e..6d4dc607c3d 100644
--- a/gcc/testsuite/gcc.dg/analyzer/fd-glibc-datagram-client.c
+++ b/gcc/testsuite/gcc.dg/analyzer/fd-glibc-datagram-client.c
@@ -1,6 +1,6 @@
 /* Example from the glibc manual (16.10.4).  */
 /* { dg-require-effective-target sockets } */
-/* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-skip-if "" { hppa*-*-hpux* powerpc*-*-aix* } } */
 
 #include 
 #include 
diff --git a/gcc/testsuite/gcc.dg/analyzer/fd-glibc-datagram-socket.c 
b/gcc/testsuite/gcc.dg/analyzer/fd-glibc-datagram-socket.c
index 0d4894d98e1..7e179cfe3a6 100644
--- a/gcc/testsuite/gcc.dg/analyzer/fd-glibc-datagram-socket.c
+++ b/gcc/testsuite/gcc.dg/analyzer/fd-glibc-datagram-socket.c
@@ -1,6 +1,6 @@
 /* Example from glibc manual (16.10.3).  */
 /* { dg-require-effective-target sockets } */
-/* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-skip-if "" { hppa*-*-hpux* powerpc*-*-aix* } } */
 
 #include 
 #include 


signature.asc
Description: PGP signature


[committed] hppa: Fix pr104869.C on hpux

2023-11-26 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

hppa: Fix pr104869.C on hpux

2023-11-26  John David Anglin  

gcc/testsuite/ChangeLog:

* g++.dg/pr104869.C: Add attribute visibility default to
main prototype.

diff --git a/gcc/testsuite/g++.dg/pr104869.C b/gcc/testsuite/g++.dg/pr104869.C
index 13a39fccdb9..851d65355de 100644
--- a/gcc/testsuite/g++.dg/pr104869.C
+++ b/gcc/testsuite/g++.dg/pr104869.C
@@ -69,7 +69,7 @@ struct ControlFlow {
   return false;
 }
 #ifdef __hpux__
-extern int main(void);
+extern int main(void) __attribute__ ((visibility ("default")));
 #endif
 int
 main() {


signature.asc
Description: PGP signature


[committed] hppa: Really fix g++.dg/modules/bad-mapper-1.C on hpux

2023-11-26 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

hppa: Really fix g++.dg/modules/bad-mapper-1.C on hpux

2023-11-26  John David Anglin  

gcc/testsuite/ChangeLog:

* g++.dg/modules/bad-mapper-1.C: Add hppa*-*-hpux* to dg-error
"this-will-not-work" targets.

diff --git a/gcc/testsuite/g++.dg/modules/bad-mapper-1.C 
b/gcc/testsuite/g++.dg/modules/bad-mapper-1.C
index b787023dd42..b0b0b86c9cd 100644
--- a/gcc/testsuite/g++.dg/modules/bad-mapper-1.C
+++ b/gcc/testsuite/g++.dg/modules/bad-mapper-1.C
@@ -1,6 +1,6 @@
 //  { dg-additional-options "-fmodules-ts -fmodule-mapper=|this-will-not-work" 
}
 import unique1.bob;
-// { dg-error "-:failed (exec|CreateProcess|posix_spawn).*mapper.* 
.*this-will-not-work" "" { target { ! { *-*-darwin[89]* *-*-darwin10* } } } 0 }
+// { dg-error "-:failed (exec|CreateProcess|posix_spawn).*mapper.* 
.*this-will-not-work" "" { target { ! { *-*-darwin[89]* *-*-darwin10* 
hppa*-*-hpux* } } } 0 }
 // { dg-prune-output "fatal error:" }
 // { dg-prune-output "failed to read" }
 // { dg-prune-output "compilation terminated" }


signature.asc
Description: PGP signature


[committed] hppa: Use INT14_OK_STRICT in a couple of places in pa_emit_move_sequence

2023-11-24 Thread John David Anglin
This fixes a couple of places in pa_emit_move_sequence that should
be using the INT14_OK_STRICT macro.

Tested on hppa-unknown-linux-gnu.  Committed to trunk.

Dave
---

hppa: Use INT14_OK_STRICT in a couple of places in pa_emit_move_sequence

64-bit Linux target has relocation issue and can't use 14-bit offsets.

2023-11-22  John David Anglin  

gcc/ChangeLog:

* config/pa/pa.cc (pa_emit_move_sequence): Use INT14_OK_STRICT
in a couple of places.

diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc
index 565c948a9e6..2ee987796f6 100644
--- a/gcc/config/pa/pa.cc
+++ b/gcc/config/pa/pa.cc
@@ -1872,9 +1872,7 @@ pa_emit_move_sequence (rtx *operands, machine_mode mode, 
rtx scratch_reg)
 
   if (reg_plus_base_memory_operand (op1, GET_MODE (op1)))
{
- if (!(TARGET_PA_20
-   && !TARGET_ELF32
-   && INT_14_BITS (XEXP (XEXP (op1, 0), 1)))
+ if (!(INT14_OK_STRICT && INT_14_BITS (XEXP (XEXP (op1, 0), 1)))
  && !INT_5_BITS (XEXP (XEXP (op1, 0), 1)))
{
  /* SCRATCH_REG will hold an address and maybe the actual data.
@@ -1923,9 +1921,7 @@ pa_emit_move_sequence (rtx *operands, machine_mode mode, 
rtx scratch_reg)
 
   if (reg_plus_base_memory_operand (op0, GET_MODE (op0)))
{
- if (!(TARGET_PA_20
-   && !TARGET_ELF32
-   && INT_14_BITS (XEXP (XEXP (op0, 0), 1)))
+ if (!(INT14_OK_STRICT && INT_14_BITS (XEXP (XEXP (op0, 0), 1)))
  && !INT_5_BITS (XEXP (XEXP (op0, 0), 1)))
{
  /* SCRATCH_REG will hold an address and maybe the actual data.


signature.asc
Description: PGP signature


[committed] hppa: Fix g++.dg/modules/bad-mapper-1.C on hpux

2023-11-23 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

hppa: Fix g++.dg/modules/bad-mapper-1.C on hpux

2023-11-23  John David Anglin  

gcc/testsuite/ChangeLog:

* g++.dg/modules/bad-mapper-1.C: Add hppa*-*-hpux* to dg-error
"-:failed mapper handshake communication" targets.

diff --git a/gcc/testsuite/g++.dg/modules/bad-mapper-1.C 
b/gcc/testsuite/g++.dg/modules/bad-mapper-1.C
index 53e3e1d0c88..f2ea5fbf580 100644
--- a/gcc/testsuite/g++.dg/modules/bad-mapper-1.C
+++ b/gcc/testsuite/g++.dg/modules/bad-mapper-1.C
@@ -4,6 +4,6 @@ import unique1.bob;
 // { dg-prune-output "fatal error:" }
 // { dg-prune-output "failed to read" }
 // { dg-prune-output "compilation terminated" }
-// { dg-error "-:failed mapper handshake communication" "" { target { 
*-*-darwin[89]* *-*-darwin10* } } 0 }
+// { dg-error "-:failed mapper handshake communication" "" { target { 
*-*-darwin[89]* *-*-darwin10* hppa*-*-hpux* } } 0 }
 // { dg-prune-output "trying to exec .this-will-not-work."  }
 // { dg-prune-output "unknown Compiled Module Interface"  }


signature.asc
Description: PGP signature


[committed] hppa: Fix gcc.dg/analyzer/fd-4.c on hpux

2023-11-23 Thread John David Anglin
This fixes gcc.dg/analyzer/fd-4.c on hppa64-hp-hpux11.11.  Committed
to trunk.

Dave
---

hppa: Fix gcc.dg/analyzer/fd-4.c on hpux

2023-11-23  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/analyzer/fd-4.c: Define _MODE_T on hpux.

diff --git a/gcc/testsuite/gcc.dg/analyzer/fd-4.c 
b/gcc/testsuite/gcc.dg/analyzer/fd-4.c
index 994bad84342..3a961e4f813 100644
--- a/gcc/testsuite/gcc.dg/analyzer/fd-4.c
+++ b/gcc/testsuite/gcc.dg/analyzer/fd-4.c
@@ -1,4 +1,4 @@
-#ifdef _AIX
+#if defined(_AIX) || defined(__hpux)
 #define _MODE_T
 #endif
 #include 


signature.asc
Description: PGP signature


[committed] hppa: Export main in pr104869.C on hpux

2023-11-23 Thread John David Anglin
This fixes a hpux linker warning about main not being exported.

Committed to trunk.

Dave
---

hppa: Export main in pr104869.C on hpux

This is needed to avoid a linker warning.

2023-11-23  John David Anglin  

gcc/testsuite/ChangeLog:

* g++.dg/pr104869.C: Export main on hpux.

diff --git a/gcc/testsuite/g++.dg/pr104869.C b/gcc/testsuite/g++.dg/pr104869.C
index 9a6ef88adbd..13a39fccdb9 100644
--- a/gcc/testsuite/g++.dg/pr104869.C
+++ b/gcc/testsuite/g++.dg/pr104869.C
@@ -68,6 +68,9 @@ struct ControlFlow {
 foo(2);
   return false;
 }
+#ifdef __hpux__
+extern int main(void);
+#endif
 int
 main() {
   ControlFlow cf = { nullptr, ControlFlow::UnwindType::EE };


signature.asc
Description: PGP signature


[committed] hppa: xfail scan-assembler-not check in g++.dg/cpp0x/initlist-const1.C

2023-11-23 Thread John David Anglin
The scan-assembler-not check needs to be xfailed on hppa*-*-hpux*.

Dave
---

hppa: xfail scan-assembler-not check in g++.dg/cpp0x/initlist-const1.C

2023-11-23  John David Anglin  

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/initlist-const1.C: xfail scan-assembler-not
check on hppa*-*-hpux*.

diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist-const1.C 
b/gcc/testsuite/g++.dg/cpp0x/initlist-const1.C
index 0da07592f75..260448aa630 100644
--- a/gcc/testsuite/g++.dg/cpp0x/initlist-const1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist-const1.C
@@ -6,4 +6,4 @@
 
 const auto x = { 1, 2 };
 
-// { dg-final { scan-assembler-not {\.data} { xfail powerpc-ibm-aix* } } }
+// { dg-final { scan-assembler-not {\.data} { xfail hppa*-*-hpux* 
powerpc-ibm-aix* } } }


signature.asc
Description: PGP signature


[committed] hppa: Don't skip check for warning at line 411 in Wattributes.c on hppa*64*-*-*

2023-11-23 Thread John David Anglin
The warning is now properly generated.

Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Don't skip check for warning at line 411 in Wattributes.c on hppa*64*-*-*

2023-11-23  John David Anglin  

gcc/testsuite/ChangeLog:

* c-c++-common/Wattributes.c: Don't skip check for warning
at line 411 in Wattributes.c on hppa*64*-*-*.

diff --git a/gcc/testsuite/c-c++-common/Wattributes.c 
b/gcc/testsuite/c-c++-common/Wattributes.c
index 978f3f938e9..49a085def9e 100644
--- a/gcc/testsuite/c-c++-common/Wattributes.c
+++ b/gcc/testsuite/c-c++-common/Wattributes.c
@@ -408,7 +408,7 @@ finline_hot_noret_align (int);  /* { dg-warning "ignoring 
attribute .warn_unused
/* { dg-note"previous declaration here" "" 
{ target *-*-* } .-1 } */
 
 inline int ATTR ((aligned (4)))
-  finline_hot_noret_align (int);  /* { dg-warning "ignoring attribute .aligned 
\\(4\\). because it conflicts with attribute .aligned \\(8\\)." "" { target { ! 
{ hppa*64*-*-* } } } } */
+  finline_hot_noret_align (int);  /* { dg-warning "ignoring attribute .aligned 
\\(4\\). because it conflicts with attribute .aligned \\(8\\)." "" } */
 
 inline int ATTR ((aligned (8)))
 finline_hot_noret_align (int);  /* { dg-note   "previous declaration here" } */


signature.asc
Description: PGP signature


[committed] hppa: Define MAX_FIXED_MODE_SIZE

2023-11-22 Thread John David Anglin
Tested on hppa-unknown-linux-gnu and hppa64-hp-hpux11.11.  Committed to
trunk.

Fixes FAIL: c-c++-common/pr111309-1.c ICE.

Dave
---

hppa: Define MAX_FIXED_MODE_SIZE

Replace default define.  We support TImode when TARGET_64BIT is true.

2023-11-22  John David Anglin  

gcc/ChangeLog:

PR target/112592
* config/pa/pa.h (MAX_FIXED_MODE_SIZE): Define.

diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index aba2cec7357..d73428682e7 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -1310,3 +1310,7 @@ do {  
 \
 
 /* Output default function prologue for hpux.  */
 #define TARGET_ASM_FUNCTION_PROLOGUE pa_output_function_prologue
+
+/* An integer expression for the size in bits of the largest integer machine
+   mode that should actually be used.  We allow pairs of registers.  */
+#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TARGET_64BIT ? TImode : DImode)


signature.asc
Description: PGP signature


[committed] hppa: Fix integer REG+D address reloads

2023-11-22 Thread John David Anglin
Tested on hppa-unknown-linux-gnu and hppa64-hp-hpux11.11.  Fixes testcase
in PR.  Committed to trunk.

Dave
---

hppa: Fix integer REG+D address reloads

I made a mistake in the previous change to integer_store_memory_operand.
There is no support pa_emit_move sequence to handle secondary reloads of
integer REG+D instructions.  Further, the Q constraint is used for some
non-simple instructions (movb and addib).  Thus, we need to return true
when reload is in progress.

2023-11-22  John David Anglin  

gcc/ChangeLog:

PR target/112617
* config/pa/predicates.md (integer_store_memory_operand): Return
true for REG+D addresses when reload_in_progress is true.

diff --git a/gcc/config/pa/predicates.md b/gcc/config/pa/predicates.md
index 1b50020e1de..4c07c0a3828 100644
--- a/gcc/config/pa/predicates.md
+++ b/gcc/config/pa/predicates.md
@@ -308,6 +308,13 @@
 
   if (reg_plus_base_memory_operand (op, mode))
 {
+  /* There is no support for handling secondary reloads of integer
+REG+D instructions in pa_emit_move_sequence.  Further, the Q
+constraint is used in more than simple move instructions.  So,
+we must return true and let reload handle the reload.  */
+  if (reload_in_progress)
+   return true;
+
   /* Extract CONST_INT operand.  */
   if (GET_CODE (op) == SUBREG)
op = SUBREG_REG (op);


signature.asc
Description: PGP signature


Re: [committed] hppa: Revise REG+D address support to allow long displacements before reload

2023-11-17 Thread John David Anglin

On 2023-11-16 10:00 p.m., Jeff Law wrote:

I'm not seeing any obvious problems in the gcc testsuite.  It needs testing on 
packages that do extensive
floating point calculations.


OK, I'll focus on those.
THe more likely scenario is xmpy which is used for integer multiply, but the operands have to be moved into FP registers because the operation 
happens in the FPU.

There are lots of xmpyu instructions in cc1 and cc1plus.  For example,

  9fee8c:   08 03 02 5c copy r3,ret0
  9fee90:   37 9c 00 20 ldo 10(ret0),ret0
  9fee94:   27 80 10 17 fldw 0(ret0),fr23
  9fee98:   08 03 02 5c copy r3,ret0
  9fee9c:   37 9c 00 28 ldo 14(ret0),ret0
  9feea0:   27 80 10 16 fldw 0(ret0),fr22
  9feea4:   3a f6 47 18 xmpyu fr23,fr22,fr24
  9feea8:   2f c1 12 18 fstd fr24,-10(sp)
  9feeac:   0f c1 10 9c ldw -10(sp),ret0
  9feeb0:   0f c9 10 9d ldw -c(sp),ret1

There are 2169 xmpyu instructions in cc1plus in my current gcc bootstrap on 
linux.

Dave

--
John David Anglin  dave.ang...@bell.net



Re: [committed] hppa: Revise REG+D address support to allow long displacements before reload

2023-11-16 Thread John David Anglin

On 2023-11-16 4:52 p.m., Jeff Law wrote:



On 11/16/23 10:54, John David Anglin wrote:

Tested on hppa-unknown-linux-gnu and hppa64-hp-hpux11.11.  Committed
to trunk.

This patch works around problem compiling python3.11 by improving
REG+D address handling.  The change results in smaller code and
reduced register pressure.

Dave
---

hppa: Revise REG+D address support to allow long displacements before reload

In analyzing PR rtl-optimization/112415, I realized that restricting
REG+D offsets to 5-bits before reload results in very poor code and
complexities in optimizing these instructions after reload.  The
general problem is long displacements are not allowed for floating
point accesses when generating PA 1.1 code.  Even with PA 2.0, there
is a ELF linker bug that prevents using long displacements for
floating point loads and stores.

In the past, enabling long displacements before reload caused issues
in reload.  However, there have been fixes in the handling of reloads
for floating-point accesses.  This change allows long displacements
before reload and corrects a couple of issues in the constraint
handling for integer and floating-point accesses.

2023-11-16  John David Anglin  

gcc/ChangeLog:

PR rtl-optimization/112415
* config/pa/pa.cc (pa_legitimate_address_p): Allow 14-bit
displacements before reload.  Simplify logic flow.  Revise
comments.
* config/pa/pa.h (TARGET_ELF64): New define.
(INT14_OK_STRICT): Update define and comment.
* config/pa/pa64-linux.h (TARGET_ELF64): Define.
* config/pa/predicates.md (base14_operand): Don't check
alignment of short displacements.
(integer_store_memory_operand): Don't return true when
reload_in_progress is true.  Remove INT_5_BITS check.
(floating_point_store_memory_operand): Don't return true when
reload_in_progress is true.  Use INT14_OK_STRICT to check
whether long displacements are always okay.

I strongly suspect this is going to cause problems in the end.

I've already done what you're trying to do.  It'll likely look fine for an 
extended period of time, but it will almost certainly break one day.

I could happen.  If it happens and can't be fixed, it's easy enough to return 
false in
pa_legitimate_address_p before reload.  Maybe we could add an optimization 
option for this.

As it stands, the code improvement for python is significant.  I don't think 
f-m-o can fix things after reload.

Hopefully, Sam will test the change with various package builds on gentoo.  
Debian is still on gcc-13.
I'm not seeing any obvious problems in the gcc testsuite.  It needs testing on 
packages that do extensive
floating point calculations.

Dave

--
John David Anglin  dave.ang...@bell.net



[committed] hppa: Revise REG+D address support to allow long displacements before reload

2023-11-16 Thread John David Anglin
Tested on hppa-unknown-linux-gnu and hppa64-hp-hpux11.11.  Committed
to trunk.

This patch works around problem compiling python3.11 by improving
REG+D address handling.  The change results in smaller code and
reduced register pressure.

Dave
---

hppa: Revise REG+D address support to allow long displacements before reload

In analyzing PR rtl-optimization/112415, I realized that restricting
REG+D offsets to 5-bits before reload results in very poor code and
complexities in optimizing these instructions after reload.  The
general problem is long displacements are not allowed for floating
point accesses when generating PA 1.1 code.  Even with PA 2.0, there
is a ELF linker bug that prevents using long displacements for
floating point loads and stores.

In the past, enabling long displacements before reload caused issues
in reload.  However, there have been fixes in the handling of reloads
for floating-point accesses.  This change allows long displacements
before reload and corrects a couple of issues in the constraint
handling for integer and floating-point accesses.

2023-11-16  John David Anglin  

gcc/ChangeLog:

PR rtl-optimization/112415
* config/pa/pa.cc (pa_legitimate_address_p): Allow 14-bit
displacements before reload.  Simplify logic flow.  Revise
comments.
* config/pa/pa.h (TARGET_ELF64): New define.
(INT14_OK_STRICT): Update define and comment.
* config/pa/pa64-linux.h (TARGET_ELF64): Define.
* config/pa/predicates.md (base14_operand): Don't check
alignment of short displacements.
(integer_store_memory_operand): Don't return true when
reload_in_progress is true.  Remove INT_5_BITS check.
(floating_point_store_memory_operand): Don't return true when
reload_in_progress is true.  Use INT14_OK_STRICT to check
whether long displacements are always okay.

diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc
index 218c48b4ae0..565c948a9e6 100644
--- a/gcc/config/pa/pa.cc
+++ b/gcc/config/pa/pa.cc
@@ -10819,23 +10819,29 @@ pa_legitimate_address_p (machine_mode mode, rtx x, 
bool strict, code_helper)
 
   if (GET_CODE (index) == CONST_INT)
{
+ /* Short 5-bit displacements always okay.  */
  if (INT_5_BITS (index))
return true;
 
- /* When INT14_OK_STRICT is false, a secondary reload is needed
-to adjust the displacement of SImode and DImode floating point
-instructions but this may fail when the register also needs
-reloading.  So, we return false when STRICT is true.  We
-also reject long displacements for float mode addresses since
-the majority of accesses will use floating point instructions
-that don't support 14-bit offsets.  */
- if (!INT14_OK_STRICT
- && (strict || !(reload_in_progress || reload_completed))
- && mode != QImode
- && mode != HImode)
+ if (!base14_operand (index, mode))
return false;
 
- return base14_operand (index, mode);
+ /* Long 14-bit displacements always okay for these cases.  */
+ if (INT14_OK_STRICT
+ || mode == QImode
+ || mode == HImode)
+   return true;
+
+ /* A secondary reload may be needed to adjust the displacement
+of floating-point accesses when STRICT is nonzero.  */
+ if (strict)
+   return false;
+
+ /* We get significantly better code if we allow long displacements
+before reload for all accesses.  Instructions must satisfy their
+constraints after reload, so we must have an integer access.
+Return true for both cases.  */
+ return true;
}
 
   if (!TARGET_DISABLE_INDEXING
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index e65af522966..aba2cec7357 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -37,6 +37,11 @@ extern unsigned long total_code_bytes;
 #define TARGET_ELF32 0
 #endif
 
+/* Generate code for ELF64 ABI.  */
+#ifndef TARGET_ELF64
+#define TARGET_ELF64 0
+#endif
+
 /* Generate code for SOM 32bit ABI.  */
 #ifndef TARGET_SOM
 #define TARGET_SOM 0
@@ -823,12 +828,11 @@ extern int may_call_alloca;
 
 /* Nonzero if 14-bit offsets can be used for all loads and stores.
This is not possible when generating PA 1.x code as floating point
-   loads and stores only support 5-bit offsets.  Note that we do not
-   forbid the use of 14-bit offsets for integer modes.  Instead, we
-   use secondary reloads to fix REG+D memory addresses for integer
-   mode floating-point loads and stores.
+   accesses only support 5-bit offsets.  Note that we do not forbid
+   the use of 14-bit offsets prior to reload.  Instead, we use secondary
+   reloads to fix REG+D memory addresses for floating-point accesses.
 
-   FIXME: the ELF32 linker clobbers the LSB of the FP register number
+   F

[committed] hppa: Fix typo in PA 2.0 trampoline template

2023-11-06 Thread John David Anglin
Noticed in glibc testsuite.  Committed to active branches.

Dave
---

hppa: Fix typo in PA 2.0 trampoline template

2023-11-06  John David Anglin  

* config/pa/pa.cc (pa_asm_trampoline_template): Fix typo.

diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc
index 2e906cff7ff..218c48b4ae0 100644
--- a/gcc/config/pa/pa.cc
+++ b/gcc/config/pa/pa.cc
@@ -10401,7 +10401,7 @@ pa_asm_trampoline_template (FILE *f)
  fputs ("\tldw 0(%r22),%r21\n", f);
  fputs ("\tldw 4(%r22),%r19\n", f);
  fputs ("\tbve (%r21)\n", f);
- fputs ("\tldw 52(%r1),%r29\n", f);
+ fputs ("\tldw 52(%r20),%r29\n", f);
  fputs ("\t.word   0\n", f);
  fputs ("\t.word   0\n", f);
  fputs ("\t.word   0\n", f);


signature.asc
Description: PGP signature


[committed] hppa: Enable generation of GNU stack notes on Linux

2023-11-06 Thread John David Anglin
I think we have waited long enough for everone to switch to a
kernel build with VDSO support.  Committed to trunk.

Dave
---

Enable generation of GNU stack notes on Linux

2023-11-06  John David Anglin  

* config/pa/pa-linux.h (NEED_INDICATE_EXEC_STACK): Define to 1.

diff --git a/gcc/config/pa/pa-linux.h b/gcc/config/pa/pa-linux.h
index d38f68b1fa5..96c54765ddb 100644
--- a/gcc/config/pa/pa-linux.h
+++ b/gcc/config/pa/pa-linux.h
@@ -144,8 +144,7 @@ along with GCC; see the file COPYING3.  If not see
 #define HAVE_sync_compare_and_swapsi 1
 #define HAVE_sync_compare_and_swapdi 1
 
-/* It's not possible to enable GNU_stack notes since the kernel needs
-   an executable stack for signal returns and syscall restarts.  */
+/* Enable GNU stack notes.  */
 
 #undef NEED_INDICATE_EXEC_STACK
-#define NEED_INDICATE_EXEC_STACK 0
+#define NEED_INDICATE_EXEC_STACK 1


signature.asc
Description: PGP signature


[committed] hppa: Delete MALLOC_ABI_ALIGNMENT define from pa32-linux.h

2023-10-05 Thread John David Anglin
In spite of what the comment says, the MALLOC_ALIGNMENT in glibc
for 32-bit hppa-linux has always been 8, not 16.  There is no
reason to increase it as the old linux threads implementation
has been removed.  So, we can use default in pa.h.

Dave
---

Delete MALLOC_ABI_ALIGNMENT define from pa32-linux.h

2023-10-05  John David Anglin  

* config/pa/pa32-linux.h (MALLOC_ABI_ALIGNMENT): Delete.

diff --git a/gcc/config/pa/pa32-linux.h b/gcc/config/pa/pa32-linux.h
index bdd13ce492e..f48e45374f4 100644
--- a/gcc/config/pa/pa32-linux.h
+++ b/gcc/config/pa/pa32-linux.h
@@ -68,11 +68,6 @@ call_ ## FUNC (void) \
 #undef  WCHAR_TYPE_SIZE
 #define WCHAR_TYPE_SIZE BITS_PER_WORD
 
-/* POSIX types such as pthread_mutex_t require 16-byte alignment to retain
-   layout compatibility with the original linux thread implementation.  */
-#undef MALLOC_ABI_ALIGNMENT
-#define MALLOC_ABI_ALIGNMENT 128
-
 /* Place jump tables in the text section except when generating non-PIC
code.  When generating non-PIC code, the relocations needed to load the
address of the jump table result in a text label in the final executable


signature.asc
Description: PGP signature


[committed] Add hppa*-*-* to dg-error targets at line 5 in gfortran.dg/pr95690.f90

2023-10-02 Thread John David Anglin
Committed to trunk.

Dave
---

Add hppa*-*-* to dg-error targets at line 5

2023-10-02  John David Anglin  

gcc/testsuite/ChangeLog:

* gfortran.dg/pr95690.f90: Add hppa*-*-* to dg-error targets at line 5.

diff --git a/gcc/testsuite/gfortran.dg/pr95690.f90 
b/gcc/testsuite/gfortran.dg/pr95690.f90
index 47a5df9e894..1432937438a 100644
--- a/gcc/testsuite/gfortran.dg/pr95690.f90
+++ b/gcc/testsuite/gfortran.dg/pr95690.f90
@@ -2,8 +2,8 @@
 module m
 contains
subroutine s
-  print *, (erfc) ! { dg-error "not a floating constant" "" { target 
i?86-*-* x86_64-*-* sparc*-*-* cris-*-* } }
-   end ! { dg-error "not a floating constant" "" { target { ! "i?86-*-* 
x86_64-*-* sparc*-*-* cris-*-*" } } }
+  print *, (erfc) ! { dg-error "not a floating constant" "" { target 
i?86-*-* x86_64-*-* sparc*-*-* cris-*-* hppa*-*-* } }
+   end ! { dg-error "not a floating constant" "" { target { ! "i?86-*-* 
x86_64-*-* sparc*-*-* cris-*-* hppa*-*-*" } } }
function erfc()
end
 end


signature.asc
Description: PGP signature


[committed] Require target lra in gcc.dg/pr108095.c

2023-10-02 Thread John David Anglin
Committed to trunk.

Dave
---

Require target lra in gcc.dg/pr108095.c

2023-10-02  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/pr108095.c: Require target lra.

diff --git a/gcc/testsuite/gcc.dg/pr108095.c b/gcc/testsuite/gcc.dg/pr108095.c
index fb76caae72e..0a487cf614a 100644
--- a/gcc/testsuite/gcc.dg/pr108095.c
+++ b/gcc/testsuite/gcc.dg/pr108095.c
@@ -1,5 +1,5 @@
 /* PR tree-optimization/108095 */
-/* { dg-do compile } */
+/* { dg-do compile { target lra } } */
 /* { dg-options "-Os -g" } */
 
 int v;


signature.asc
Description: PGP signature


[committed] Increase timeout factor for hppa*-*-* in gcc.dg/long_branch.c

2023-10-02 Thread John David Anglin
Committed to trunk.

Dave
---

Increase timeout factor for hppa*-*-* in gcc.dg/long_branch.c

2023-10-02  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/long_branch.c: Increase timeout factor for hppa*-*-*.

diff --git a/gcc/testsuite/gcc.dg/long_branch.c 
b/gcc/testsuite/gcc.dg/long_branch.c
index c1ac24f5116..ba80ab3d15b 100644
--- a/gcc/testsuite/gcc.dg/long_branch.c
+++ b/gcc/testsuite/gcc.dg/long_branch.c
@@ -1,7 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -fno-reorder-blocks" } */
 /* { dg-skip-if "limited code space" { pdp11-*-* } } */
-/* { dg-timeout-factor 2.0 { target hppa*-*-* } } */
+/* { dg-timeout-factor 4.0 { target hppa*-*-* } } */
 
 void abort ();
 


signature.asc
Description: PGP signature


[committed] hppa: Fix memory barrier patterns for pre PA8800 processors

2023-09-29 Thread John David Anglin
Since 2005, it was assumed in the Linux kernel that all PA 2.0 processors
supported the ldcw cacheable hint and that natural alignment could be used
for ldcw,co.  However, I recently fired up an old A500 machine with PA8600
processors and found that 16-byte alignment was needed for ldcw,co on it.
As far as I can tell, only PA8800 and PA8900 processors support the
cacheable hint.

This change revises the memory barrier patterns. We alway use ldcw,co
when comp[iling for PA 2.0 but we disable the -mcoherent-ldcw option
by default. As a result, the 16-byte aligned patterns are now the default.
This is safer but slightly less efficient.
 
Dave
---

Fix memory barrier patterns for pre PA8800 processors

2023-09-29  John David Anglin  

* config/pa/pa.md (memory_barrier): Revise comment.
(memory_barrier_64, memory_barrier_32): Use ldcw,co on PA 2.0.
* config/pa/pa.opt (coherent-ldcw): Change default to disabled.

diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index f603591447d..4f85991e6bd 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -10739,10 +10739,10 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
 ;; generating PA 1.x code even though all PA 1.x systems are strongly ordered.
 
 ;; When barriers are needed, we use a strongly ordered ldcw instruction as
-;; the barrier.  Most PA 2.0 targets are cache coherent.  In that case, we
-;; can use the coherent cache control hint and avoid aligning the ldcw
-;; address.  In spite of its description, it is not clear that the sync
-;; instruction works as a barrier.
+;; the barrier.  All PA 2.0 targets accept the "co" cache control hint but
+;; only PA8800 and PA8900 processors implement the cacheable hint.  In
+;; that case, we can avoid aligning the ldcw address.  In spite of its
+;; description, it is not clear that the sync instruction works as a barrier.
 
 (define_expand "memory_barrier"
   [(parallel
@@ -10772,7 +10772,7 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
 (unspec:BLK [(match_dup 0)] UNSPEC_MEMORY_BARRIER))
 (clobber (match_operand 1 "pmode_register_operand" "="))]
   "TARGET_64BIT"
-  "ldo 15(%%sp),%1\n\tdepd %%r0,63,3,%1\n\tldcw 0(%1),%1"
+  "ldo 15(%%sp),%1\n\tdepd %%r0,63,3,%1\n\tldcw,co 0(%1),%1"
   [(set_attr "type" "binary")
(set_attr "length" "12")])
 
@@ -10781,6 +10781,6 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
 (unspec:BLK [(match_dup 0)] UNSPEC_MEMORY_BARRIER))
 (clobber (match_operand 1 "pmode_register_operand" "="))]
   ""
-  "ldo 15(%%sp),%1\n\t{dep|depw} %%r0,31,3,%1\n\tldcw 0(%1),%1"
+  "ldo 15(%%sp),%1\n\t{dep|depw} %%r0,31,3,%1\n\t{ldcw|ldcw,co} 0(%1),%1"
   [(set_attr "type" "binary")
(set_attr "length" "12")])
diff --git a/gcc/config/pa/pa.opt b/gcc/config/pa/pa.opt
index dd358f2f26a..573edcea338 100644
--- a/gcc/config/pa/pa.opt
+++ b/gcc/config/pa/pa.opt
@@ -50,7 +50,7 @@ Target Mask(CALLER_COPIES)
 Caller copies function arguments passed by hidden reference.
 
 mcoherent-ldcw
-Target Var(TARGET_COHERENT_LDCW) Init(1)
+Target Var(TARGET_COHERENT_LDCW) Init(0)
 Use ldcw/ldcd coherent cache-control hint.
 
 mdisable-fpregs


signature.asc
Description: PGP signature


[committed] hppa: Update baseline symbols for hppa-linux

2023-09-25 Thread John David Anglin
Committed to trunk.

Dave
---

Update baseline symbols for hppa-linux.

2023-09-25  John David Anglin  

libstdc++-v3/ChangeLog:

* config/abi/post/hppa-linux-gnu/baseline_symbols.txt: Update.

diff --git a/libstdc++-v3/config/abi/post/hppa-linux-gnu/baseline_symbols.txt 
b/libstdc++-v3/config/abi/post/hppa-linux-gnu/baseline_symbols.txt
index ff40f201eb8..b41e57125ef 100644
--- a/libstdc++-v3/config/abi/post/hppa-linux-gnu/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/hppa-linux-gnu/baseline_symbols.txt
@@ -983,8 +983,18 @@ FUNC:_ZNKSt11__timepunctIwE9_M_monthsEPPKw
 FUNC:_ZNKSt11__timepunctIwE9_M_monthsEPPKw@@GLIBCXX_3.4
 FUNC:_ZNKSt11logic_error4whatEv
 FUNC:_ZNKSt11logic_error4whatEv@@GLIBCXX_3.4
+FUNC:_ZNKSt12__basic_fileIcE13native_handleEv
+FUNC:_ZNKSt12__basic_fileIcE13native_handleEv@@GLIBCXX_3.4.32
 FUNC:_ZNKSt12__basic_fileIcE7is_openEv
 FUNC:_ZNKSt12__basic_fileIcE7is_openEv@@GLIBCXX_3.4
+FUNC:_ZNKSt12__shared_ptrINSt10filesystem28recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE2EEcvbEv
+FUNC:_ZNKSt12__shared_ptrINSt10filesystem28recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE2EEcvbEv@@GLIBCXX_3.4.31
+FUNC:_ZNKSt12__shared_ptrINSt10filesystem4_DirELN9__gnu_cxx12_Lock_policyE2EEcvbEv
+FUNC:_ZNKSt12__shared_ptrINSt10filesystem4_DirELN9__gnu_cxx12_Lock_policyE2EEcvbEv@@GLIBCXX_3.4.31
+FUNC:_ZNKSt12__shared_ptrINSt10filesystem7__cxx1128recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE2EEcvbEv
+FUNC:_ZNKSt12__shared_ptrINSt10filesystem7__cxx1128recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE2EEcvbEv@@GLIBCXX_3.4.31
+FUNC:_ZNKSt12__shared_ptrINSt10filesystem7__cxx114_DirELN9__gnu_cxx12_Lock_policyE2EEcvbEv
+FUNC:_ZNKSt12__shared_ptrINSt10filesystem7__cxx114_DirELN9__gnu_cxx12_Lock_policyE2EEcvbEv@@GLIBCXX_3.4.31
 FUNC:_ZNKSt12bad_weak_ptr4whatEv
 FUNC:_ZNKSt12bad_weak_ptr4whatEv@@GLIBCXX_3.4.15
 FUNC:_ZNKSt12future_error4whatEv
@@ -1313,6 +1323,20 @@ FUNC:_ZNKSt5ctypeIwE9do_narrowEPKwS2_cPc
 FUNC:_ZNKSt5ctypeIwE9do_narrowEPKwS2_cPc@@GLIBCXX_3.4
 FUNC:_ZNKSt5ctypeIwE9do_narrowEwc
 FUNC:_ZNKSt5ctypeIwE9do_narrowEwc@@GLIBCXX_3.4
+FUNC:_ZNKSt6chrono4tzdb11locate_zoneESt17basic_string_viewIcSt11char_traitsIcEE
+FUNC:_ZNKSt6chrono4tzdb11locate_zoneESt17basic_string_viewIcSt11char_traitsIcEE@@GLIBCXX_3.4.31
+FUNC:_ZNKSt6chrono4tzdb12current_zoneEv
+FUNC:_ZNKSt6chrono4tzdb12current_zoneEv@@GLIBCXX_3.4.31
+FUNC:_ZNKSt6chrono9time_zone15_M_get_sys_infoENS_10time_pointINS_3_V212system_clockENS_8durationIxSt5ratioILx1ELx1EE
+FUNC:_ZNKSt6chrono9time_zone15_M_get_sys_infoENS_10time_pointINS_3_V212system_clockENS_8durationIxSt5ratioILx1ELx1EE@@GLIBCXX_3.4.31
+FUNC:_ZNKSt6chrono9time_zone17_M_get_local_infoENS_10time_pointINS_7local_tENS_8durationIxSt5ratioILx1ELx1EE
+FUNC:_ZNKSt6chrono9time_zone17_M_get_local_infoENS_10time_pointINS_7local_tENS_8durationIxSt5ratioILx1ELx1EE@@GLIBCXX_3.4.31
+FUNC:_ZNKSt6chrono9tzdb_list14const_iteratordeEv
+FUNC:_ZNKSt6chrono9tzdb_list14const_iteratordeEv@@GLIBCXX_3.4.31
+FUNC:_ZNKSt6chrono9tzdb_list5beginEv
+FUNC:_ZNKSt6chrono9tzdb_list5beginEv@@GLIBCXX_3.4.31
+FUNC:_ZNKSt6chrono9tzdb_list5frontEv
+FUNC:_ZNKSt6chrono9tzdb_list5frontEv@@GLIBCXX_3.4.31
 FUNC:_ZNKSt6locale2id5_M_idEv
 FUNC:_ZNKSt6locale2id5_M_idEv@@GLIBCXX_3.4
 FUNC:_ZNKSt6locale4nameB5cxx11Ev
@@ -6134,12 +6158,30 @@ FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_
 FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
+FUNC:_ZNSt6chrono11locate_zoneESt17basic_string_viewIcSt11char_traitsIcEE
+FUNC:_ZNSt6chrono11locate_zoneESt17basic_string_viewIcSt11char_traitsIcEE@@GLIBCXX_3.4.31
+FUNC:_ZNSt6chrono11reload_tzdbEv
+FUNC:_ZNSt6chrono11reload_tzdbEv@@GLIBCXX_3.4.31
+FUNC:_ZNSt6chrono12current_zoneEv
+FUNC:_ZNSt6chrono12current_zoneEv@@GLIBCXX_3.4.31
 FUNC:_ZNSt6chrono12system_clock3nowEv
 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
+FUNC:_ZNSt6chrono13get_tzdb_listEv
+FUNC:_ZNSt6chrono13get_tzdb_listEv@@GLIBCXX_3.4.31
+FUNC:_ZNSt6chrono14remote_versionB5cxx11Ev
+FUNC:_ZNSt6chrono14remote_versionB5cxx11Ev@@GLIBCXX_3.4.31
 FUNC:_ZNSt6chrono3_V212steady_clock3nowEv
 FUNC:_ZNSt6chrono3_V212steady_clock3nowEv@@GLIBCXX_3.4.19
 FUNC:_ZNSt6chrono3_V212system_clock3nowEv
 FUNC:_ZNSt6chrono3_V212system_clock3nowEv@@GLIBCXX_3.4.19
+FUNC:_ZNSt6chrono8get_tzdbEv
+FUNC:_ZNSt6chrono8get_tzdbEv@@GLIBCXX_3.4.31
+FUNC:_ZNSt6chrono9tzdb_list11erase_afterENS0_14const_iteratorE
+FUNC:_ZNSt6chrono9tzdb_list11erase_afterENS0_14const_iteratorE@@GLIBCXX_3.4.31
+FUNC:_ZNSt6chrono9tzdb_list14const_iteratorppEi
+FUNC:_ZNSt6chrono9tzdb_list14const_iteratorppEi@@GLIBCXX_3.4.31
+FUNC:_ZNSt6chrono9tzdb_list14const_iteratorppEv
+FUNC:_ZNSt6chrono9tzdb_list14const_iteratorppEv@@GLIBCXX_3.4.31
 FUNC:_ZNSt6gslice8_IndexerC1EjRKSt8valarrayIjES4_
 FUNC:_ZNSt6gslice8_IndexerC1EjRKSt8valarrayIjES4_

Re: [PATCH] Use strtol instead of std::stoi in gensupport.cc

2023-08-10 Thread John David Anglin

Ping.

On 2023-07-19 2:59 p.m., John David Anglin wrote:

Tested on trunk with hppa64-hp-hpux11.11.

Okay?

Dave
---

Use strtol instead of std::stoi [PR110646]

Implementation of std::stoi was overlooked on hppa-hpux, so use
strtol instead.

2023-07-19  John David Anglin  

gcc/ChangeLog:

PR bootstrap/110646
* gensupport.cc(class conlist): Use strtol instead of std::stoi.

diff --git a/gcc/gensupport.cc b/gcc/gensupport.cc
index 959d1d9c83c..87bcf5ee441 100644
--- a/gcc/gensupport.cc
+++ b/gcc/gensupport.cc
@@ -640,7 +640,7 @@ public:
  
  name.assign (ns, len);

  if (numeric)
-  idx = std::stoi (name);
+  idx = strtol (name.c_str (), (char **)NULL, 10);
}
  
/* Adds a character to the end of the string.  */



--
John David Anglin  dave.ang...@bell.net



[committed] Require target lra in gcc.c-torture/compile/asmgoto-6.c

2023-07-21 Thread John David Anglin
The asmgoto feature requires LRA support.

Committed to trunk. Tested on hppa64-hp-hpux11.11.

Dave
---

Require target lra in gcc.c-torture/compile/asmgoto-6.c

2023-07-21  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.c-torture/compile/asmgoto-6.c: Require target lra.

diff --git a/gcc/testsuite/gcc.c-torture/compile/asmgoto-6.c 
b/gcc/testsuite/gcc.c-torture/compile/asmgoto-6.c
index 0652bd4e4e1..6799b83c20a 100644
--- a/gcc/testsuite/gcc.c-torture/compile/asmgoto-6.c
+++ b/gcc/testsuite/gcc.c-torture/compile/asmgoto-6.c
@@ -1,5 +1,5 @@
 
-/* { dg-do compile } */
+/* { dg-do compile { target lra } } */
 /* PR middle-end/110420 */
 /* PR middle-end/103979 */
 /* PR middle-end/98619 */


signature.asc
Description: PGP signature


[PATCH] Use strtol instead of std::stoi in gensupport.cc

2023-07-19 Thread John David Anglin
Tested on trunk with hppa64-hp-hpux11.11.

Okay?

Dave
---

Use strtol instead of std::stoi [PR110646]

Implementation of std::stoi was overlooked on hppa-hpux, so use
strtol instead.

2023-07-19  John David Anglin  

gcc/ChangeLog:

PR bootstrap/110646
* gensupport.cc(class conlist): Use strtol instead of std::stoi.

diff --git a/gcc/gensupport.cc b/gcc/gensupport.cc
index 959d1d9c83c..87bcf5ee441 100644
--- a/gcc/gensupport.cc
+++ b/gcc/gensupport.cc
@@ -640,7 +640,7 @@ public:
 
 name.assign (ns, len);
 if (numeric)
-  idx = std::stoi (name);
+  idx = strtol (name.c_str (), (char **)NULL, 10);
   }
 
   /* Adds a character to the end of the string.  */


signature.asc
Description: PGP signature


[committed] hppa: Modify TLS patterns to provide both 32 and 64-bit support

2023-07-15 Thread John David Anglin
Tested on hppa-unknown-linux-gnu and hppa64-hp-hpux11.11.

Committed to trunk.

Dave
---

hppa: Modify TLS patterns to provide both 32 and 64-bit support.

2023-07-15  John David Anglin  

gcc/ChangeLog:

* config/pa/pa.md: Define constants R1_REGNUM, R19_REGNUM and
R27_REGNUM.
(tgd_load): Restrict to !TARGET_64BIT. Use register constants.
(tld_load): Likewise.
(tgd_load_pic): Change to expander.
(tld_load_pic, tld_offset_load, tp_load): Likewise.
(tie_load_pic, tle_load): Likewise.
(tgd_load_picsi, tgd_load_picdi): New.
(tld_load_picsi, tld_load_picdi): New.
(tld_offset_load): New.
(tp_load): New.
(tie_load_picsi, tie_load_picdi): New.
(tle_load): New.

diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 726e12768f8..f603591447d 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -108,6 +108,14 @@
(MAX_17BIT_OFFSET   262100) ; 17-bit branch
   ])
 
+;; Register numbers
+
+(define_constants
+  [(R1_REGNUM   1)
+   (R19_REGNUM 19)
+   (R27_REGNUM 27)
+  ])
+
 ;; Mode and code iterators
 
 ;; This mode iterator allows :P to be used for patterns that operate on
@@ -10262,9 +10270,9 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
 (define_insn "tgd_load"
  [(set (match_operand:SI 0 "register_operand" "=r")
(unspec:SI [(match_operand 1 "tgd_symbolic_operand" "")] UNSPEC_TLSGD))
-  (clobber (reg:SI 1))
-  (use (reg:SI 27))]
-  ""
+  (clobber (reg:SI R1_REGNUM))
+  (use (reg:SI R27_REGNUM))]
+  "!TARGET_64BIT"
   "*
 {
   return \"addil LR'%1-$tls_gdidx$,%%r27\;ldo RR'%1-$tls_gdidx$(%%r1),%0\";
@@ -10272,12 +10280,25 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
   [(set_attr "type" "multi")
(set_attr "length" "8")])
 
-(define_insn "tgd_load_pic"
+(define_expand "tgd_load_pic"
+ [(set (match_operand 0 "register_operand")
+   (unspec [(match_operand 1 "tgd_symbolic_operand")] UNSPEC_TLSGD_PIC))
+  (clobber (reg R1_REGNUM))]
+  ""
+{
+  if (TARGET_64BIT)
+emit_insn (gen_tgd_load_picdi (operands[0], operands[1]));
+  else
+emit_insn (gen_tgd_load_picsi (operands[0], operands[1]));
+  DONE;
+})
+
+(define_insn "tgd_load_picsi"
  [(set (match_operand:SI 0 "register_operand" "=r")
(unspec:SI [(match_operand 1 "tgd_symbolic_operand" "")] 
UNSPEC_TLSGD_PIC))
-  (clobber (reg:SI 1))
-  (use (reg:SI 19))]
-  ""
+  (clobber (reg:SI R1_REGNUM))
+  (use (reg:SI R19_REGNUM))]
+  "!TARGET_64BIT"
   "*
 {
   return \"addil LT'%1-$tls_gdidx$,%%r19\;ldo RT'%1-$tls_gdidx$(%%r1),%0\";
@@ -10285,12 +10306,25 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
   [(set_attr "type" "multi")
(set_attr "length" "8")])
 
+(define_insn "tgd_load_picdi"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+   (unspec:DI [(match_operand 1 "tgd_symbolic_operand" "")] 
UNSPEC_TLSGD_PIC))
+  (clobber (reg:DI R1_REGNUM))
+  (use (reg:DI R27_REGNUM))]
+  "TARGET_64BIT"
+  "*
+{
+  return \"addil LT'%1-$tls_gdidx$,%%r27\;ldo RT'%1-$tls_gdidx$(%%r1),%0\";
+}"
+  [(set_attr "type" "multi")
+   (set_attr "length" "8")])
+
 (define_insn "tld_load"
  [(set (match_operand:SI 0 "register_operand" "=r")
(unspec:SI [(match_operand 1 "tld_symbolic_operand" "")] UNSPEC_TLSLDM))
-  (clobber (reg:SI 1))
-  (use (reg:SI 27))]
-  ""
+  (clobber (reg:SI R1_REGNUM))
+  (use (reg:SI R27_REGNUM))]
+  "!TARGET_64BIT"
   "*
 {
   return \"addil LR'%1-$tls_ldidx$,%%r27\;ldo RR'%1-$tls_ldidx$(%%r1),%0\";
@@ -10298,12 +10332,25 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
   [(set_attr "type" "multi")
(set_attr "length" "8")])
 
-(define_insn "tld_load_pic"
+(define_expand "tld_load_pic"
+ [(set (match_operand 0 "register_operand")
+   (unspec [(match_operand 1 "tld_symbolic_operand")] UNSPEC_TLSLDM_PIC))
+  (clobber (reg R1_REGNUM))]
+  ""
+{
+  if (TARGET_64BIT)
+emit_insn (gen_tld_load_picdi (operands[0], operands[1]));
+  else
+emit_insn (gen_tld_load_picsi (operands[0], operands[1]));
+  DONE;
+})
+
+(define_insn "tld_load_picsi"
  [(set (match_operand:SI 0 "register_operand" "=r")
(unspec:SI [(match_operand 1 "tld_symbolic_operand" "")] 
UNSPEC_TLSLDM_PIC))
-  (clobber (reg:SI 1))
-  (use (reg:SI 19))]
-  ""
+  (clobber (reg:SI R1_REGNUM))
+  (use (reg:SI R19_REGNUM))]
+  "!TARGET_64BIT"
   "*
 {
   return \"addi

[committed] hppa: Add clear_cache expander

2023-05-17 Thread John David Anglin
Tested on hppa-unknown-linux-gnu and hppa64-hp-hpux11.11.

Committed to trunk.

Dave
---

Add clear_cache expander.

2023-05-17  John David Anglin  

gcc/ChangeLog:

* config/pa/pa.md (clear_cache): New.

diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 7b7d7f776c7..726e12768f8 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -9940,6 +9940,23 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
   [(set_attr "type" "multi")
(set_attr "length" "52")])
 
+(define_expand "clear_cache"
+  [(match_operand 0 "pmode_register_operand")
+   (match_operand 1 "pmode_register_operand")]
+  ""
+{
+  rtx line_length = gen_reg_rtx (Pmode);
+
+  emit_move_insn (line_length, GEN_INT (MIN_CACHELINE_SIZE));
+  if (TARGET_64BIT)
+emit_insn (gen_icacheflushdi (operands[0], operands[1], line_length,
+ gen_reg_rtx (Pmode), gen_reg_rtx (Pmode)));
+  else
+emit_insn (gen_icacheflushsi (operands[0], operands[1], line_length,
+ gen_reg_rtx (Pmode), gen_reg_rtx (Pmode)));
+  DONE;
+})
+
 ;; An out-of-line prologue.
 (define_insn "outline_prologue_call"
   [(unspec_volatile [(const_int 0)] UNSPECV_OPC)



signature.asc
Description: PGP signature


[committed] hppa: Fix handling of large arguments passed by value

2023-04-15 Thread John David Anglin
This change revises pa_function_arg_size to return values that fit
in an int.  For a number of reasons, updating pa_function_arg,
pa_arg_partial_bytes, etc, to handle handle HOST_WIDE_INT values
didn't seem useful.  Currently, gcc limits the size of arguments
passed by value to 1 GB.  The PA prologue/epilogue code only handles
32-bit frame offsets and 1 GB is the maximum frame size that can be
recorded in the HPUX unwind descriptor.  Thus, limiting argument
sizes to 1 GB is enough.

Tested on hppa64-hp-hpux11.11 and hppa-unknown-linux-gnu.  Committed
to trunk.

Dave
---

Fix handling of large arguments passed by value.

2023-04-15  John David Anglin  

gcc/ChangeLog:

PR target/109478
* config/pa/pa-protos.h (pa_function_arg_size): Update prototype.
* config/pa/pa.cc (pa_function_arg): Return NULL_RTX if argument
size is zero.
(pa_arg_partial_bytes): Don't call pa_function_arg_size twice.
(pa_function_arg_size): Change return type to int.  Return zero
for arguments larger than 1 GB.  Update comments.

diff --git a/gcc/config/pa/pa-protos.h b/gcc/config/pa/pa-protos.h
index c0a61ea89c3..b4b1310a52d 100644
--- a/gcc/config/pa/pa-protos.h
+++ b/gcc/config/pa/pa-protos.h
@@ -106,7 +106,7 @@ extern void pa_asm_output_aligned_local (FILE *, const char 
*,
 unsigned int);
 extern void pa_hpux_asm_output_external (FILE *, tree, const char *);
 extern HOST_WIDE_INT pa_initial_elimination_offset (int, int);
-extern HOST_WIDE_INT pa_function_arg_size (machine_mode, const_tree);
+extern int pa_function_arg_size (machine_mode, const_tree);
 extern void pa_output_function_label (FILE *);
 extern void hppa_profile_hook (int);
 
diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc
index 3f91ebce603..db633b275e5 100644
--- a/gcc/config/pa/pa.cc
+++ b/gcc/config/pa/pa.cc
@@ -9784,6 +9784,8 @@ pa_function_arg (cumulative_args_t cum_v, const 
function_arg_info )
 return NULL_RTX;
 
   arg_size = pa_function_arg_size (mode, type);
+  if (!arg_size)
+return NULL_RTX;
 
   /* If this arg would be passed partially or totally on the stack, then
  this routine should return zero.  pa_arg_partial_bytes will
@@ -9985,15 +9987,16 @@ pa_arg_partial_bytes (cumulative_args_t cum_v, const 
function_arg_info )
   CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
   unsigned int max_arg_words = 8;
   unsigned int offset = 0;
+  int arg_size;
 
   if (!TARGET_64BIT)
 return 0;
 
-  if (pa_function_arg_size (arg.mode, arg.type) > 1 && (cum->words & 1))
+  arg_size = pa_function_arg_size (arg.mode, arg.type);
+  if (arg_size > 1 && (cum->words & 1))
 offset = 1;
 
-  if (cum->words + offset + pa_function_arg_size (arg.mode, arg.type)
-  <= max_arg_words)
+  if (cum->words + offset + arg_size <= max_arg_words)
 /* Arg fits fully into registers.  */
 return 0;
   else if (cum->words + offset >= max_arg_words)
@@ -11067,17 +11070,25 @@ pa_starting_frame_offset (void)
   return 8;
 }
 
-/* Figure out the size in words of the function argument.  The size
-   returned by this function should always be greater than zero because
-   we pass variable and zero sized objects by reference.  */
+/* Figure out the size in words of the function argument.  */
 
-HOST_WIDE_INT
+int
 pa_function_arg_size (machine_mode mode, const_tree type)
 {
   HOST_WIDE_INT size;
 
   size = mode != BLKmode ? GET_MODE_SIZE (mode) : int_size_in_bytes (type); 
-  return CEIL (size, UNITS_PER_WORD);
+
+  /* The 64-bit runtime does not restrict the size of stack frames,
+ but the gcc calling conventions limit argument sizes to 1G.  Our
+ prologue/epilogue code limits frame sizes to just under 32 bits.
+ 1G is also the maximum frame size that can be handled by the HPUX
+ unwind descriptor.  Since very large TYPE_SIZE_UNIT values can
+ occur for (parallel:BLK []), we need to ignore large arguments
+ passed by value.  */
+  if (size >= (1 << (HOST_BITS_PER_INT - 2)))
+size = 0;
+  return (int) CEIL (size, UNITS_PER_WORD);
 }
 
 #include "gt-pa.h"



signature.asc
Description: PGP signature


[committed] hppa: Fix gcc.dg/long_branch.c on hppa

2023-04-08 Thread John David Anglin
Committed to trunk.

Dave
---

Fix gcc.dg/long_branch.c on hppa.

2023-04-08  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/long_branch.c: Use timeout factor 2.0 on hppa*-*-*.

diff --git a/gcc/testsuite/gcc.dg/long_branch.c 
b/gcc/testsuite/gcc.dg/long_branch.c
index 97fb169b043..c1ac24f5116 100644
--- a/gcc/testsuite/gcc.dg/long_branch.c
+++ b/gcc/testsuite/gcc.dg/long_branch.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -fno-reorder-blocks" } */
 /* { dg-skip-if "limited code space" { pdp11-*-* } } */
+/* { dg-timeout-factor 2.0 { target hppa*-*-* } } */
 
 void abort ();
 


signature.asc
Description: PGP signature


[committed] hppa: Fix 22_locale/locale/cons/12658_thread-2.cc on hppa

2023-04-05 Thread John David Anglin
Committed to trunk.

Dave
---

Fix 22_locale/locale/cons/12658_thread-2.cc on hppa.

2023-04-05  John David Anglin  

libstdc++-v3/ChangeLog:

* testsuite/22_locale/locale/cons/12658_thread-2.cc: Double
timeout factor on hppa*-*-*.

diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-2.cc 
b/libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-2.cc
index 1ce85b7475d..d198a0ac304 100644
--- a/libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-2.cc
+++ b/libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-2.cc
@@ -3,6 +3,7 @@
 // { dg-require-effective-target pthread }
 // { dg-require-namedlocale "en_US.ISO8859-1" }
 // { dg-require-namedlocale "fr_FR.ISO8859-15" }
+// { dg-timeout-factor 2.0 { target hppa*-*-* } }
 
 // Copyright (C) 2004-2023 Free Software Foundation, Inc.
 //



signature.asc
Description: PGP signature


[committed] hppa: Add assember CFI directives to millicode division and remainder routines

2023-04-05 Thread John David Anglin
Committed to trunk after testing on hppa-unknown-linux-gnu.

Dave
---

Add assember CFI directives to millicode division and remainder routines.

The millicode division and remainder routines trap division by zero.
The unwinder needs these directives to unwind divide by zero traps.

2023-04-05  John David Anglin  

libgcc/ChangeLog:

PR target/109374
* config/pa/milli64.S (RETURN_COLUMN): Define.
($$divI): Add CFI directives.
($$divU): Likewise.
($$remI): Likewise.
($$remU): Likewise.

diff --git a/libgcc/config/pa/milli64.S b/libgcc/config/pa/milli64.S
index 2316f797354..e1c84f48d25 100644
--- a/libgcc/config/pa/milli64.S
+++ b/libgcc/config/pa/milli64.S
@@ -105,8 +105,10 @@ sar:   .reg%cr11   /* Shift Amount Register */
 rp:.regr2  /* return pointer */
 #ifdef pa64
 mrp:   .regr2  /* millicode return pointer */
+#define RETURN_COLUMN  2
 #else
 mrp:   .regr31 /* millicode return pointer */
+#define RETURN_COLUMN  31
 #endif
 ret0:  .regr28 /* return value */
 ret1:  .regr29 /* return value (high part of double) */
@@ -313,6 +315,8 @@ RDEFINE(temp1,arg0)
.import $$divI_15,millicode
.export $$divI,millicode
.export $$divoI,millicode
+   .cfi_startproc
+   .cfi_return_column RETURN_COLUMN
.proc
.callinfo   millicode
.entry
@@ -484,6 +488,7 @@ LSYM(negative1)
addoarg0,arg1,r0/*  trap iff dividend==0x8000 && 
divisor==-1 */
.exit
.procend
+   .cfi_endproc
.end
 #endif
 
@@ -543,6 +548,8 @@ RDEFINE(temp1,arg0)
.import $$divU_12,millicode
.import $$divU_14,millicode
.import $$divU_15,millicode
+   .cfi_startproc
+   .cfi_return_column RETURN_COLUMN
.proc
.callinfo   millicode
.entry
@@ -706,6 +713,7 @@ LSYM(big_divisor)
addcr0,r0,retreg
.exit
.procend
+   .cfi_endproc
.end
 #endif
 
@@ -750,6 +758,8 @@ RDEFINE(retreg,ret1)
 
SUBSPA_MILLI
ATTR_MILLI
+   .cfi_startproc
+   .cfi_return_column RETURN_COLUMN
.proc
.callinfo millicode
.entry
@@ -875,6 +885,7 @@ LSYM(finish)
nop
.exit
.procend
+   .cfi_endproc
 #ifdef milliext
.origin 0x0200
 #endif
@@ -922,6 +933,8 @@ RDEFINE(rmndr,ret1) /*  r29 */
SUBSPA_MILLI
ATTR_MILLI
.export $$remU,millicode
+   .cfi_startproc
+   .cfi_return_column RETURN_COLUMN
.proc
.callinfo   millicode
.entry
@@ -1013,6 +1026,7 @@ LSYM(special_case)
nop
.exit
.procend
+   .cfi_endproc
.end
 #endif
 


signature.asc
Description: PGP signature


[committed] hppa: Fix support for atomic loads and stores on hppa

2023-01-13 Thread John David Anglin
The following change fixes a number of problems with atomic loads
and stores on hppa.

Tested on hppa-unknown-linux-gnu and hppa64-hp-hpux11.11.

The TARGET_SOFT_FLOAT case is not tested.  It's possible we need
additional atomic load support for this case but I think that's
unnecessary since hppa requires strict alignment.

We could use an array of locks in sync-libfuncs.c to improve
performance but I kept things simple for now.

Committed to trunk.

Dave
---

Fix support for atomic loads and stores on hppa.

This change updates the atomic libcall support to fix the following
issues:

1) A internal compiler error with -fno-sync-libcalls.
2) When sync libcalls are disabled, we don't generate libcalls for
   libatomic.
3) There is no sync libcall support for targets other than linux.
   As a result, non-atomic stores are silently emitted for types
   smaller or equal to the word size.  There are now a few atomic
   libcalls in the libgcc code, so we need sync support on all
   targets.

2023-01-13  John David Anglin  

gcc/ChangeLog:

* config/pa/pa-linux.h (TARGET_SYNC_LIBCALL): Delete define.
* config/pa/pa.cc (pa_init_libfuncs): Use MAX_SYNC_LIBFUNC_SIZE
define.
* config/pa/pa.h (TARGET_SYNC_LIBCALLS): Use flag_sync_libcalls.
(MAX_SYNC_LIBFUNC_SIZE): Define.
(TARGET_CPU_CPP_BUILTINS): Define __SOFTFP__ when soft float is
enabled.
* config/pa/pa.md (atomic_storeqi): Emit __atomic_exchange_1
libcall when sync libcalls are disabled.
(atomic_storehi, atomic_storesi, atomic_storedi): Likewise.
(atomic_loaddi): Emit __atomic_load_8 libcall when sync libcalls
are disabled on 32-bit target.
* config/pa/pa.opt (matomic-libcalls): New option.
* doc/invoke.texi (HPPA Options): Update.

libgcc/ChangeLog:

* config.host (hppa*64*-*-linux*): Adjust tmake_file to use
pa/t-pa64-linux.
(hppa*64*-*-hpux11*): Adjust tmake_file to use pa/t-pa64-hpux
instead of pa/t-hpux and pa/t-pa64.
* config/pa/linux-atomic.c: Define u32 type.
(ATOMIC_LOAD): Define new macro to implement atomic_load_1,
atomic_load_2, atomic_load_4 and atomic_load_8.  Update sync
defines to use atomic_load calls for type.
(SYNC_LOCK_LOAD_2): New macro to implement __sync_lock_load_8.
* config/pa/sync-libfuncs.c: New file.
* config/pa/t-netbsd (LIB2ADD_ST): Define.
* config/pa/t-openbsd (LIB2ADD_ST): Define.
* config/pa/t-pa64-hpux: New file.
* config/pa/t-pa64-linux: New file.  

diff --git a/gcc/config/pa/pa-linux.h b/gcc/config/pa/pa-linux.h
index 5af11a1df80..1073f42bd6b 100644
--- a/gcc/config/pa/pa-linux.h
+++ b/gcc/config/pa/pa-linux.h
@@ -133,9 +133,6 @@ along with GCC; see the file COPYING3.  If not see
 #undef TARGET_GAS
 #define TARGET_GAS 1
 
-#undef TARGET_SYNC_LIBCALL
-#define TARGET_SYNC_LIBCALL 1
-
 /* The SYNC operations are implemented as library functions, not
INSN patterns.  As a result, the HAVE defines for the patterns are
not defined.  We need to define them to generate the corresponding
diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc
index 9f43802075f..b43a91f2edb 100644
--- a/gcc/config/pa/pa.cc
+++ b/gcc/config/pa/pa.cc
@@ -5940,8 +5940,8 @@ pa_init_libfuncs (void)
"_U_Qfcnvxf_udbl_to_quad");
 }
 
-  if (TARGET_SYNC_LIBCALL)
-init_sync_libfuncs (8);
+  if (TARGET_SYNC_LIBCALLS)
+init_sync_libfuncs (MAX_SYNC_LIBFUNC_SIZE);
 }
 
 /* HP's millicode routines mean something special to the assembler.
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index bafdf602138..93d6f53f97f 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -72,10 +72,12 @@ extern unsigned long total_code_bytes;
 #define HPUX_LONG_DOUBLE_LIBRARY 0
 #endif
 
-/* Linux kernel atomic operation support.  */
-#ifndef TARGET_SYNC_LIBCALL
-#define TARGET_SYNC_LIBCALL 0
-#endif
+/* Sync libcall support.  */
+#define TARGET_SYNC_LIBCALLS (flag_sync_libcalls)
+
+/* The maximum size of the sync library functions supported.  DImode
+   is supported on 32-bit targets using floating point loads and stores.  */
+#define MAX_SYNC_LIBFUNC_SIZE 8
 
 /* The following three defines are potential target switches.  The current
defines are optimal given the current capabilities of GAS and GNU ld.  */
@@ -173,6 +175,8 @@ do {
\
builtin_define("_PA_RISC1_0");  \
  if (HPUX_LONG_DOUBLE_LIBRARY) \
builtin_define("__SIZEOF_FLOAT128__=16");   \
+ if (TARGET_SOFT_FLOAT)\
+   builtin_define("__SOFTFP__");   \
 } while (0)
 
 /* An old set of OS defines for various BSD-like systems.  */
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 41382271e54

[PATCH] c++tools: Fix compilation of server.cc on hpux

2023-01-07 Thread John David Anglin
Tested on trunk and gcc-12 with hppa64-hp-hpux11.11.

Okay?

Dave
---

Fix compilation of server.cc on hpux.

Select and FD_ISSET are declared in sys/time.h on most versions
of hpux.  As a result, HAVE_PSELECT and HAVE_SELECT can be 0.

2023-01-07  John David Anglin  

c++tools/ChangeLog:

PR c++tools/107616
* server.cc (server): Don't call FD_ISSET when HAVE_PSELECT
and HAVE_SELECT are zero.

diff --git a/c++tools/server.cc b/c++tools/server.cc
index 00154a05925..693aec6820a 100644
--- a/c++tools/server.cc
+++ b/c++tools/server.cc
@@ -753,8 +753,10 @@ server (bool ipv6, int sock_fd, module_resolver *resolver)
  }
  }
 
+#if defined (HAVE_PSELECT) || defined (HAVE_SELECT)
  if (active < 0 && sock_fd >= 0 && FD_ISSET (sock_fd, ))
active = -1;
+#endif
}
 
  if (active >= 0)



signature.asc
Description: PGP signature


[committed] Fix compilation of gcc.dg/atomic/c11-atomic-exec-[45].c on hpux

2023-01-07 Thread John David Anglin
Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Fix compilation of gcc.dg/atomic/c11-atomic-exec-[45].c on hpux.

_HPUX_SOURCE needs to be defined to provide various types needed
for pthreads.

2023-01-07  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/atomic/c11-atomic-exec-4.c: Add "-D_HPUX_SOURCE" option
on *-*-hpux*.
* gcc.dg/atomic/c11-atomic-exec-5.c: Likewise.

diff --git a/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c 
b/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c
index 669e7c058c3..a7e158f14e8 100644
--- a/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c
+++ b/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c
@@ -4,6 +4,7 @@
 /* { dg-do run } */
 /* { dg-options "-std=c11 -pedantic-errors -pthread -U_POSIX_C_SOURCE 
-D_POSIX_C_SOURCE=200809L" } */
 /* { dg-additional-options "-D_XOPEN_SOURCE=600" { target *-*-solaris2* } } */
+/* { dg-additional-options "-D_HPUX_SOURCE" { target *-*-hpux* } } */
 /* { dg-require-effective-target pthread } */
 
 #include 
diff --git a/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c 
b/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c
index f8bfa63b4cc..299d6ab904b 100644
--- a/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c
+++ b/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c
@@ -7,6 +7,7 @@
 /* { dg-add-options ieee } */
 /* { dg-additional-options "-mfp-trap-mode=sui" { target alpha*-*-* } } */
 /* { dg-additional-options "-D_XOPEN_SOURCE=600" { target *-*-solaris2* } } */
+/* { dg-additional-options "-D_HPUX_SOURCE" { target *-*-hpux* } } */
 /* { dg-require-effective-target fenv_exceptions } */
 /* { dg-require-effective-target pthread } */
 /* { dg-timeout-factor 2 } */



signature.asc
Description: PGP signature


[committed] hppa: Fix atomic operations on PA-RISC 2.0 processors

2023-01-05 Thread John David Anglin
This changes fixes the atomic operations defined for hppa processors
in libstdc++-v3.  It appears they were originally written with only
PA 1.x processors in mind.

Tested on hppa64-hp-hpux11.11.  Committed to trunk.

Dave
---

Fix atomic operations on PA-RISC 2.0 processors.

PA-RISC 2.0 supports out-of-order execution for loads and stores.
Thus, we need to synchonize memory accesses.

This change revises the lock releases in __exchange_and_add and
__atomic_add to use an ordered store with release semantics.  We
also use an ordered load in the inner spin loop.

We use the "ldcw,co" instruction instead of "ldcw" when compiled
for PA 2.0.  Most PA 2.0 processors are coherent and can execute
the ldcw instruction in cache for improved performance.

Finally, the inner spin loop is revised to immediately branch to
the ldcw instruction when it detects the lock is free.

2023-01-05  John David Anglin  

libstdc++-v3/ChangeLog:

* config/cpu/hppa/atomicity.h (_PA_LDCW_INSN): Define.
(__exchange_and_add): Use _PA_LDCW_INSN.  Use ordered store for
lock release.  Revise loop.
(__atomic_add): Likewise.

diff --git a/libstdc++-v3/config/cpu/hppa/atomicity.h 
b/libstdc++-v3/config/cpu/hppa/atomicity.h
index bb997e70c1d..658073537a4 100644
--- a/libstdc++-v3/config/cpu/hppa/atomicity.h
+++ b/libstdc++-v3/config/cpu/hppa/atomicity.h
@@ -25,6 +25,15 @@
 #include 
 #include 
 
+/* Perform ldcw operation in cache when possible.  */
+#ifndef _PA_LDCW_INSN
+# ifdef _PA_RISC2_0
+# define _PA_LDCW_INSN "ldcw,co"
+# else
+# define _PA_LDCW_INSN "ldcw"
+# endif
+#endif
+
 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -51,19 +60,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 int tmp;
 volatile int& lock = _Atomicity_lock<0>::_S_atomicity_lock;
 
-__asm__ __volatile__ ("ldcw 0(%1),%0\n\t"
+__asm__ __volatile__ (_PA_LDCW_INSN " 0(%1),%0\n\t"
  "cmpib,<>,n 0,%0,.+20\n\t"
- "ldw 0(%1),%0\n\t"
- "cmpib,= 0,%0,.-4\n\t"
+ "ldw,ma 0(%1),%0\n\t"
+ "cmpib,<> 0,%0,.-12\n\t"
  "nop\n\t"
- "b,n .-20"
+ "b,n .-12"
  : "=" (tmp)
  : "r" ()
  : "memory");
 
 result = *__mem;
 *__mem = result + __val;
-__asm__ __volatile__ ("stw %1,0(%0)"
+__asm__ __volatile__ ("stw,ma %1,0(%0)"
  : : "r" (), "r" (tmp) : "memory");
 return result;
   }
@@ -75,18 +84,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 int tmp;
 volatile int& lock = _Atomicity_lock<0>::_S_atomicity_lock;
 
-__asm__ __volatile__ ("ldcw 0(%1),%0\n\t"
+__asm__ __volatile__ (_PA_LDCW_INSN " 0(%1),%0\n\t"
  "cmpib,<>,n 0,%0,.+20\n\t"
- "ldw 0(%1),%0\n\t"
- "cmpib,= 0,%0,.-4\n\t"
+ "ldw,ma 0(%1),%0\n\t"
+ "cmpib,<> 0,%0,.-12\n\t"
  "nop\n\t"
- "b,n .-20"
+ "b,n .-12"
  : "=" (tmp)
  : "r" ()
  : "memory");
 
 *__mem += __val;
-__asm__ __volatile__ ("stw %1,0(%0)"
+__asm__ __volatile__ ("stw,ma %1,0(%0)"
  : : "r" (), "r" (tmp) : "memory");
   }
 



signature.asc
Description: PGP signature


[committed] Suppress warning from -fstack-protector on hppa

2022-12-16 Thread John David Anglin
Committed to trunk.

Dave
---

Suppress -fstack-protector warning on hppa.

Some package builds enable -fstack-protector and -Werror. Since
-fstack-protector is not supported on hppa because the stack grows
up, these packages must check for the warning generated by
-fstack-protector and suppress it on hppa. This is problematic
since hppa is the only significant architecture where the stack
grows up.

2022-12-16  John David Anglin  

gcc/ChangeLog:

* config/pa/pa.cc (pa_option_override): Disable -fstack-protector.

gcc/testsuite/ChangeLog:

* lib/target-supports.exp (check_effective_target_static): Return 0
on hppa*-*-*.

diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc
index 54ab486a02d..9f43802075f 100644
--- a/gcc/config/pa/pa.cc
+++ b/gcc/config/pa/pa.cc
@@ -567,6 +567,9 @@ pa_option_override (void)
   flag_reorder_blocks = 1;
 }
 
+  /* Disable -fstack-protector to suppress warning.  */
+  flag_stack_protect = 0;
+
   /* We can't guarantee that .dword is available for 32-bit targets.  */
   if (UNITS_PER_WORD == 4)
 targetm.asm_out.aligned_op.di = NULL;
diff --git a/gcc/testsuite/lib/target-supports.exp 
b/gcc/testsuite/lib/target-supports.exp
index 2a058c67c53..0ed20bf9e45 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1214,6 +1214,9 @@ proc check_effective_target_static {} {
 
 # Return 1 if the target supports -fstack-protector
 proc check_effective_target_fstack_protector {} {
+if { [istarget hppa*-*-*] } {
+   return 0;
+}
 return [check_runtime fstack_protector {
#include 
int main (int argc, char *argv[]) {



signature.asc
Description: PGP signature


[committed] hppa: Fix addvdi3 and subvdi3 patterns

2022-11-30 Thread John David Anglin
This was found building 64-bit openssh package.

Committed to active branches.

Dave
---

Fix addvdi3 and subvdi3 patterns

While most PA 2.0 instructions support both 32 and 64-bit traps
and conditions, the addi and subi instructions only support 32-bit
traps and conditions. Thus, we need to force immediate operands
to register operands on the 64-bit target and use the add/sub
instructions which can trap on 64-bit signed overflow.

2022-11-30  John David Anglin  

gcc/ChangeLog:

* config/pa/pa.md (addvdi3): Force operand 2 to a register.
Remove "addi,tsv,*" instruction from unamed pattern.
(subvdi3): Force operand 1 to a register.
Remove "subi,tsv" instruction from from unamed pattern.

diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 76ae35d4cfa..41382271e54 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -5071,23 +5071,25 @@
(match_dup 2
   (const_int 0))])]
   ""
-  "")
+  "
+{
+  if (TARGET_64BIT)
+operands[2] = force_reg (DImode, operands[2]);
+}")
 
 (define_insn ""
-  [(set (match_operand:DI 0 "register_operand" "=r,r")
-   (plus:DI (match_operand:DI 1 "reg_or_0_operand" "%rM,rM")
-(match_operand:DI 2 "arith11_operand" "r,I")))
+  [(set (match_operand:DI 0 "register_operand" "=r")
+   (plus:DI (match_operand:DI 1 "reg_or_0_operand" "%rM")
+(match_operand:DI 2 "register_operand" "r")))
(trap_if (ne (plus:TI (sign_extend:TI (match_dup 1))
 (sign_extend:TI (match_dup 2)))
(sign_extend:TI (plus:DI (match_dup 1)
 (match_dup 2
(const_int 0))]
   "TARGET_64BIT"
-  "@
-  add,tsv,* %2,%1,%0
-  addi,tsv,* %2,%1,%0"
-  [(set_attr "type" "binary,binary")
-   (set_attr "length" "4,4")])
+  "add,tsv,* %2,%1,%0"
+  [(set_attr "type" "binary")
+   (set_attr "length" "4")])
 
 (define_insn ""
   [(set (match_operand:DI 0 "register_operand" "=r")
@@ -5262,23 +5264,25 @@
 (match_dup 2
   (const_int 0))])]
   ""
-  "")
+  "
+{
+  if (TARGET_64BIT)
+operands[1] = force_reg (DImode, operands[1]);
+}")
 
 (define_insn ""
-  [(set (match_operand:DI 0 "register_operand" "=r,r")
-   (minus:DI (match_operand:DI 1 "arith11_operand" "r,I")
- (match_operand:DI 2 "reg_or_0_operand" "rM,rM")))
+  [(set (match_operand:DI 0 "register_operand" "=r")
+   (minus:DI (match_operand:DI 1 "register_operand" "r")
+ (match_operand:DI 2 "reg_or_0_operand" "rM")))
(trap_if (ne (minus:TI (sign_extend:TI (match_dup 1))
  (sign_extend:TI (match_dup 2)))
(sign_extend:TI (minus:DI (match_dup 1)
  (match_dup 2
(const_int 0))]
   "TARGET_64BIT"
-  "@
-  {subo|sub,tsv} %1,%2,%0
-  {subio|subi,tsv} %1,%2,%0"
-  [(set_attr "type" "binary,binary")
-   (set_attr "length" "4,4")])
+  "sub,tsv,* %1,%2,%0"
+  [(set_attr "type" "binary")
+   (set_attr "length" "4")])
 
 (define_insn ""
   [(set (match_operand:DI 0 "register_operand" "=r,")


signature.asc
Description: PGP signature


[committed] hppa: Skip guality tests on hppa*-*-hpux*

2022-11-13 Thread John David Anglin
Committed to trunk.

Dave
---

Skip guality tests on hppa-hpux.

The guality check command hangs. This causes TCL errors in
other tests and slows testsuite execution.

2022-11-13  John David Anglin  

gcc/testsuite/ChangeLog:

* g++.dg/guality/guality.exp: Skip on hppa*-*-hpux*.
* gcc.dg/guality/guality.exp: Likewise.
* gfortran.dg/guality/guality.exp: Likewise.

diff --git a/gcc/testsuite/g++.dg/guality/guality.exp 
b/gcc/testsuite/g++.dg/guality/guality.exp
index 1d5b65fef57..2d736d292e9 100644
--- a/gcc/testsuite/g++.dg/guality/guality.exp
+++ b/gcc/testsuite/g++.dg/guality/guality.exp
@@ -8,6 +8,10 @@ if { [istarget *-*-darwin*] } {
 return
 }
 
+if { [istarget hppa*-*-hpux*] } {
+return
+}
+
 if { [istarget "powerpc-ibm-aix*"] } {
 set torture_execute_xfail "powerpc-ibm-aix*"
 return
diff --git a/gcc/testsuite/gcc.dg/guality/guality.exp 
b/gcc/testsuite/gcc.dg/guality/guality.exp
index ba87132aef2..075bebe34e8 100644
--- a/gcc/testsuite/gcc.dg/guality/guality.exp
+++ b/gcc/testsuite/gcc.dg/guality/guality.exp
@@ -8,6 +8,10 @@ if { [istarget *-*-darwin*] } {
 return
 }
 
+if { [istarget hppa*-*-hpux*] } {
+return
+}
+
 if { [istarget "powerpc-ibm-aix*"] } {
 set torture_execute_xfail "powerpc-ibm-aix*"
 return
diff --git a/gcc/testsuite/gfortran.dg/guality/guality.exp 
b/gcc/testsuite/gfortran.dg/guality/guality.exp
index 0375edfffe4..86a966a9133 100644
--- a/gcc/testsuite/gfortran.dg/guality/guality.exp
+++ b/gcc/testsuite/gfortran.dg/guality/guality.exp
@@ -8,6 +8,10 @@ if { [istarget *-*-darwin*] } {
   return
 }
 
+if { [istarget hppa*-*-hpux*] } {
+return
+}
+
 if { [istarget "powerpc-ibm-aix*"] } {
 set torture_execute_xfail "powerpc-ibm-aix*"
 return


signature.asc
Description: PGP signature


Re: [PATCH][V3] 32-bit PA-RISC with HP-UX: remove deprecated ports

2022-09-01 Thread John David Anglin

On 2022-08-31 3:21 a.m., Martin Liška wrote:

Sending v3 of the patch that includes John's comments.

Ready to be installed?

Okay.

Dave

--
John David Anglin  dave.ang...@bell.net



Re: [PATCH][V3] 32-bit PA-RISC with HP-UX: remove deprecated ports

2022-08-31 Thread John David Anglin

On 2022-08-31 11:35 a.m., Jeff Law wrote:

It looks like you removed the pa-bsd and pa-osf targets too.  Those were so 
niche that I doubt anyone else would notice.

That should be okay.  I have never heard of anyone building these. There is no 
config for these in config.gcc.

hppa*-*-openbsd* and hppa*-*-netbsd* are still somewhat used.

Dave

--
John David Anglin  dave.ang...@bell.net



Re: [PATCH] 32-bit PA-RISC with HP-UX: remove deprecated ports

2022-08-30 Thread John David Anglin

On 2022-08-30 8:13 p.m., Jeff Law wrote:



On 8/28/2022 10:34 AM, John David Anglin wrote:

On 2022-08-26 3:15 a.m., Martin Liška wrote:

Removes the deprecated ports. If I'm correct all hpux9,hpux10 should be removed
as they only provide 32-bit targets. On the contrary, hpux11 supports hppa64 
that
we still do support.

It is my understanding that the 32-bit hppa hpux targets were deprecated 
because they don't
support ELF and the DWARF debug format (.stabs is to be removed). Some of the 
changes to
libtool.m4 affect the 32-bit ia64 hpux target.  As far as I know, it supports 
ELF and the DWARF
debug format.

If someone really cared, they could support dwarf on the 32bit PA SOM targets 
-- but I'm not going to lose any sleep over 32bit PA SOM:-)

Yes.  I thought about working on it.  However, although 32bit hppa-hpux lives 
on in qemu, my main focus is linux.
I also had to shutdown my dedicated hpux machine.

Dave

--
John David Anglin  dave.ang...@bell.net



Re: [PATCH] 32-bit PA-RISC with HP-UX: remove deprecated ports

2022-08-30 Thread John David Anglin

On 2022-08-29 10:06 a.m., Martin Liška wrote:

Thanks for the feedback, can you please check the updated version of the patch?

@@ -353,9 +347,6 @@ proc check_weak_available { } {
 # return 1 if weak undefined symbols are supported.

 proc check_effective_target_weak_undefined { } {
-    if { [istarget hppa*-*-hpux*] } {
-   return 0
-    }

This code needs to be retained for hppa64.

@@ -562,7 +553,6 @@ proc check_effective_target_trampolines { } {
 if { [istarget avr-*-*]
 || [istarget msp430-*-*]
 || [istarget nvptx-*-*]
-    || [istarget hppa2.0w-hp-hpux11.23]
 || [istarget hppa64-hp-hpux11.23]
 || [istarget pru-*-*]
 || [istarget bpf-*-*] } {

The above looks odd.  As far as I know, support for trampolines doesn't depend 
in any way on hpux11.23.
I suspect the hppa64 line can be removed as well.

@@ -1,4 +0,0 @@
-# The ada virtual array implementation requires that indexing be disabled on
-# hosts such as hpux that use a segmented memory architecture. Both the c
-# and ada files need to be compiled with this option for correct operation.
-ADA_CFLAGS = -mdisable-indexing -D_X_HPUX10
diff --git a/config/mmap.m4 b/config/mmap.m4
index fba0d9d3657..53e5215d833 100644
--- a/config/mmap.m4
+++ b/config/mmap.m4
@@ -42,7 +42,7 @@ else
    # Systems known to be in this category are Windows (all variants),
    # VMS, and Darwin.
    case "$host_os" in
- *vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00)
+ *vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux11.00)
 gcc_cv_func_mmap_dev_zero=no ;;
  *)
 gcc_cv_func_mmap_dev_zero=yes;;

Strictly, all hpux versions up to and including hpux11.00 don't have /dev/zero.

Dave

--
John David Anglin  dave.ang...@bell.net



Re: [PATCH] 32-bit PA-RISC with HP-UX: remove deprecated ports

2022-08-30 Thread John David Anglin

On 2022-08-29 10:06 a.m., Martin Liška wrote:

Thanks for the feedback, can you please check the updated version of the patch?

The changes to the libffi directory are not necessary and incorrect.  libffi is 
a separate project.

Dave

--
John David Anglin  dave.ang...@bell.net



Re: [PATCH] 32-bit PA-RISC with HP-UX: remove deprecated ports

2022-08-30 Thread John David Anglin

On 2022-08-29 10:06 a.m., Martin Liška wrote:

Thanks for the feedback, can you please check the updated version of the patch?


hppa64-hp-hpux11.11 built successfully with the updated patch:
https://gcc.gnu.org/pipermail/gcc-testresults/2022-August/767508.html


Dave

--
John David Anglin  dave.ang...@bell.net



Re: [PATCH] 32-bit PA-RISC with HP-UX: remove deprecated ports

2022-08-28 Thread John David Anglin

On 2022-08-26 3:15 a.m., Martin Liška wrote:

Removes the deprecated ports. If I'm correct all hpux9,hpux10 should be removed
as they only provide 32-bit targets. On the contrary, hpux11 supports hppa64 
that
we still do support.

It is my understanding that the 32-bit hppa hpux targets were deprecated 
because they don't
support ELF and the DWARF debug format (.stabs is to be removed). Some of the 
changes to
libtool.m4 affect the 32-bit ia64 hpux target.  As far as I know, it supports 
ELF and the DWARF
debug format.

Possibly, the removal of ia64-hpux should be considered but I think it's a 
separate issue.



Ready to be installed?
Thanks,
Martin

ChangeLog:

* config.rpath: Delete hpux9 and hpux10.
* configure: Regenerate.
* configure.ac: Delete hpux9 and hpux10.
* libgo/config/libtool.m4: Ignore 32-bit
hpux targets.
* libgo/configure: Regenerate.
* libtool.m4: Delete hpux9 and hpux10.

The libtool.m4 files are from GNU libtool.  I don't think these files should be 
changed.

Dave

--
John David Anglin  dave.ang...@bell.net



Re: [PATCH] 32-bit PA-RISC with HP-UX: remove deprecated ports

2022-08-26 Thread John David Anglin

On 2022-08-26 3:15 a.m., Martin Liška wrote:

fixincludes/ChangeLog:

* configure: Regenerate.
* inclhack.def: Remove patterns for deprecated ports.
* fixincl.x: Regenerate.

There are problems with the fixincludes changes.  These break build on 
hppa64-hpux11.

configure:4015: checking whether we are cross compiling
configure:4023: /home/dave/gnu/gcc/objdir64/./gcc/xgcc -B/home/dave/gnu/gcc/objd
ir64/./gcc/ -B/opt/gnu64/gcc/gcc-12/hppa64-hp-hpux11.11/bin/ -B/opt/gnu64/gcc/gc
c-12/hppa64-hp-hpux11.11/lib/ -isystem /opt/gnu64/gcc/gcc-12/hppa64-hp-hpux11.11
/include -isystem /opt/gnu64/gcc/gcc-12/hppa64-hp-hpux11.11/sys-include   -fno-c
hecking -o conftest -g -O2   conftest.c  >&5
In file included from /home/dave/gnu/gcc/objdir64/gcc/include-fixed/stdio.h:21,
 from conftest.c:11:
/home/dave/gnu/gcc/objdir64/gcc/include-fixed/stdio.h:608:59: error: unknown 
type name 'va_list'
  608 |  extern int vsnprintf(char *, __size_t, const char *, __va__list);
  | ^~
/home/dave/gnu/gcc/objdir64/gcc/include-fixed/stdio.h:116:1: note: 'va_list' is defined in header ''; did you forget to '#include 
'?

  115 | #   include 

Some hpux11 specific hacks are removed.  Some non system specific hpux hacks 
are also removed.
One can't trust comments or hacknames to infer applicability.

Dave

--
John David Anglin  dave.ang...@bell.net



[COMMITTED] hpux: New include hack to fix declarations of _DINFINITY, _SINFINITY and _SQNAN

2022-02-27 Thread John David Anglin
The declarations of _DINFINITY, _SINFINITY and _SQNAN need to be constant
expressions.

Committed to trunk.

Dave
---

2022-02-27  John David Anglin  

fixincludes/ChangeLog:
* inclhack.def (hpux_math_constexpr): New hack.
* fixincl.x: Regenerate.
* tests/base/math.h: Update.

diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 8400d0c696b..7605ac89aa2 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -2282,6 +2282,24 @@ fix = {
 "   }\n";
 };
 
+/*
+ * This hack fixes the declarations of _DINFINITY, _SINFINITY and _SQNAN.
+ */
+fix = {
+hackname  = hpux_math_constexpr;
+mach  = "*-hp-hpux11*";
+files = math.h;
+sed   = "s@^[ \t]*extern[ \t]*const[ \t]*double[ \t]*_DINFINITY;"
+   "[ \t]*$@#  define _DINFINITY (__builtin_inf ())@";
+sed   = "s@^[ \t]*extern[ \t]*const[ \t]*float[ \t]*_SINFINITY;"
+   "[ \t]*$@#define _SINFINITY (__builtin_inff ())@";
+sed   = "s@^[ \t]*extern[ \t]*const[ \t]*float[ \t]*_SQNAN;"
+   "[ \t]*$@#define _SQNAN (__builtin_nanf (\\\"\\\"))@";
+test_text = "  extern const double _DINFINITY;\n"
+   "  extern const float _SINFINITY;\n"
+   "  extern const float _SQNAN;";
+};
+
 /*
  *  Fix hpux 10.X missing ctype declarations 1
  */
diff --git a/fixincludes/tests/base/math.h b/fixincludes/tests/base/math.h
index 7525fd82ecf..29b67579748 100644
--- a/fixincludes/tests/base/math.h
+++ b/fixincludes/tests/base/math.h
@@ -57,6 +57,13 @@
 #endif  /* HPUX11_CPP_POW_INLINE_CHECK */
 
 
+#if defined( HPUX_MATH_CONSTEXPR_CHECK )
+#  define _DINFINITY (__builtin_inf ())
+#define _SINFINITY (__builtin_inff ())
+#define _SQNAN (__builtin_nanf (""))
+#endif  /* HPUX_MATH_CONSTEXPR_CHECK */
+
+
 #if defined( HPUX11_FABSF_CHECK )
 #ifdef _PA_RISC
 #ifndef __cplusplus


signature.asc
Description: PGP signature


[COMMITTED] hppa: Adjust shadd-2 and shadd-3 scan counts

2022-01-02 Thread John David Anglin
Fixes shadd-2.c and shadd-3.c test fails on trunk.

Committed to trunk.

Dave
---

Adjust shadd-2 and shadd-3 scan counts.

2022-01-02  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.target/hppa/shadd-2.c: Adjust count to 3.
* gcc.target/hppa/shadd-3.c: Likewise.

diff --git a/gcc/testsuite/gcc.target/hppa/shadd-2.c 
b/gcc/testsuite/gcc.target/hppa/shadd-2.c
index b92f782cf0d..74d4fcd146e 100644
--- a/gcc/testsuite/gcc.target/hppa/shadd-2.c
+++ b/gcc/testsuite/gcc.target/hppa/shadd-2.c
@@ -1,6 +1,6 @@
 /* { dg-do compile }  */
 /* { dg-options "-O2" }  */
-/* { dg-final { scan-assembler-times "sh.add" 4 } }  */
+/* { dg-final { scan-assembler-times "sh.add" 3 } }  */
 
 typedef struct rtx_def *rtx;
 typedef const struct rtx_def *const_rtx;
diff --git a/gcc/testsuite/gcc.target/hppa/shadd-3.c 
b/gcc/testsuite/gcc.target/hppa/shadd-3.c
index 2d0b648f384..a0c1f663d56 100644
--- a/gcc/testsuite/gcc.target/hppa/shadd-3.c
+++ b/gcc/testsuite/gcc.target/hppa/shadd-3.c
@@ -10,7 +10,7 @@
over time we'll have to revisit the combine and/or postreload
dumps.  Note we have disabled delay slot filling to improve
test stability.  */
-/* { dg-final { scan-assembler-times "sh.add" 4 } }  */
+/* { dg-final { scan-assembler-times "sh.add" 3 } }  */
 
 extern void oof (void);
 typedef struct simple_bitmap_def *sbitmap;



signature.asc
Description: PGP signature


[COMMITTED] hppa: Skip gcc.dg/guality/example.c on hppa-linux

2022-01-02 Thread John David Anglin
This test hangs on hppa-linux. Don't know why exactly but it seems
to be a sequencing issue with gdb. The hang breaks automated builds
as the test doesn't timeout.

Tested on hppa-unknown-linux-gnu. Committed to trunk.

Dave
---

Skip gcc.dg/guality/example.c on hppa-linux.

2022-01-02  John David Anglin  

gcc/testsuite/ChangeLog:

* gcc.dg/guality/example.c: Skip on hppa*-*-linux*.

diff --git a/gcc/testsuite/gcc.dg/guality/example.c 
b/gcc/testsuite/gcc.dg/guality/example.c
index 32014e2b4c0..0d5f48ba116 100644
--- a/gcc/testsuite/gcc.dg/guality/example.c
+++ b/gcc/testsuite/gcc.dg/guality/example.c
@@ -1,3 +1,4 @@
+/* { dg-skip-if "gdb hang" { hppa*-*-linux* } } */
 /* { dg-options "-g" } */
 /* { dg-do run { xfail { ! aarch64*-*-* } } } */
 /* { dg-xfail-run-if "" aarch64*-*-* "*" { "-O[01g]" } } */



signature.asc
Description: PGP signature


[COMMITTED] hppa: Generate illegal instruction fault if LWS syscall returns -EFAULT

2022-01-02 Thread John David Anglin
The kernel compare and exchange calls will never succeed if they
return -EFAULT. This change generates an instruction fault if a
call returns -EFAULT. This prevents the code from spinning forever.

Tested on hppa-unknown-linux-gnu. Committed to trunk and gcc-11 branch.

Dave
---

Generate illegal instruction fault if LWS syscall returns -EFAULT.

2022-01-02  John David Anglin  

libgcc/ChangeLog:

* config/pa/linux-atomic.c (_ASM_EFAULT): Define.
(__kernel_cmpxchg): Nullify illegal iitlbp instruction if error
return is not equal _ASM_EFAULT.
(__kernel_cmpxchg2): Likewise.

diff --git a/libgcc/config/pa/linux-atomic.c b/libgcc/config/pa/linux-atomic.c
index 500a3652499..e4d74b2d598 100644
--- a/libgcc/config/pa/linux-atomic.c
+++ b/libgcc/config/pa/linux-atomic.c
@@ -28,6 +28,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If 
not, see
 #define EBUSY   16
 #define ENOSYS 251 
 
+#define _ASM_EFAULT "-14"
+
 typedef unsigned char u8;
 typedef short unsigned int u16;
 #ifdef __LP64__
@@ -58,6 +60,8 @@ __kernel_cmpxchg (volatile void *mem, int oldval, int newval)
   register long lws_errno asm("r21");
   asm volatile (   "ble0xb0(%%sr2, %%r0)   \n\t"
"ldi%2, %%r20   \n\t"
+   "cmpiclr,<> " _ASM_EFAULT ", %%r21, %%r0\n\t"
+   "iitlbp %%r0,(%%sr0, %%r0)  \n\t"
: "=r" (lws_ret), "=r" (lws_errno)
: "i" (LWS_CAS), "r" (lws_mem), "r" (lws_old), "r" (lws_new)
: "r1", "r20", "r22", "r23", "r29", "r31", "memory"
@@ -84,6 +88,8 @@ __kernel_cmpxchg2 (volatile void *mem, const void *oldval, 
const void *newval,
   register long lws_errno asm("r21");
   asm volatile (   "ble0xb0(%%sr2, %%r0)   \n\t"
"ldi%6, %%r20   \n\t"
+   "cmpiclr,<> " _ASM_EFAULT ", %%r21, %%r0\n\t"
+   "iitlbp %%r0,(%%sr0, %%r0)  \n\t"
: "=r" (lws_ret), "=r" (lws_errno), "+r" (lws_mem),
  "+r" (lws_old), "+r" (lws_new), "+r" (lws_size)
: "i" (2)



signature.asc
Description: PGP signature


[COMMITTED] hppa: Use optab_libfunc to access sync_lock_test_and_set libfunc

2022-01-02 Thread John David Anglin
This patch revises the atomic store code for hppa-linux to use optab_libfunc
to access the sync_lock_test_and_set libfunc. We now call
convert_memory_address() to convert the memory address to Pmode. This
should handle more memory addresses.

Tested on hppa-unknown-linux-gnu. Committed to trunk and gcc-11 branch.

Dave
---

Use optab_libfunc to access sync_lock_test_and_set libfunc on hppa-linux.

2022-01-02  John David Anglin  

gcc/ChangeLog:

* config/pa/pa.md (atomic_storeq): Use optab_libfunc to access
sync_lock_test_and_set libfunc. Call convert_memory_address to
convert memory address to Pmode.
(atomic_storehi, atomic_storesi, atomic_storedi): Likewise.

diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index af5449a9ea3..31e3b1bff80 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -10366,10 +10366,10 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
 {
   if (TARGET_SYNC_LIBCALL)
 {
-  rtx libfunc = init_one_libfunc ("__sync_lock_test_and_set_1");
+  rtx libfunc = optab_libfunc (sync_lock_test_and_set_optab, QImode);
+  rtx addr = convert_memory_address (Pmode, XEXP (operands[0], 0));
 
-  emit_library_call (libfunc, LCT_NORMAL, VOIDmode,
-XEXP (operands[0], 0), Pmode,
+  emit_library_call (libfunc, LCT_NORMAL, VOIDmode, addr, Pmode,
 operands[1], QImode);
   DONE;
 }
@@ -10386,10 +10386,10 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
 {
   if (TARGET_SYNC_LIBCALL)
 {
-  rtx libfunc = init_one_libfunc ("__sync_lock_test_and_set_2");
+  rtx libfunc = optab_libfunc (sync_lock_test_and_set_optab, HImode);
+  rtx addr = convert_memory_address (Pmode, XEXP (operands[0], 0));
 
-  emit_library_call (libfunc, LCT_NORMAL, VOIDmode,
-XEXP (operands[0], 0), Pmode,
+  emit_library_call (libfunc, LCT_NORMAL, VOIDmode, addr, Pmode,
 operands[1], HImode);
   DONE;
 }
@@ -10406,10 +10406,10 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
 {
   if (TARGET_SYNC_LIBCALL)
 {
-  rtx libfunc = init_one_libfunc ("__sync_lock_test_and_set_4");
+  rtx libfunc = optab_libfunc (sync_lock_test_and_set_optab, SImode);
+  rtx addr = convert_memory_address (Pmode, XEXP (operands[0], 0));
 
-  emit_library_call (libfunc, LCT_NORMAL, VOIDmode,
-XEXP (operands[0], 0), Pmode,
+  emit_library_call (libfunc, LCT_NORMAL, VOIDmode, addr, Pmode,
 operands[1], SImode);
   DONE;
 }
@@ -10459,10 +10459,10 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
 
   if (TARGET_SYNC_LIBCALL)
 {
-  rtx libfunc = init_one_libfunc ("__sync_lock_test_and_set_8");
+  rtx libfunc = optab_libfunc (sync_lock_test_and_set_optab, DImode);
+  rtx addr = convert_memory_address (Pmode, XEXP (operands[0], 0));
 
-  emit_library_call (libfunc, LCT_NORMAL, VOIDmode,
-XEXP (operands[0], 0), Pmode,
+  emit_library_call (libfunc, LCT_NORMAL, VOIDmode, addr, Pmode,
 operands[1], DImode);
   DONE;
 }



signature.asc
Description: PGP signature


[committed] hppa: Improve atomic store implementation on hppa-linux

2021-12-27 Thread John David Anglin
Atomic stores on hppa-linux must be synthesized using the kernel
light-weight system calls. Instead of using a compare and swap loop,
it is more efficient to use the __sync_lock_test_and_set routines
in libgcc.

Tested on hppa-unknown-linux-gnu. Committed to trunk and gcc-11.

Dave
---

Improve atomic store implementation on hppa-linux.

2021-12-27  John David Anglin  

gcc/ChangeLog:

* config/pa/pa-protos.h: Delete
pa_maybe_emit_compare_and_swap_exchange_loop() declaration.
* config/pa/pa.c (pa_expand_compare_and_swap_loop): Delete.
(pa_maybe_emit_compare_and_swap_exchange_loop): Delete.
* config/pa/pa.md (atomic_storeq): Use __sync_lock_test_and_set
instead of pa_maybe_emit_compare_and_swap_exchange_loop.
(atomic_storehi, atomic_storesi, atomic_storedi): Likewise.

diff --git a/gcc/config/pa/pa-protos.h b/gcc/config/pa/pa-protos.h
index 5bf6fef4968..69377db45c5 100644
--- a/gcc/config/pa/pa-protos.h
+++ b/gcc/config/pa/pa-protos.h
@@ -73,7 +73,6 @@ extern rtx pa_return_addr_rtx (int, rtx);
 
 extern int pa_insn_refs_are_delayed (rtx_insn *);
 extern rtx pa_get_deferred_plabel (rtx);
-extern rtx pa_maybe_emit_compare_and_swap_exchange_loop (rtx, rtx, rtx);
 #endif /* RTX_CODE */
 
 extern int pa_and_mask_p (unsigned HOST_WIDE_INT);
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 2b10ef34061..895978aea1c 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -11023,82 +11023,6 @@ pa_output_addr_diff_vec (rtx lab, rtx body)
 fputs ("\t.end_brtab\n", asm_out_file);
 }
 
-/* This is a helper function for the other atomic operations.  This function
-   emits a loop that contains SEQ that iterates until a compare-and-swap
-   operation at the end succeeds.  MEM is the memory to be modified.  SEQ is
-   a set of instructions that takes a value from OLD_REG as an input and
-   produces a value in NEW_REG as an output.  Before SEQ, OLD_REG will be
-   set to the current contents of MEM.  After SEQ, a compare-and-swap will
-   attempt to update MEM with NEW_REG.  The function returns true when the
-   loop was generated successfully.  */
-
-static bool
-pa_expand_compare_and_swap_loop (rtx mem, rtx old_reg, rtx new_reg, rtx seq)
-{
-  machine_mode mode = GET_MODE (mem);
-  rtx_code_label *label;
-  rtx cmp_reg, success, oldval;
-
-  /* The loop we want to generate looks like
-
-cmp_reg = mem;
-  label:
-old_reg = cmp_reg;
-seq;
-(success, cmp_reg) = compare-and-swap(mem, old_reg, new_reg)
-if (success)
-  goto label;
-
- Note that we only do the plain load from memory once.  Subsequent
- iterations use the value loaded by the compare-and-swap pattern.  */
-
-  label = gen_label_rtx ();
-  cmp_reg = gen_reg_rtx (mode);
-
-  emit_move_insn (cmp_reg, mem);
-  emit_label (label);
-  emit_move_insn (old_reg, cmp_reg);
-  if (seq)
-emit_insn (seq);
-
-  success = NULL_RTX;
-  oldval = cmp_reg;
-  if (!expand_atomic_compare_and_swap (, , mem, old_reg,
-   new_reg, false, MEMMODEL_SYNC_SEQ_CST,
-   MEMMODEL_RELAXED))
-return false;
-
-  if (oldval != cmp_reg)
-emit_move_insn (cmp_reg, oldval);
-
-  /* Mark this jump predicted not taken.  */
-  emit_cmp_and_jump_insns (success, const0_rtx, EQ, const0_rtx,
-   GET_MODE (success), 1, label,
-  profile_probability::guessed_never ());
-  return true;
-}
-
-/* This function tries to implement an atomic exchange operation using a 
-   compare_and_swap loop. VAL is written to *MEM.  The previous contents of
-   *MEM are returned, using TARGET if possible.  No memory model is required
-   since a compare_and_swap loop is seq-cst.  */
-
-rtx
-pa_maybe_emit_compare_and_swap_exchange_loop (rtx target, rtx mem, rtx val)
-{
-  machine_mode mode = GET_MODE (mem);
-
-  if (can_compare_and_swap_p (mode, true))
-{
-  if (!target || !register_operand (target, mode))
-target = gen_reg_rtx (mode);
-  if (pa_expand_compare_and_swap_loop (mem, target, val, NULL_RTX))
-return target;
-}
-
-  return NULL_RTX;
-}
-
 /* Implement TARGET_CALLEE_COPIES.  The callee is responsible for copying
arguments passed by hidden reference in the 32-bit HP runtime.  Users
can override this behavior for better compatibility with openmp at the
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index f124c301b7a..af5449a9ea3 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -10366,10 +10366,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
 {
   if (TARGET_SYNC_LIBCALL)
 {
-  rtx mem = operands[0];
-  rtx val = operands[1];
-  if (pa_maybe_emit_compare_and_swap_exchange_loop (NULL_RTX, mem, val))
-   DONE;
+  rtx libfunc = init_one_libfunc ("__sync_lock_test_and_set_1");
+
+  emit_library_call (libfunc, LCT_NORMAL, VOIDmode,
+XEX

[committed] hppa: Fix typo in t-dimode

2021-11-27 Thread John David Anglin

This patch fixes a typo in t-dimode.  This caused __lshrdi3 to be dropped from 
libgcc.

Tested by build on hppa64-linux-gnu.

Committed to trunk and gcc-11.

Dave
---
Fix typo in t-dimode

2021-11-27  John David Anglin  

libgcc/ChangeLog:

* config/pa/t-dimode (lib2difuncs): Fix typo.

diff --git a/libgcc/config/pa/t-dimode b/libgcc/config/pa/t-dimode
index 1344e937644..19252a6e6b1 100644
--- a/libgcc/config/pa/t-dimode
+++ b/libgcc/config/pa/t-dimode
@@ -1,5 +1,5 @@
 # Extra DImode libgcc2 functions to build.
-lib2difuncs = _muldi3 _negdi2 _lshrdi _ashldi3 _ashrdi3 _cmpdi2 _ucmpdi2
+lib2difuncs = _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _cmpdi2 _ucmpdi2

 # Build lib2difuncs.
 lib2difuncs-o = $(patsubst %,%_di$(objext),$(lib2difuncs))


Re: [PATCH] pch: Add support for PCH for relocatable executables

2021-11-08 Thread John David Anglin

On 2021-11-08 2:48 p.m., Jakub Jelinek wrote:

Not really sure about PA or IA-64 function descriptors, are any of those
allocated by the dynamic linker rather than created by the static linker?

On PA, the static linker creates all function descriptors.  The dynamic linker 
is responsible for
resolving descriptors when lazy binding is used.

The primary difference between 32 and 64-bit descriptors is that there can be 
multiple descriptors
that resolve to the same function in the 32-bit run time.  In the 64-bit case, 
there is one official
procedure descriptor for each function.

I guess instead of removing the c-pch.c changes we could remember there
not just a function pointer, but also a data pointer and compare if both
are either the same or have the same load bias and punt only if they
have different bias.  Though, on architecture where all function pointers
would be dynamically allocated and could change any time even that wouldn't
be really a reliable check.

There is no call to dynamically allocate a descriptor but it is possible for 
code to dynamically build a descriptor.

Dave

--
John David Anglin  dave.ang...@bell.net



[committed] hppa: Support TI mode and soft float on PA64

2021-11-05 Thread John David Anglin

Without TImode support on hppa64, it is necessary to disable building libgomp 
with fortran.

Previously, we didn't support TImode because we need both DImode and TImode 
divmod routines
from libgcc.  The standard build only builds one of the two.  This is nominally 
determined
by MIN_UNITS_PER_WORD.  I created a makefile fragment to build the needed 
DImode routines.

Since the alignment requirements for TImode are not defined, I just assumed the 
standard
alignment and calling convention for a structure containing a pair of 64-bit 
words.

I also added softfp support based on early mips float format and hppa glibc 
exception support.

Tested on hppa64-hp-hpux11.11 and hppa64-unknown-linux-gnu.

Committed on trunk and gcc-11.

Dave
---
Support TI mode and soft float on PA64

This change implements TI mode on PA64.  Various new patterns are
added to pa.md.  The libgcc build needed modification to build both
DI and TI routines.  We also need various softfp routines to
convert to and from TImode.

I added full softfp for the -msoft-float option.  At the moment,
this doesn't completely eliminate all use of the floating-point
co-processor.  For this, libgcc needs to be built with -msoft-mult.
The floating-point exception support also needs a soft option.

2021-11-05  John David Anglin  

PR libgomp/96661

gcc/ChangeLog:

* config/pa/pa-modes.def: Add OImode integer type.
* config/pa/pa.c (pa_scalar_mode_supported_p): Allow TImode
for TARGET_64BIT.
* config/pa/pa.h (MIN_UNITS_PER_WORD) Define to MIN_UNITS_PER_WORD
to UNITS_PER_WORD if IN_LIBGCC2.
* config/pa/pa.md (addti3, addvti3, subti3, subvti3, negti2,
negvti2, ashlti3, shrpd_internal): New patterns.
Change some multi instruction types to multi.

libgcc/ChangeLog:

* config.host (hppa*64*-*-linux*): Revise tmake_file.
(hppa*64*-*-hpux11*): Likewise.
* config/pa/sfp-exceptions.c: New.
* config/pa/sfp-machine.h: New.
* config/pa/t-dimode: New.
* config/pa/t-softfp-sfdftf: New.

diff --git a/gcc/config/pa/pa-modes.def b/gcc/config/pa/pa-modes.def
index 769de66f6b6..6020233c171 100644
--- a/gcc/config/pa/pa-modes.def
+++ b/gcc/config/pa/pa-modes.def
@@ -30,3 +30,6 @@ FLOAT_MODE (TF, 16, mips_quad_format);

 /* HPPA floating comparisons produce distinct condition codes.  */
 CC_MODE (CCFP);
+
+/* Mode used for signed overflow checking of TImode.  */
+INT_MODE (OI, 32);
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 21b812e9be7..f22d25a4066 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -6550,18 +6550,16 @@ hppa_gimplify_va_arg_expr (tree valist, tree type, 
gimple_seq *pre_p,

 /* True if MODE is valid for the target.  By "valid", we mean able to
be manipulated in non-trivial ways.  In particular, this means all
-   the arithmetic is supported.
-
-   Currently, TImode is not valid as the HP 64-bit runtime documentation
-   doesn't document the alignment and calling conventions for this type.
-   Thus, we return false when PRECISION is 2 * BITS_PER_WORD and
-   2 * BITS_PER_WORD isn't equal LONG_LONG_TYPE_SIZE.  */
+   the arithmetic is supported.  */

 static bool
 pa_scalar_mode_supported_p (scalar_mode mode)
 {
   int precision = GET_MODE_PRECISION (mode);

+  if (TARGET_64BIT && mode == TImode)
+return true;
+
   switch (GET_MODE_CLASS (mode))
 {
 case MODE_PARTIAL_INT:
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 7a313d617b0..96815ec69cb 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -255,11 +258,17 @@ typedef struct GTY(()) machine_function
is UNITS_PER_WORD.  Otherwise, it is the constant value that is the
smallest value that UNITS_PER_WORD can have at run-time.

-   FIXME: This needs to be 4 when TARGET_64BIT is true to suppress the
-   building of various TImode routines in libgcc.  The HP runtime
-   specification doesn't provide the alignment requirements and calling
-   conventions for TImode variables.  */
-#define MIN_UNITS_PER_WORD 4
+   This needs to be 8 when TARGET_64BIT is true to allow building various
+   TImode routines in libgcc.  However, we also need the DImode DIVMOD
+   routines because they are not currently implemented in pa.md.
+
+   The HP runtime specification doesn't provide the alignment requirements
+   and calling conventions for TImode variables.  */
+#ifdef IN_LIBGCC2
+#define MIN_UNITS_PER_WORD  UNITS_PER_WORD
+#else
+#define MIN_UNITS_PER_WORD  4
+#endif

 /* The widest floating point format supported by the hardware.  Note that
setting this influences some Ada floating point type sizes, currently
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index ea6da457fcb..f124c301b7a 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -5357,6 +5357,88 @@
   [(set_attr "type" "binary,binary")
(set_attr "length" "4,4")])

+(define_insn &q

  1   2   3   4   5   6   7   >