[PATCH] sccvn: Avoid UB in ao_ref_init_from_vn_reference [PR105533]

2024-03-06 Thread Jakub Jelinek
Hi!

When compiling libgcc or on e.g.
int a[64];
int p;

void
foo (void)
{
  int s = 1;
  while (p)
{
  s -= 11;
  a[s] != 0;
}
}
sccvn invokes UB in the compiler as detected by ubsan:
../../gcc/poly-int.h:1089:5: runtime error: left shift of negative value -40
The problem is that we still use C++11..C++17 as the implementation language
and in those C++ versions shifting negative values left is UB (well defined
since C++20) and above in
   offset += op->off << LOG2_BITS_PER_UNIT;
op->off is poly_int64 with -40 value (in libgcc with -8).
I understand the offset_int << LOG2_BITS_PER_UNIT shifts but it is then well
defined during underlying implementation which is done on the uhwi limbs,
but for poly_int64 we use
offset += pop->off * BITS_PER_UNIT;
a few lines earlier and I think that is both more readable in what it
actually does and triggers UB only if there would be signed multiply
overflow.  In the end, the compiler will treat them the same at least at the
RTL level (at least, if not and they aren't the same cost, it should).

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2024-03-07  Jakub Jelinek  

PR middle-end/105533
* tree-ssa-sccvn.cc (ao_ref_init_from_vn_reference) :
Multiple op->off by BITS_PER_UNIT instead of shifting it left by
LOG2_BITS_PER_UNIT.

--- gcc/tree-ssa-sccvn.cc.jj2024-02-28 22:57:18.318658827 +0100
+++ gcc/tree-ssa-sccvn.cc   2024-03-06 14:52:16.819229719 +0100
@@ -1221,7 +1221,7 @@ ao_ref_init_from_vn_reference (ao_ref *r
  if (maybe_eq (op->off, -1))
max_size = -1;
  else
-   offset += op->off << LOG2_BITS_PER_UNIT;
+   offset += op->off * BITS_PER_UNIT;
  break;
 
case REALPART_EXPR:


Jakub



回复: RE: [PATCH] RISC-V: Fix ICE in riscv vector costs

2024-03-06 Thread juzhe.zh...@rivai.ai
I suggest open an PR with a PR id.



juzhe.zh...@rivai.ai
 
发件人: Demin Han
发送时间: 2024-03-07 15:39
收件人: juzhe.zh...@rivai.ai; gcc-patches
抄送: kito.cheng; pan2.li; jeffreyalaw
主题: RE: [PATCH] RISC-V: Fix ICE in riscv vector costs
OK.
Which is better for testcase name?
1.  ice-biggestmode.c or
2.  Report a bug and name the testcase with PR id
 
From: juzhe.zh...@rivai.ai  
Sent: 2024年3月7日 15:20
To: Demin Han ; gcc-patches 

Cc: kito.cheng ; pan2.li ; jeffreyalaw 

Subject: Re: [PATCH] RISC-V: Fix ICE in riscv vector costs
 
Could you plz add testcase ? I just noticed you didn't append a testcase (jpeg) 
in this patch.
 


juzhe.zh...@rivai.ai
 
From: demin.han
Date: 2024-03-07 13:54
To: gcc-patches
CC: juzhe.zhong; kito.cheng; pan2.li; jeffreyalaw
Subject: [PATCH] RISC-V: Fix ICE in riscv vector costs
The following code can result in ICE:
-march=rv64gcv_zba_zbb --param riscv-autovec-lmul=dynamic -O3
 
char *jpeg_difference7_input_buf;
void jpeg_difference7(int *diff_buf) {
  unsigned width;
  int samp, Rb;
  while (--width) {
Rb = samp = *jpeg_difference7_input_buf;
*diff_buf++ = -(int)(samp + (long)Rb >> 1);
  }
}
 
One biggest_mode update missed in one branch and trigger assertion fail.
gcc_assert (biggest_size >= mode_size);
 
Tested On RV64 and no regression.
 
gcc/ChangeLog:
 
* config/riscv/riscv-vector-costs.cc: Fix ICE
 
Signed-off-by: demin.han 
---
gcc/config/riscv/riscv-vector-costs.cc | 2 ++
1 file changed, 2 insertions(+)
 
diff --git a/gcc/config/riscv/riscv-vector-costs.cc 
b/gcc/config/riscv/riscv-vector-costs.cc
index 7c9840df4e9..f13a1296b31 100644
--- a/gcc/config/riscv/riscv-vector-costs.cc
+++ b/gcc/config/riscv/riscv-vector-costs.cc
@@ -413,6 +413,8 @@ compute_local_live_ranges (
  auto *r = get_live_range (live_ranges, arg);
  gcc_assert (r);
  (*r).second = MAX (point, (*r).second);
+   biggest_mode = get_biggest_mode (
+ biggest_mode, TYPE_MODE (TREE_TYPE (arg)));
}
}
  else
-- 
2.44.0
 
 


[Bug rtl-optimization/114261] [13/14 Regression] Scheduling takes excessive time (97%)

2024-03-06 Thread patrick at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114261

Patrick O'Neill  changed:

   What|Removed |Added

  Attachment #57640|0   |1
is obsolete||

--- Comment #4 from Patrick O'Neill  ---
Created attachment 57642
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57642=edit
Raw testcase and headers

Thanks for catching that, here's the zip file with actual files in it this time
;)

[gcc r14-9350] match.pd: Optimize a * !a to 0 [PR114009]

2024-03-06 Thread Jakub Jelinek via Gcc-cvs
https://gcc.gnu.org/g:95b6ee96348041eaee9133f082b57f3e57ef0b11

commit r14-9350-g95b6ee96348041eaee9133f082b57f3e57ef0b11
Author: Jakub Jelinek 
Date:   Thu Mar 7 08:43:16 2024 +0100

match.pd: Optimize a * !a to 0 [PR114009]

The following patch attempts to fix an optimization regression through
adding a simple simplification.  We already have the
/* (m1 CMP m2) * d -> (m1 CMP m2) ? d : 0  */
(if (!canonicalize_math_p ())
 (for cmp (tcc_comparison)
  (simplify
   (mult:c (convert (cmp@0 @1 @2)) @3)
   (if (INTEGRAL_TYPE_P (type)
&& INTEGRAL_TYPE_P (TREE_TYPE (@0)))
 (cond @0 @3 { build_zero_cst (type); })))
optimization which otherwise triggers during the a * !a multiplication,
but that is done only late and we aren't able through range assumptions
optimize it yet anyway.

The patch adds a specific simplification for it.
If a is zero, then a * !a will be 0 * 1 (or for signed 1-bit 0 * -1)
and so 0.
If a is non-zero, then a * !a will be a * 0 and so again 0.
THe pattern is valid for scalar integers, complex integers and vector types,
but I think will actually trigger only for the scalar integers.  For
vector types I've added other two with VEC_COND_EXPR in it, for complex
there are different GENERIC trees to match and it is something that likely
would be never matched in GIMPLE, so I didn't handle that.

2024-03-07  Jakub Jelinek  

PR tree-optimization/114009
* genmatch.cc (decision_tree::gen): Emit ARG_UNUSED for captures
argument even for GENERIC, not just for GIMPLE.
* match.pd (a * !a -> 0): New simplifications.

* gcc.dg/tree-ssa/pr114009.c: New test.

Diff:
---
 gcc/genmatch.cc  |  2 +-
 gcc/match.pd | 11 +++
 gcc/testsuite/gcc.dg/tree-ssa/pr114009.c | 33 
 3 files changed, 45 insertions(+), 1 deletion(-)

diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc
index 61c4c8c0294..c982c95b70f 100644
--- a/gcc/genmatch.cc
+++ b/gcc/genmatch.cc
@@ -4071,7 +4071,7 @@ decision_tree::gen (vec  , bool gimple)
  for (unsigned i = 0;
   i < as_a (s->s->s->match)->ops.length (); ++i)
fp_decl (f, " tree ARG_UNUSED (_p%d),", i);
- fp_decl (f, " tree *captures");
+ fp_decl (f, " tree *ARG_UNUSED (captures)");
}
   for (unsigned i = 0; i < s->s->s->for_subst_vec.length (); ++i)
{
diff --git a/gcc/match.pd b/gcc/match.pd
index 4edba7c84fb..9ce313323a3 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -1219,6 +1219,17 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
&& tree_nop_conversion_p (type, TREE_TYPE (@1)))
(lshift @0 @2)))
 
+/* Fold a * !a into 0.  */
+(simplify
+ (mult:c @0 (convert? (eq @0 integer_zerop)))
+  { build_zero_cst (type); })
+(simplify
+ (mult:c @0 (vec_cond (eq @0 integer_zerop) @1 integer_zerop))
+  { build_zero_cst (type); })
+(simplify
+ (mult:c @0 (vec_cond (ne @0 integer_zerop) integer_zerop @1))
+  { build_zero_cst (type); })
+
 /* Shifts by precision or greater result in zero.  */
 (for shift (lshift rshift)
  (simplify
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr114009.c 
b/gcc/testsuite/gcc.dg/tree-ssa/pr114009.c
new file mode 100644
index 000..3b0486e16ad
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr114009.c
@@ -0,0 +1,33 @@
+/* PR tree-optimization/114009 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wno-psabi -fdump-tree-forwprop1" } */
+/* { dg-final { scan-tree-dump-times "  return 0;" 3 "forwprop1" } } */
+/* { dg-final { scan-tree-dump-times "  (?:return| =) { 0, 0, 0, 0 };" 
1 "forwprop1" } } */
+
+int
+foo (int x)
+{
+  x = (x / 2) * 2;
+  return (!x) * x;
+}
+
+int
+bar (int x, int y)
+{
+  (void) x;
+  return y * !y;
+}
+
+unsigned long long
+baz (unsigned long long x)
+{
+  return (!x) * x;
+}
+
+typedef int V __attribute__((vector_size (4 * sizeof (int;
+
+V
+qux (V x)
+{
+  return x * (x == 0);
+}


[Bug tree-optimization/114009] [11/12/13/14 Regression] Missed optimization: (!a) * a => 0 when a=(a/2)*2

2024-03-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114009

--- Comment #5 from GCC Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:95b6ee96348041eaee9133f082b57f3e57ef0b11

commit r14-9350-g95b6ee96348041eaee9133f082b57f3e57ef0b11
Author: Jakub Jelinek 
Date:   Thu Mar 7 08:43:16 2024 +0100

match.pd: Optimize a * !a to 0 [PR114009]

The following patch attempts to fix an optimization regression through
adding a simple simplification.  We already have the
/* (m1 CMP m2) * d -> (m1 CMP m2) ? d : 0  */
(if (!canonicalize_math_p ())
 (for cmp (tcc_comparison)
  (simplify
   (mult:c (convert (cmp@0 @1 @2)) @3)
   (if (INTEGRAL_TYPE_P (type)
&& INTEGRAL_TYPE_P (TREE_TYPE (@0)))
 (cond @0 @3 { build_zero_cst (type); })))
optimization which otherwise triggers during the a * !a multiplication,
but that is done only late and we aren't able through range assumptions
optimize it yet anyway.

The patch adds a specific simplification for it.
If a is zero, then a * !a will be 0 * 1 (or for signed 1-bit 0 * -1)
and so 0.
If a is non-zero, then a * !a will be a * 0 and so again 0.
THe pattern is valid for scalar integers, complex integers and vector
types,
but I think will actually trigger only for the scalar integers.  For
vector types I've added other two with VEC_COND_EXPR in it, for complex
there are different GENERIC trees to match and it is something that likely
would be never matched in GIMPLE, so I didn't handle that.

2024-03-07  Jakub Jelinek  

PR tree-optimization/114009
* genmatch.cc (decision_tree::gen): Emit ARG_UNUSED for captures
argument even for GENERIC, not just for GIMPLE.
* match.pd (a * !a -> 0): New simplifications.

* gcc.dg/tree-ssa/pr114009.c: New test.

[Bug target/114252] Introducing bswapsi reduces code performance

2024-03-06 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114252

--- Comment #7 from Richard Biener  ---
Note I do understand what you are saying, just the middle-end in detecting and
using __builtin_bswap32 does what it does everywhere else - it checks whether
the target implements the operation.

The middle-end doesn't try to actually compare costs (it has no idea of the
bswapsi costs), and it most definitely doesn't see how AVR is special in
having only QImode registers and thus the created SImode load (which the
target supports!) will end up as four registers.  To me a 'bswap' on
AVR never makes sense since whatever is swapped will be _always_ available
as a set of byte registers.

That's why I question AVR exposing bswapsi to the middle-end rather than
suggesting the middle-end should maybe see whether AVR has any regs of
HImode or larger.  Note that would break for targets that could eventually
do a load-multiple byteswapped to a set of QImode regs (guess there's no
such one in GCC at least), but it's the only heuristic that might work here.

The only thing that maybe would make sense with AVR exposing bswapsi is
users calling __builtin_bswap but since it always expands as a libcall
even that makes no sense.

So my preferred fix would be to remove bswapsi from avr.md?

Does it benefit from recognizing bswap done with shifts on an int?

RE: [PATCH] RISC-V: Fix ICE in riscv vector costs

2024-03-06 Thread Demin Han
OK.
Which is better for testcase name?

1.  ice-biggestmode.c or

2.  Report a bug and name the testcase with PR id

From: juzhe.zh...@rivai.ai 
Sent: 2024年3月7日 15:20
To: Demin Han ; gcc-patches 

Cc: kito.cheng ; pan2.li ; jeffreyalaw 

Subject: Re: [PATCH] RISC-V: Fix ICE in riscv vector costs

Could you plz add testcase ? I just noticed you didn't append a testcase (jpeg) 
in this patch.


juzhe.zh...@rivai.ai

From: demin.han
Date: 2024-03-07 13:54
To: gcc-patches
CC: juzhe.zhong; 
kito.cheng; pan2.li; 
jeffreyalaw
Subject: [PATCH] RISC-V: Fix ICE in riscv vector costs
The following code can result in ICE:
-march=rv64gcv_zba_zbb --param riscv-autovec-lmul=dynamic -O3

char *jpeg_difference7_input_buf;
void jpeg_difference7(int *diff_buf) {
  unsigned width;
  int samp, Rb;
  while (--width) {
Rb = samp = *jpeg_difference7_input_buf;
*diff_buf++ = -(int)(samp + (long)Rb >> 1);
  }
}

One biggest_mode update missed in one branch and trigger assertion fail.
gcc_assert (biggest_size >= mode_size);

Tested On RV64 and no regression.

gcc/ChangeLog:

* config/riscv/riscv-vector-costs.cc: Fix ICE

Signed-off-by: demin.han 
mailto:demin@starfivetech.com>>
---
gcc/config/riscv/riscv-vector-costs.cc | 2 ++
1 file changed, 2 insertions(+)

diff --git a/gcc/config/riscv/riscv-vector-costs.cc 
b/gcc/config/riscv/riscv-vector-costs.cc
index 7c9840df4e9..f13a1296b31 100644
--- a/gcc/config/riscv/riscv-vector-costs.cc
+++ b/gcc/config/riscv/riscv-vector-costs.cc
@@ -413,6 +413,8 @@ compute_local_live_ranges (
  auto *r = get_live_range (live_ranges, arg);
  gcc_assert (r);
  (*r).second = MAX (point, (*r).second);
+   biggest_mode = get_biggest_mode (
+ biggest_mode, TYPE_MODE (TREE_TYPE (arg)));
}
}
  else
--
2.44.0




Results for 14.0.1 20240307 (experimental) [remotes/origin/HEAD r14-9349-g1cd8254eba] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-03-06 Thread Bill Seurer (POWER8) via Gcc-testresults


git commit g:1cd8254ebad7b73993d2acee80a7caf37c21878a
gcc-descr r14-9349-g1cd8254ebad7b7

power8
Linux 5.4.0-172-generic ppc64le
GNU Make 4.2.1

DejaGnu:
DejaGnu version 1.6.2
Expect version  5.45.4
Tcl version 8.6

64-bit

LAST_UPDATED: Thu Mar  7 05:40:39 UTC 2024 (revision r14-9349-g1cd8254eba)

Native configuration is powerpc64le-unknown-linux-gnu

=== gcc tests ===


Running target unix
XPASS: gcc.dg/Wtrampolines.c standard descriptors (test for warnings, line 32)
XPASS: gcc.dg/guality/example.c   -O0  execution test
XPASS: gcc.dg/guality/example.c  -Og -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O0  execution test
XPASS: gcc.dg/guality/guality.c   -O1  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O2  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/guality.c   -O3 -g  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c  -Og -DPREVENT_OPTIMIZATION  execution test
FAIL: gcc.dg/guality/inline-params-2.c   -O2  -DPREVENT_OPTIMIZATION  execution 
test
FAIL: gcc.dg/guality/inline-params-2.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
FAIL: gcc.dg/guality/inline-params-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
FAIL: gcc.dg/guality/inline-params-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  
execution test
FAIL: gcc.dg/guality/inline-params-2.c   -Os  -DPREVENT_OPTIMIZATION  execution 
test
FAIL: gcc.dg/guality/loop-1.c   -O2  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O3 -fomit-frame-pointer -funroll-loops 
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/pr36728-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 18 *x == (char) 25
FAIL: gcc.dg/guality/pr36728-3.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 y == 2
FAIL: gcc.dg/guality/pr36728-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 y == 
2
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i == 37
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i1 == 2 * 
37
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i2 == 3 * 
37
XPASS: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 j == 28 
+ 37
FAIL: gcc.dg/guality/pr41447-1.c   -O2  -DPREVENT_OPTIMIZATION  execution test
FAIL: gcc.dg/guality/pr41447-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
FAIL: gcc.dg/guality/pr41447-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
FAIL: gcc.dg/guality/pr41447-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  execution 
test
FAIL: gcc.dg/guality/pr41447-1.c   -Os  -DPREVENT_OPTIMIZATION  execution test
FAIL: gcc.dg/guality/pr41616-1.c   -O2  -DPREVENT_OPTIMIZATION  execution test
FAIL: gcc.dg/guality/pr41616-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
FAIL: gcc.dg/guality/pr41616-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
FAIL: gcc.dg/guality/pr41616-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  execution 
test
FAIL: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 34 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 39 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2  -DPREVENT_OPTIMIZATION  line 34 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2  -DPREVENT_OPTIMIZATION  line 39 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 34 c == [0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 39 c == [0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 34 c == [0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 39 c == [0]
FAIL: gcc.dg/guality/pr54200.c   -O1  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O2  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O3 -g  

[Bug middle-end/105533] UBSAN: gcc/expmed.cc:3272:26: runtime error: signed integer overflow: -9223372036854775808 - 1 cannot be represented in type 'long int'

2024-03-06 Thread rguenther at suse dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105533

--- Comment #10 from rguenther at suse dot de  ---
On Wed, 6 Mar 2024, jakub at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105533
> 
> Jakub Jelinek  changed:
> 
>What|Removed |Added
> 
>  CC||rguenth at gcc dot gnu.org
> 
> --- Comment #7 from Jakub Jelinek  ---
> The second UB is on
> #2  ao_ref_init_from_vn_reference (ref=, set=1, base_set=1,
> type=, ops=...) at ../../gcc/tree-ssa-sccvn.cc:1224
> 1224offset += op->off << LOG2_BITS_PER_UNIT;
> where op->off is negative.
> Isn't this just an unnecessary optimization?  I mean can't we just do
> offset += op->off * BITS_PER_UNIT;
> BITS_PER_UNIT is a constant 8 on all targets we support...

It's a habit from dealing with offset_int (but this is poly_int64)
where the multiply is possibly a lot more costly than a shift.

So yeah, a multiply is fine I guess.

[Bug rtl-optimization/114261] [13/14 Regression] Scheduling takes excessive time (97%)

2024-03-06 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114261

--- Comment #3 from Alexander Monakov  ---
The first attachment is empty (perhaps you made a non-recursive archive when
you meant to recursively zip a directory).

Re: [PATCH] RISC-V: Fix ICE in riscv vector costs

2024-03-06 Thread juzhe.zh...@rivai.ai
Could you plz add testcase ? I just noticed you didn't append a testcase (jpeg) 
in this patch.



juzhe.zh...@rivai.ai
 
From: demin.han
Date: 2024-03-07 13:54
To: gcc-patches
CC: juzhe.zhong; kito.cheng; pan2.li; jeffreyalaw
Subject: [PATCH] RISC-V: Fix ICE in riscv vector costs
The following code can result in ICE:
-march=rv64gcv_zba_zbb --param riscv-autovec-lmul=dynamic -O3
 
char *jpeg_difference7_input_buf;
void jpeg_difference7(int *diff_buf) {
  unsigned width;
  int samp, Rb;
  while (--width) {
Rb = samp = *jpeg_difference7_input_buf;
*diff_buf++ = -(int)(samp + (long)Rb >> 1);
  }
}
 
One biggest_mode update missed in one branch and trigger assertion fail.
gcc_assert (biggest_size >= mode_size);
 
Tested On RV64 and no regression.
 
gcc/ChangeLog:
 
* config/riscv/riscv-vector-costs.cc: Fix ICE
 
Signed-off-by: demin.han 
---
gcc/config/riscv/riscv-vector-costs.cc | 2 ++
1 file changed, 2 insertions(+)
 
diff --git a/gcc/config/riscv/riscv-vector-costs.cc 
b/gcc/config/riscv/riscv-vector-costs.cc
index 7c9840df4e9..f13a1296b31 100644
--- a/gcc/config/riscv/riscv-vector-costs.cc
+++ b/gcc/config/riscv/riscv-vector-costs.cc
@@ -413,6 +413,8 @@ compute_local_live_ranges (
  auto *r = get_live_range (live_ranges, arg);
  gcc_assert (r);
  (*r).second = MAX (point, (*r).second);
+   biggest_mode = get_biggest_mode (
+ biggest_mode, TYPE_MODE (TREE_TYPE (arg)));
}
}
  else
-- 
2.44.0
 
 


Re: [PATCH] RISC-V: Fix ICE in riscv vector costs

2024-03-06 Thread juzhe.zh...@rivai.ai
LGTM.



juzhe.zh...@rivai.ai
 
From: demin.han
Date: 2024-03-07 13:54
To: gcc-patches
CC: juzhe.zhong; kito.cheng; pan2.li; jeffreyalaw
Subject: [PATCH] RISC-V: Fix ICE in riscv vector costs
The following code can result in ICE:
-march=rv64gcv_zba_zbb --param riscv-autovec-lmul=dynamic -O3
 
char *jpeg_difference7_input_buf;
void jpeg_difference7(int *diff_buf) {
  unsigned width;
  int samp, Rb;
  while (--width) {
Rb = samp = *jpeg_difference7_input_buf;
*diff_buf++ = -(int)(samp + (long)Rb >> 1);
  }
}
 
One biggest_mode update missed in one branch and trigger assertion fail.
gcc_assert (biggest_size >= mode_size);
 
Tested On RV64 and no regression.
 
gcc/ChangeLog:
 
* config/riscv/riscv-vector-costs.cc: Fix ICE
 
Signed-off-by: demin.han 
---
gcc/config/riscv/riscv-vector-costs.cc | 2 ++
1 file changed, 2 insertions(+)
 
diff --git a/gcc/config/riscv/riscv-vector-costs.cc 
b/gcc/config/riscv/riscv-vector-costs.cc
index 7c9840df4e9..f13a1296b31 100644
--- a/gcc/config/riscv/riscv-vector-costs.cc
+++ b/gcc/config/riscv/riscv-vector-costs.cc
@@ -413,6 +413,8 @@ compute_local_live_ranges (
  auto *r = get_live_range (live_ranges, arg);
  gcc_assert (r);
  (*r).second = MAX (point, (*r).second);
+   biggest_mode = get_biggest_mode (
+ biggest_mode, TYPE_MODE (TREE_TYPE (arg)));
}
}
  else
-- 
2.44.0
 
 


Re: [PATCH] Include safe-ctype.h after C++ standard headers, to avoid over-poisoning

2024-03-06 Thread Iain Sandoe
Hi Dimitry, folks,

> On 6 Mar 2024, at 23:02, Dimitry Andric  wrote:
> 
> On 6 Mar 2024, at 15:57, FX Coudert  wrote:
>> 
>>> Hmm I recall trying it and finding a problem - was there some different fix 
>>> applied
>>> in the end?
>> 
>> The bug is still open, I don’t think a patch was applied, and I don’t find 
>> any email to the list stating what the problem could be.
> 
> The original patch (https://gcc.gnu.org/bugzilla/attachment.cgi?id=56010) 
> still applies to the master branch.

I have retested this on various Darwin versions and confirm that it fixes the 
bootstrap fail on x86_64-darwin23 and works OK on other versions (including 32b 
hosts). 

+1 for applying this soon.



the second patch really needs to be posted separately to make review easier (if 
we were not in stage 4, I’d say it’s ‘obvious’ anyway).

thanks
Iain


> It turned out there is also a related problem in libcc1plugin.cc and 
> libcp1plugin.cc , which is fixed by 
> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57639 :
> 
> commit 49222b98ac8e30a4a042ada0ece3d7df93f049d2
> Author: Dimitry Andric 
> Date:   2024-03-06T23:46:27+01:00
> 
>Fix libcc1plugin and libc1plugin to use INCLUDE_VECTOR before including
>system.h, instead of directly including , to avoid running into
>poisoned identifiers.
> 
> diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
> index 72d17c3b81c..e64847466f4 100644
> --- a/libcc1/libcc1plugin.cc
> +++ b/libcc1/libcc1plugin.cc
> @@ -32,6 +32,7 @@
> #undef PACKAGE_VERSION
> 
> #define INCLUDE_MEMORY
> +#define INCLUDE_VECTOR
> #include "gcc-plugin.h"
> #include "system.h"
> #include "coretypes.h"
> @@ -69,8 +70,6 @@
> #include "gcc-c-interface.h"
> #include "context.hh"
> 
> -#include 
> -
> using namespace cc1_plugin;
> 
> 
> diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
> index 0eff7c68d29..da68c5d0ac1 100644
> --- a/libcc1/libcp1plugin.cc
> +++ b/libcc1/libcp1plugin.cc
> @@ -33,6 +33,7 @@
> #undef PACKAGE_VERSION
> 
> #define INCLUDE_MEMORY
> +#define INCLUDE_VECTOR
> #include "gcc-plugin.h"
> #include "system.h"
> #include "coretypes.h"
> @@ -71,8 +72,6 @@
> #include "rpc.hh"
> #include "context.hh"
> 
> -#include 
> -
> using namespace cc1_plugin;
> 
> 
> 



Regressions on native/releases/gcc-13 at commit r13-8408 vs commit r13-8397 on Linux/x86_64

2024-03-06 Thread H. J. Lu via Gcc-regression
Regressions on native/releases/gcc-13 at commit r13-8408 vs commit r13-8397 on 
Linux/x86_64
New failures:
FAIL: 30_threads/future/members/poll.cc execution test
FAIL: gcc.dg/torture/convert-dfp-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  (test for excess errors)
FAIL: gcc.dg/torture/convert-dfp-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  (test for excess errors)
FAIL: gcc.dg/torture/convert-dfp.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  (test for excess errors)
FAIL: gcc.dg/torture/convert-dfp.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  (test for excess errors)
FAIL: gcc.dg/vect/vect-bic-bitmask-10.c -flto -ffat-lto-objects (test for 
excess errors)
FAIL: gcc.dg/vect/vect-bic-bitmask-11.c -flto -ffat-lto-objects (test for 
excess errors)
FAIL: gcc.dg/vect/vect-bic-bitmask-2.c -flto -ffat-lto-objects (test for excess 
errors)
FAIL: gcc.dg/vect/vect-bic-bitmask-3.c -flto -ffat-lto-objects (test for excess 
errors)
FAIL: gcc.dg/vect/vect-bic-bitmask-4.c -flto -ffat-lto-objects (test for excess 
errors)
FAIL: gcc.dg/vect/vect-bic-bitmask-5.c -flto -ffat-lto-objects (test for excess 
errors)
FAIL: gcc.dg/vect/vect-bic-bitmask-6.c -flto -ffat-lto-objects (test for excess 
errors)
FAIL: gcc.dg/vect/vect-bic-bitmask-8.c -flto -ffat-lto-objects (test for excess 
errors)

New passes:


Results for 13.2.1 20240307 [native/releases/gcc-13 r13-8408-g58cbab9c1d1] (GCC) testsuite on x86_64-pc-linux-gnu

2024-03-06 Thread H. J. Lu via Gcc-testresults
LAST_UPDATED: Thu Mar  7 05:40:04 UTC 2024 (revision r13-8408-g58cbab9c1d1)

Native configuration is x86_64-pc-linux-gnu

=== gcc tests ===


Running target unix
FAIL: gcc.dg/analyzer/data-model-4.c (test for excess errors)
FAIL: gcc.dg/analyzer/torture/conftest-1.c   -O0  (test for excess errors)
FAIL: gcc.dg/analyzer/torture/conftest-1.c   -O1  (test for excess errors)
FAIL: gcc.dg/analyzer/torture/conftest-1.c   -O2  (test for excess errors)
FAIL: gcc.dg/analyzer/torture/conftest-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  (test for excess errors)
FAIL: gcc.dg/analyzer/torture/conftest-1.c   -O3 -g  (test for excess errors)
FAIL: gcc.dg/analyzer/torture/conftest-1.c   -Os  (test for excess errors)
XPASS: gcc.dg/Wstringop-overflow-47.c pr97027 (test for warnings, line 72)
XPASS: gcc.dg/Wstringop-overflow-47.c pr97027 (test for warnings, line 77)
XPASS: gcc.dg/Wstringop-overflow-47.c pr97027 note (test for warnings, line 68)
FAIL: gcc.dg/ira-loop-pressure.c scan-rtl-dump loop2_invariant "Decided to move 
invariant"
XPASS: gcc.dg/guality/example.c   -O0  execution test
XPASS: gcc.dg/guality/example.c   -O1  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/example.c  -Og -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O0  execution test
XPASS: gcc.dg/guality/guality.c   -O1  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O2  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/guality.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/guality.c   -O3 -g  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -Os  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c  -Og -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/inline-params.c   -O2  -DPREVENT_OPTIMIZATION  execution 
test
XPASS: gcc.dg/guality/inline-params.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/inline-params.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/inline-params.c   -O3 -g  -DPREVENT_OPTIMIZATION  
execution test
XPASS: gcc.dg/guality/inline-params.c   -Os  -DPREVENT_OPTIMIZATION  execution 
test
XPASS: gcc.dg/guality/ipa-sra-1.c   -O0  line 15 k == 3
XPASS: gcc.dg/guality/ipa-sra-1.c   -O1  -DPREVENT_OPTIMIZATION  line 15 k == 3
XPASS: gcc.dg/guality/ipa-sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 15 k == 3
FAIL: gcc.dg/guality/loop-1.c   -O3 -fomit-frame-pointer -funroll-loops 
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 arg1 == 1
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 arg2 == 2
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 arg3 == 3
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 arg4 == 4
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 arg5 == 5
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 arg6 == 6
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 arg7 == 30
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 18 arg1 == 1
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 18 arg2 == 2
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 18 arg3 == 3
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 18 arg4 == 4
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 18 arg5 == 5
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 18 arg6 == 6
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 18 arg7 == 30
FAIL: gcc.dg/guality/pr36728-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg1 
== 1
FAIL: gcc.dg/guality/pr36728-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg2 
== 2
FAIL: gcc.dg/guality/pr36728-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg3 
== 3
FAIL: gcc.dg/guality/pr36728-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  

RE: [PATCH] c++/c-common: Fix convert_vector_to_array_for_subscript for qualified vector types [PR89224]

2024-03-06 Thread Andrew Pinski (QUIC)
> -Original Message-
> From: Andrew Pinski (QUIC) 
> Sent: Tuesday, February 20, 2024 7:06 PM
> To: gcc-patches@gcc.gnu.org
> Cc: Andrew Pinski (QUIC) 
> Subject: [PATCH] c++/c-common: Fix convert_vector_to_array_for_subscript
> for qualified vector types [PR89224]
> 
> After r7-987-gf17a223de829cb, the access for the elements of a vector type
> would lose the qualifiers.
> So if we had `constvector[0]`, the type of the element of the array would not
> have const on it.
> This was due to a missing build_qualified_type for the inner type of the 
> vector
> when building the array type.
> We need to add back the call to build_qualified_type and now the access has
> the correct qualifiers. So the overloads and even if it is a lvalue or rvalue 
> is
> correctly done.
> 
> Note we correctly now reject the testcase gcc.dg/pr83415.c which was
> incorrectly accepted after r7-987-gf17a223de829cb.


Ping?

> 
> Built and tested for aarch64-linux-gnu.
> 
>   PR c++/89224
> 
> gcc/c-family/ChangeLog:
> 
>   * c-common.cc (convert_vector_to_array_for_subscript): Call
> build_qualified_type
>   for the inner type.
> 
> gcc/cp/ChangeLog:
> 
>   * constexpr.cc (cxx_eval_array_reference): Compare main variants
>   for the vector/array types instead of the types directly.
> 
> gcc/testsuite/ChangeLog:
> 
>   * g++.dg/torture/vector-subaccess-1.C: New test.
>   * gcc.dg/pr83415.c: Change warning to error.
> 
> Signed-off-by: Andrew Pinski 
> ---
>  gcc/c-family/c-common.cc  |  7 +-
>  gcc/cp/constexpr.cc   |  3 ++-
>  .../g++.dg/torture/vector-subaccess-1.C   | 23 +++
>  gcc/testsuite/gcc.dg/pr83415.c|  2 +-
>  4 files changed, 32 insertions(+), 3 deletions(-)  create mode 100644
> gcc/testsuite/g++.dg/torture/vector-subaccess-1.C
> 
> diff --git a/gcc/c-family/c-common.cc b/gcc/c-family/c-common.cc index
> e15eff698df..884dd9043f9 100644
> --- a/gcc/c-family/c-common.cc
> +++ b/gcc/c-family/c-common.cc
> @@ -8936,6 +8936,7 @@ convert_vector_to_array_for_subscript (location_t
> loc,
>if (gnu_vector_type_p (TREE_TYPE (*vecp)))
>  {
>tree type = TREE_TYPE (*vecp);
> +  tree newitype;
> 
>ret = !lvalue_p (*vecp);
> 
> @@ -8950,8 +8951,12 @@ convert_vector_to_array_for_subscript
> (location_t loc,
>for function parameters.  */
>c_common_mark_addressable_vec (*vecp);
> 
> +  /* Make sure qualifiers are copied from the vector type to the new
> element
> +  of the array type.  */
> +  newitype = build_qualified_type (TREE_TYPE (type), TYPE_QUALS
> +(type));
> +
>*vecp = build1 (VIEW_CONVERT_EXPR,
> -   build_array_type_nelts (TREE_TYPE (type),
> +   build_array_type_nelts (newitype,
> TYPE_VECTOR_SUBPARTS (type)),
> *vecp);
>  }
> diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc index
> fa346fe01c9..1fe91d16e8e 100644
> --- a/gcc/cp/constexpr.cc
> +++ b/gcc/cp/constexpr.cc
> @@ -4421,7 +4421,8 @@ cxx_eval_array_reference (const constexpr_ctx
> *ctx, tree t,
>if (!lval
>&& TREE_CODE (ary) == VIEW_CONVERT_EXPR
>&& VECTOR_TYPE_P (TREE_TYPE (TREE_OPERAND (ary, 0)))
> -  && TREE_TYPE (t) == TREE_TYPE (TREE_TYPE (TREE_OPERAND (ary, 0
> +  && TYPE_MAIN_VARIANT (TREE_TYPE (t))
> +   == TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (TREE_OPERAND
> (ary,
> +0)
>  ary = TREE_OPERAND (ary, 0);
> 
>tree oldidx = TREE_OPERAND (t, 1);
> diff --git a/gcc/testsuite/g++.dg/torture/vector-subaccess-1.C
> b/gcc/testsuite/g++.dg/torture/vector-subaccess-1.C
> new file mode 100644
> index 000..0c8958a4e03
> --- /dev/null
> +++ b/gcc/testsuite/g++.dg/torture/vector-subaccess-1.C
> @@ -0,0 +1,23 @@
> +/* PR c++/89224 */
> +
> +/* The access of `vector[i]` has the same qualifiers as the original
> +   vector which was missing. */
> +
> +typedef __attribute__((vector_size(16))) unsigned char  Int8x8_t;
> +
> +template 
> +void g(T ) {
> +__builtin_abort();
> +}
> +template 
> +void g(const T ) {
> +  __builtin_exit(0);
> +}
> +void f(const Int8x8_t x) {
> +  g(x[0]);
> +}
> +int main(void)
> +{
> +Int8x8_t x ={};
> +f(x);
> +}
> diff --git a/gcc/testsuite/gcc.dg/pr83415.c b/gcc/testsuite/gcc.dg/pr83415.c
> index 5934c16d97c..2fc85031505 100644
> --- a/gcc/testsuite/gcc.dg/pr83415.c
> +++ b/gcc/testsuite/gcc.dg/pr83415.c
> @@ -7,6 +7,6 @@ int
>  main (int argc, short *argv[])
>  {
>int i = argc;
> -  y[i] = 7 - i; /* { dg-warning "read-only" } */
> +  y[i] = 7 - i; /* { dg-error "read-only" } */
>return 0;
>  }
> --
> 2.43.0



Results for 12.3.1 20240307 [remotes/origin/releases/gcc-12 r12-10196-gdb302d81d2] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-03-06 Thread Bill Seurer (POWER9) via Gcc-testresults


git commit g:db302d81d246c324171422c20ffe1175feaa5e16
gcc-descr r12-10196-gdb302d81d246c3

power9
Linux 5.15.0-97-generic ppc64le
GNU Make 4.3

DejaGnu:
DejaGnu version 1.6.2
Expect version  5.45.4
Tcl version 8.6

64-bit

LAST_UPDATED: Thu Mar  7 05:49:08 UTC 2024 (revision r12-10196-gdb302d81d2)

Native configuration is powerpc64le-unknown-linux-gnu

=== gcc tests ===


Running target unix
XPASS: gcc.dg/Wtrampolines.c standard descriptors (test for warnings, line 29)
XPASS: gcc.dg/uninit-pred-7_a.c bogus warning (test for bogus messages, line 26)
XPASS: gcc.dg/guality/example.c   -O0  execution test
XPASS: gcc.dg/guality/example.c   -O1  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/example.c  -Og -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O0  execution test
XPASS: gcc.dg/guality/guality.c   -O1  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -Os  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c  -Og -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
FAIL: gcc.dg/guality/inline-params-2.c   -O2  -DPREVENT_OPTIMIZATION  execution 
test
FAIL: gcc.dg/guality/inline-params-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  
execution test
FAIL: gcc.dg/guality/inline-params-2.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/inline-params.c   -Os  -DPREVENT_OPTIMIZATION  execution 
test
XPASS: gcc.dg/guality/inline-params.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/ipa-sra-1.c   -O0  line 15 k == 3
XPASS: gcc.dg/guality/ipa-sra-1.c   -O1  -DPREVENT_OPTIMIZATION  line 15 k == 3
XPASS: gcc.dg/guality/ipa-sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 15 k == 3
FAIL: gcc.dg/guality/loop-1.c   -O2  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O3 -fomit-frame-pointer -funroll-loops 
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 20 i == 1
FAIL: gcc.dg/guality/pr36728-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 18 y == 
2
FAIL: gcc.dg/guality/pr36728-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 18 y == 2
FAIL: gcc.dg/guality/pr36728-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg1 
== 1
FAIL: gcc.dg/guality/pr36728-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg2 
== 2
FAIL: gcc.dg/guality/pr36728-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg3 
== 3
FAIL: gcc.dg/guality/pr36728-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg4 
== 4
FAIL: gcc.dg/guality/pr36728-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg5 
== 5
FAIL: gcc.dg/guality/pr36728-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg6 
== 6
FAIL: gcc.dg/guality/pr36728-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg7 
== 30
FAIL: gcc.dg/guality/pr36728-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 18 arg1 
== 1
FAIL: gcc.dg/guality/pr36728-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 18 arg2 
== 2
FAIL: gcc.dg/guality/pr36728-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 18 arg3 
== 3
FAIL: gcc.dg/guality/pr36728-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 18 arg4 
== 4
FAIL: gcc.dg/guality/pr36728-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 18 arg5 
== 5
FAIL: gcc.dg/guality/pr36728-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 18 arg6 
== 6
FAIL: gcc.dg/guality/pr36728-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 18 arg7 
== 30
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 arg1 == 1
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 arg2 == 2
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 arg3 == 3
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 arg4 == 4
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 arg5 == 5
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 arg6 == 6
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 arg7 == 30
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 18 arg1 == 1
FAIL: gcc.dg/guality/pr36728-2.c 

Results for 15.0.0 (clang-1500.3.9.4) testsuite on x86_64-apple-darwin23

2024-03-06 Thread FX Coudert via Gcc-testresults
e/tail-padding1.C   -Os  (internal compiler error: in 
cxx_eval_call_expression, at cp/constexpr.cc:3027)
FAIL: g++.dg/torture/tail-padding1.C   -Os  (test for excess errors)
UNRESOLVED: g++.dg/torture/tail-padding1.C   -Os  compilation failed to produce 
executable
FAIL: g++.target/i386/pr105980.C  -std=gnu++98 (internal compiler error: in 
insn_default_length, at config/i386/i386.md:23882)
FAIL: g++.target/i386/pr105980.C  -std=gnu++98 (test for excess errors)
FAIL: g++.target/i386/pr105980.C  -std=gnu++14 (internal compiler error: in 
insn_default_length, at config/i386/i386.md:23882)
FAIL: g++.target/i386/pr105980.C  -std=gnu++14 (test for excess errors)
FAIL: g++.target/i386/pr105980.C  -std=gnu++17 (internal compiler error: in 
insn_default_length, at config/i386/i386.md:23882)
FAIL: g++.target/i386/pr105980.C  -std=gnu++17 (test for excess errors)
FAIL: g++.target/i386/pr105980.C  -std=gnu++20 (internal compiler error: in 
insn_default_length, at config/i386/i386.md:23882)
FAIL: g++.target/i386/pr105980.C  -std=gnu++20 (test for excess errors)

=== g++ Summary ===

# of expected passes253197
# of unexpected failures73
# of expected failures  2778
# of unresolved testcases   1
# of unsupported tests  11391
/Users/fx/ibin-20240306/gcc/xg++  version 14.0.1 20240306 (experimental) 
[master b7d14310406] (GCC) 

=== gcc tests ===


Running target unix
FAIL: gcc.dg/cpp/ucnid-1-utf8.c (test for excess errors)
FAIL: gcc.dg/cpp/ucnid-1.c (test for excess errors)
FAIL: gcc.dg/debug/20020220-1.c -gdwarf-2 -g3 (test for excess errors)
FAIL: gcc.dg/debug/20020220-1.c -gdwarf-2 -g3 -O (test for excess errors)
FAIL: gcc.dg/debug/20020220-1.c -gdwarf-2 -g3 -O3 (test for excess errors)
FAIL: gcc.dg/debug/20020327-1.c -gdwarf-2 -g3 (test for excess errors)
FAIL: gcc.dg/debug/20020327-1.c -gdwarf-2 -g3 -O (test for excess errors)
FAIL: gcc.dg/debug/20020327-1.c -gdwarf-2 -g3 -O3 (test for excess errors)
FAIL: gcc.dg/debug/20050907-1.c -gdwarf-2 -g3 (test for excess errors)
FAIL: gcc.dg/debug/20050907-1.c -gdwarf-2 -g3 -O (test for excess errors)
FAIL: gcc.dg/debug/20050907-1.c -gdwarf-2 -g3 -O3 (test for excess errors)
FAIL: gcc.dg/debug/pr29609-1.c -gdwarf-2 -g3 (test for excess errors)
FAIL: gcc.dg/debug/pr29609-1.c -gdwarf-2 -g3 -O (test for excess errors)
FAIL: gcc.dg/debug/pr29609-1.c -gdwarf-2 -g3 -O3 (test for excess errors)
FAIL: gcc.dg/debug/pr29609-2.c -gdwarf-2 -g3 (test for excess errors)
FAIL: gcc.dg/debug/pr29609-2.c -gdwarf-2 -g3 -O (test for excess errors)
FAIL: gcc.dg/debug/pr29609-2.c -gdwarf-2 -g3 -O3 (test for excess errors)
FAIL: gcc.dg/debug/pr36690-1.c -gdwarf-2 -g3 (test for excess errors)
FAIL: gcc.dg/debug/pr36690-1.c -gdwarf-2 -g3 -O (test for excess errors)
FAIL: gcc.dg/debug/pr36690-1.c -gdwarf-2 -g3 -O3 (test for excess errors)
FAIL: gcc.dg/debug/pr36690-2.c -gdwarf-2 -g3 (test for excess errors)
FAIL: gcc.dg/debug/pr36690-2.c -gdwarf-2 -g3 -O (test for excess errors)
FAIL: gcc.dg/debug/pr36690-2.c -gdwarf-2 -g3 -O3 (test for excess errors)
FAIL: gcc.dg/debug/pr36690-3.c -gdwarf-2 -g3 (test for excess errors)
FAIL: gcc.dg/debug/pr36690-3.c -gdwarf-2 -g3 -O (test for excess errors)
FAIL: gcc.dg/debug/pr36690-3.c -gdwarf-2 -g3 -O3 (test for excess errors)
FAIL: gcc.dg/debug/pr37616.c -gdwarf-2 -g3 (test for excess errors)
FAIL: gcc.dg/debug/pr37616.c -gdwarf-2 -g3 -O (test for excess errors)
FAIL: gcc.dg/debug/pr37616.c -gdwarf-2 -g3 -O3 (test for excess errors)
FAIL: gcc.dg/debug/pr49032.c -gdwarf-2 -g3 (test for excess errors)
FAIL: gcc.dg/debug/pr49032.c -gdwarf-2 -g3 -O (test for excess errors)
FAIL: gcc.dg/debug/pr49032.c -gdwarf-2 -g3 -O3 (test for excess errors)
FAIL: gcc.dg/debug/pr65771.c -gdwarf-2 -g3 (test for excess errors)
FAIL: gcc.dg/debug/pr65771.c -gdwarf-2 -g3 -O (test for excess errors)
FAIL: gcc.dg/debug/pr65771.c -gdwarf-2 -g3 -O3 (test for excess errors)
FAIL: gcc.dg/debug/tls-1.c -gdwarf-2 -g3 (test for excess errors)
FAIL: gcc.dg/debug/tls-1.c -gdwarf-2 -g3 -O (test for excess errors)
FAIL: gcc.dg/debug/tls-1.c -gdwarf-2 -g3 -O3 (test for excess errors)
FAIL: gcc.dg/debug/trivial.c -gdwarf-2 -g3 (test for excess errors)
FAIL: gcc.dg/debug/trivial.c -gdwarf-2 -g3 -O (test for excess errors)
FAIL: gcc.dg/debug/trivial.c -gdwarf-2 -g3 -O3 (test for excess errors)
FAIL: gcc.dg/framework-1.c (test for excess errors)
FAIL: gcc.dg/pr97172-2.c (test for excess errors)
FAIL: gcc.dg/pubtypes-2.c scan-assembler long+[ t]+0x14d+[ t]+[#;]+[ 
t]+Pub Info Length
FAIL: gcc.dg/pubtypes-3.c scan-assembler long+[ t]+0x14d+[ t]+[#;]+[ 
t]+Pub Info Length
FAIL: gcc.dg/pubtypes-4.c scan-assembler long+[ t]+0x184+[ t]+[#;]+[ 
t]+Pub Info Length
FAIL: gcc.dg/scantest-lto.c scan-assembler-not ascii
FAIL: gcc.dg/scantest-lto.c scan-assembler-times ascii 0
FAIL: gcc.dg/strlenopt-73.c scan-tree-dump-times optimized "strlen" 0
FAIL: gcc.dg/strlenopt-73.c scan-tree-dump-times op

[Bug middle-end/111523] Unexpected performance regression with -ftrivial-auto-var-init=zero for e.g. systemctl unmask

2024-03-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111523

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |MOVED

--- Comment #9 from Andrew Pinski  ---
Turns out systemd had a 1MB buffer in their serializer formating code
(serialize_item_format) that would be executed a lot and
-ftrivial-auto-var-init=zero would cause this buffer to be zero'd each time the
function was called (a decent thing for this flag to do).

It just happens serialize_item_format is called a lot when it came
serialization. With arm memory systems being slower than most, it just exposed
this issue.

Anways systemd has now changed the buffer to 256 which is much much smaller and
for most calls enough in size before needing to reallocate the buffer that it
has now become fast.

Anyways -ftrivial-auto-var-init=zero just exposed a performance (stack size)
issue with already existing issue inside the systemd code. A good thing really. 

So closing as moved.

Results for 14.0.1 20240307 (experimental) [remotes/origin/HEAD r14-9348-g03932d3203] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-03-06 Thread Bill Seurer (POWER9 IEEE128) via Gcc-testresults


git commit g:03932d3203bce244edd812b81921c2f16ea18d86
gcc-descr r14-9348-g03932d3203bce2

power9 IEEE128
Linux 6.8.0-0.rc6.20240229git805d849d7c3c.51.fc41.ppc64le ppc64le
GNU Make 4.4.1

DejaGnu:
DejaGnu version 1.6.3
Expect version  5.45.4
Tcl version 8.6

64-bit

LAST_UPDATED: Thu Mar  7 05:03:13 UTC 2024 (revision r14-9348-g03932d3203)

Native configuration is powerpc64le-unknown-linux-gnu

=== gcc tests ===


Running target unix
XPASS: gcc.dg/Wtrampolines.c standard descriptors (test for warnings, line 32)
XPASS: gcc.dg/guality/example.c   -O0  execution test
XPASS: gcc.dg/guality/example.c  -Og -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O0  execution test
XPASS: gcc.dg/guality/guality.c   -O1  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O2  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/guality.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/guality.c   -O3 -g  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -Os  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c  -Og -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/inline-params.c   -O2  -DPREVENT_OPTIMIZATION  execution 
test
XPASS: gcc.dg/guality/inline-params.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/inline-params.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/inline-params.c   -O3 -g  -DPREVENT_OPTIMIZATION  
execution test
XPASS: gcc.dg/guality/inline-params.c   -Os  -DPREVENT_OPTIMIZATION  execution 
test
FAIL: gcc.dg/guality/loop-1.c   -O2  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O3 -fomit-frame-pointer -funroll-loops 
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 18 y == 2
FAIL: gcc.dg/guality/pr36728-3.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 y == 2
FAIL: gcc.dg/guality/pr36728-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 y == 
2
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i == 37
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i1 == 2 * 
37
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i2 == 3 * 
37
XPASS: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 j == 28 
+ 37
FAIL: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 34 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 39 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2  -DPREVENT_OPTIMIZATION  line 34 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2  -DPREVENT_OPTIMIZATION  line 39 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 34 c == [0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 39 c == [0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 34 c == [0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 39 c == [0]
FAIL: gcc.dg/guality/pr54200.c   -O1  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O2  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -Os  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 y == 25
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 z == 6
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 23 y == 117
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 23 z == 8
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto 

[Bug middle-end/114195] [14] RISC-V vector ICE: in vectorizable_store, at tree-vect-stmts.cc:8690

2024-03-06 Thread pan2.li at intel dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114195

--- Comment #2 from Li Pan  ---
Trigger below assert in vectorizable_store, the loop_vinfo use_partial,
fully_masked and fully_lens are all true here.

/* Shouldn't go with length-based approach if fully masked.  */
gcc_assert (!loop_lens || !loop_masks);

Introduce by this commit
https://github.com/gcc-mirror/gcc/commit/9fb832ce382d649b7687426e6bc4e5d3715cb78a#diff-97f675a4f401d6ec84d031e0d7259a0b6ba3b50eccc3fe483e9376becc9d9cf9

Results for 14.0.1 20240306 (experimental) [master-ia32 r14-9346-g74e8cc28eda] (GCC) testsuite on i686-pc-linux-gnu

2024-03-06 Thread H.J. Lu via Gcc-testresults
 ===

# of expected passes196942
# of unexpected failures118
# of unexpected successes   27
# of expected failures  1556
# of unsupported tests  4056
/export/gnu/import/git/gcc-test-master-ia32/bld/gcc/xgcc  version 14.0.1 
20240306 (experimental) [master-ia32 r14-9346-g74e8cc28eda] (GCC) 

=== gfortran tests ===


Running target unix

=== gfortran Summary ===

# of expected passes69345
# of expected failures  275
# of unsupported tests  224
/export/gnu/import/git/gcc-test-master-ia32/bld/gcc/gfortran  version 14.0.1 
20240306 (experimental) [master-ia32 r14-9346-g74e8cc28eda] (GCC) 

=== g++ tests ===


Running target unix
FAIL: g++.dg/guality/pr55665.C   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  line 23 p == 40

=== g++ Summary ===

# of expected passes259860
# of unexpected failures1
# of expected failures  2753
# of unsupported tests  10956
/export/gnu/import/git/gcc-test-master-ia32/bld/gcc/xg++  version 14.0.1 
20240306 (experimental) [master-ia32 r14-9346-g74e8cc28eda] (GCC) 

=== objc tests ===


Running target unix

=== objc Summary ===

# of expected passes2840
# of expected failures  6
# of unsupported tests  70
/export/gnu/import/git/gcc-test-master-ia32/bld/gcc/xgcc  version 14.0.1 
20240306 (experimental) [master-ia32 r14-9346-g74e8cc28eda] (GCC) 

=== libatomic tests ===


Running target unix

=== libatomic Summary ===

# of expected passes44
# of unsupported tests  5
=== libgomp tests ===


Running target unix

=== libgomp Summary ===

# of expected passes16331
# of expected failures  285
# of unsupported tests  621
=== libitm tests ===


Running target unix

=== libitm Summary ===

# of expected passes44
# of expected failures  3
# of unsupported tests  1
=== libstdc++ tests ===


Running target unix

=== libstdc++ Summary ===

# of expected passes19238
# of expected failures  126
# of unsupported tests  374

Compiler version: 14.0.1 20240306 (experimental) [master-ia32 
r14-9346-g74e8cc28eda] (GCC) 
Platform: i686-pc-linux-gnu
configure flags: --enable-clocale=gnu --with-system-zlib --enable-shared 
--enable-cet --with-demangler-in-ld --enable-libmpx --prefix=/usr/gcc-14.0.1 
i686-linux --with-fpmath=sse


[PATCH] RISC-V: Fix ICE in riscv vector costs

2024-03-06 Thread demin.han
The following code can result in ICE:
-march=rv64gcv_zba_zbb --param riscv-autovec-lmul=dynamic -O3

char *jpeg_difference7_input_buf;
void jpeg_difference7(int *diff_buf) {
  unsigned width;
  int samp, Rb;
  while (--width) {
Rb = samp = *jpeg_difference7_input_buf;
*diff_buf++ = -(int)(samp + (long)Rb >> 1);
  }
}

One biggest_mode update missed in one branch and trigger assertion fail.
gcc_assert (biggest_size >= mode_size);

Tested On RV64 and no regression.

gcc/ChangeLog:

* config/riscv/riscv-vector-costs.cc: Fix ICE

Signed-off-by: demin.han 
---
 gcc/config/riscv/riscv-vector-costs.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/config/riscv/riscv-vector-costs.cc 
b/gcc/config/riscv/riscv-vector-costs.cc
index 7c9840df4e9..f13a1296b31 100644
--- a/gcc/config/riscv/riscv-vector-costs.cc
+++ b/gcc/config/riscv/riscv-vector-costs.cc
@@ -413,6 +413,8 @@ compute_local_live_ranges (
  auto *r = get_live_range (live_ranges, arg);
  gcc_assert (r);
  (*r).second = MAX (point, (*r).second);
+ biggest_mode = get_biggest_mode (
+   biggest_mode, TYPE_MODE (TREE_TYPE (arg)));
}
}
  else
-- 
2.44.0



Results for 14.0.1 20240306 (experimental) [master r14-9337-g71aad523144] (GCC) testsuite on x86_64-pc-linux-gnu

2024-03-06 Thread H.J. Lu via Gcc-testresults
FAIL: gcc.dg/guality/pr90074.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 28 c + 1 == 2
FAIL: gcc.dg/guality/pr90074.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 28 i + 1 == 8
FAIL: gcc.dg/guality/pr90716.c   -O1  -DPREVENT_OPTIMIZATION  line 23 j + 1 == 9
FAIL: gcc.dg/guality/pr90716.c   -O2  -DPREVENT_OPTIMIZATION  line 23 j + 1 == 9
FAIL: gcc.dg/guality/pr90716.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 23 j + 1 == 9
FAIL: gcc.dg/guality/pr90716.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 23 j + 1 == 9
FAIL: gcc.dg/guality/pr90716.c   -Os  -DPREVENT_OPTIMIZATION  line 23 j + 1 == 9
FAIL: gcc.dg/guality/sra-1.c   -O2  -DPREVENT_OPTIMIZATION  line 43 a.j == 14
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 43 a.j == 14
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 a.i == 4
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 a.j == 14
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 32 a[0] == 4
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 32 a[1] == 14
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 43 a.i == 4
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 43 a.j == 14
FAIL: gcc.dg/guality/sra-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 43 a.j == 14
FAIL: gcc.dg/guality/sra-1.c   -Os  -DPREVENT_OPTIMIZATION  line 43 a.j == 14
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 21 a.i == 4
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 21 a.j == 14
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 32 a[0] == 4
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 32 a[1] == 14
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 43 a.i == 4
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 43 a.j == 14
FAIL: gcc.dg/guality/vla-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 17 sizeof (a) == 6
XPASS: gcc.dg/tree-ssa/builtin-snprintf-6.c scan-tree-dump-times optimized 
"Function test_assign_aggregate" 1
FAIL: gcc.dg/tree-ssa/dump-6.c scan-tree-dump store-merging "MEM  
[(char *)] = "
FAIL: gcc.target/i386/bmi2-pr112526.c (test for excess errors)
FAIL: gcc.target/i386/invariant-ternlog-1.c scan-assembler-times 
vpternlog[^nr]*(%rdx) 2
FAIL: gcc.target/i386/pr105854.c (test for excess errors)
FAIL: gcc.target/i386/pr112943.c (test for excess errors)
FAIL: gcc.target/i386/pr53533-1.c scan-assembler-times (?:addl|subl)[ \\t] 1
FAIL: gcc.target/i386/pr53533-3.c scan-assembler-times (?:addl|subl)[ \\t] 1
FAIL: gcc.target/i386/pr55583.c scan-assembler-times (?n)shld[ql]?[t 
]*\$2 2
FAIL: gcc.target/i386/pr55583.c scan-assembler-times (?n)shrd[ql]?[t 
]*\$2 4
FAIL: gcc.target/i386/pr89618-2.c scan-tree-dump vect "loop vectorized using 16 
byte vectors"
FAIL: gcc.target/i386/pr96539.c scan-assembler-not rep[^\\n\\r]*movs
FAIL: gcc.target/i386/pr97971.c  (test for errors, line 10)
FAIL: gcc.target/i386/shrink_wrap_1.c scan-rtl-dump pro_and_epilogue 
"Performing shrink-wrapping"

=== gcc Summary for unix/-mx32 ===

# of expected passes200195
# of unexpected failures151
# of unexpected successes   16
# of expected failures  1550
# of unsupported tests  3401

=== gcc Summary ===

# of expected passes600642
# of unexpected failures400
# of unexpected successes   59
# of expected failures  4657
# of unsupported tests  10710
/export/gnu/import/git/gcc-test-master-intel64/bld/gcc/xgcc  version 14.0.1 
20240306 (experimental) [master r14-9337-g71aad523144] (GCC) 

=== gfortran tests ===


Running target unix

=== gfortran Summary for unix ===

# of expected passes69664
# of expected failures  273
# of unsupported tests  65

Running target unix/-m32

=== gfortran Summary for unix/-m32 ===

# of expected passes69330
# of expected failures  275
# of unsupported tests  223

Running target unix/-mx32

=== gfortran Summary for unix/-mx32 ===

# of expected passes69677
# of expected failures  275
# of unsupported tests  54

=== gfortran Summary ===

# of expected passes208671
# of expected failures  823
# of unsupported tests

Results for 14.0.1 20240307 (experimental) [remotes/origin/HEAD r14-9348-g03932d3203b] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-03-06 Thread Bill Seurer (POWER9) via Gcc-testresults


git commit g:03932d3203bce244edd812b81921c2f16ea18d86
gcc-descr r14-9348-g03932d3203bce2

power9
Linux 5.15.0-97-generic ppc64le
GNU Make 4.3

DejaGnu:
DejaGnu version 1.6.2
Expect version  5.45.4
Tcl version 8.6

64-bit

LAST_UPDATED: Thu Mar  7 04:20:13 UTC 2024 (revision r14-9348-g03932d3203b)

Native configuration is powerpc64le-unknown-linux-gnu

=== gcc tests ===


Running target unix
XPASS: gcc.dg/Wtrampolines.c standard descriptors (test for warnings, line 32)
XPASS: gcc.dg/guality/example.c   -O0  execution test
XPASS: gcc.dg/guality/example.c  -Og -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O0  execution test
XPASS: gcc.dg/guality/guality.c   -O1  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O2  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O3 -g  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -Os  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c  -Og -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/guality.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/inline-params.c   -O2  -DPREVENT_OPTIMIZATION  execution 
test
XPASS: gcc.dg/guality/inline-params.c   -O3 -g  -DPREVENT_OPTIMIZATION  
execution test
XPASS: gcc.dg/guality/inline-params.c   -Os  -DPREVENT_OPTIMIZATION  execution 
test
XPASS: gcc.dg/guality/inline-params.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/inline-params.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
FAIL: gcc.dg/guality/loop-1.c   -O2  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O3 -fomit-frame-pointer -funroll-loops 
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 20 i == 1
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 18 y == 2
FAIL: gcc.dg/guality/pr36728-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 y == 
2
FAIL: gcc.dg/guality/pr36728-3.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 y == 2
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i == 37
XPASS: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 j == 28 
+ 37
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i1 == 2 * 
37
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i2 == 3 * 
37
FAIL: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 34 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 39 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2  -DPREVENT_OPTIMIZATION  line 34 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2  -DPREVENT_OPTIMIZATION  line 39 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 34 c == [0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 39 c == [0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 34 c == [0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 39 c == [0]
FAIL: gcc.dg/guality/pr54200.c   -O1  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O2  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -Os  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 z == 3
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 y == 25
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 z == 6
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 23 y == 117
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 23 z == 8
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  

[Bug target/114200] [14] RISC-V fixed-length vector miscompile at -O3

2024-03-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114200

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |14.0

Results for 14.0.1 20240307 (experimental) [remotes/origin/HEAD r14-9347-g8b483cd552] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-03-06 Thread Bill Seurer (POWER8) via Gcc-testresults


git commit g:8b483cd5521de79c13cf4807fd004d442b9ad9cd
gcc-descr r14-9347-g8b483cd5521de7

power8
Linux 5.4.0-172-generic ppc64le
GNU Make 4.2.1

DejaGnu:
DejaGnu version 1.6.2
Expect version  5.45.4
Tcl version 8.6

64-bit

LAST_UPDATED: Thu Mar  7 03:34:33 UTC 2024 (revision r14-9347-g8b483cd552)

Native configuration is powerpc64le-unknown-linux-gnu

=== gcc tests ===


Running target unix
XPASS: gcc.dg/Wtrampolines.c standard descriptors (test for warnings, line 32)
XPASS: gcc.dg/guality/example.c   -O0  execution test
XPASS: gcc.dg/guality/example.c  -Og -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O0  execution test
XPASS: gcc.dg/guality/guality.c   -O1  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O2  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/guality.c   -O3 -g  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c  -Og -DPREVENT_OPTIMIZATION  execution test
FAIL: gcc.dg/guality/inline-params-2.c   -O2  -DPREVENT_OPTIMIZATION  execution 
test
FAIL: gcc.dg/guality/inline-params-2.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
FAIL: gcc.dg/guality/inline-params-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
FAIL: gcc.dg/guality/inline-params-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  
execution test
FAIL: gcc.dg/guality/inline-params-2.c   -Os  -DPREVENT_OPTIMIZATION  execution 
test
FAIL: gcc.dg/guality/loop-1.c   -O2  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O3 -fomit-frame-pointer -funroll-loops 
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/pr36728-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 18 *x == (char) 25
FAIL: gcc.dg/guality/pr36728-3.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 y == 2
FAIL: gcc.dg/guality/pr36728-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 y == 
2
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i == 37
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i1 == 2 * 
37
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i2 == 3 * 
37
XPASS: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 j == 28 
+ 37
FAIL: gcc.dg/guality/pr41447-1.c   -O2  -DPREVENT_OPTIMIZATION  execution test
FAIL: gcc.dg/guality/pr41447-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
FAIL: gcc.dg/guality/pr41447-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
FAIL: gcc.dg/guality/pr41447-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  execution 
test
FAIL: gcc.dg/guality/pr41447-1.c   -Os  -DPREVENT_OPTIMIZATION  execution test
FAIL: gcc.dg/guality/pr41616-1.c   -O2  -DPREVENT_OPTIMIZATION  execution test
FAIL: gcc.dg/guality/pr41616-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
FAIL: gcc.dg/guality/pr41616-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
FAIL: gcc.dg/guality/pr41616-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  execution 
test
FAIL: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 34 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 39 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2  -DPREVENT_OPTIMIZATION  line 34 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2  -DPREVENT_OPTIMIZATION  line 39 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 34 c == [0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 39 c == [0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 34 c == [0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 39 c == [0]
FAIL: gcc.dg/guality/pr54200.c   -O1  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O2  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O3 -g  

[gcc r14-9349] RISC-V: Refactor expand_vec_cmp [NFC]

2024-03-06 Thread Demin Han via Gcc-cvs
https://gcc.gnu.org/g:1cd8254ebad7b73993d2acee80a7caf37c21878a

commit r14-9349-g1cd8254ebad7b73993d2acee80a7caf37c21878a
Author: demin.han 
Date:   Mon Feb 26 14:50:15 2024 +0800

RISC-V: Refactor expand_vec_cmp [NFC]

There are two expand_vec_cmp functions.
They have same structure and similar code.
We can use default arguments instead of overloading.

Tested on RV32 and RV64.

gcc/ChangeLog:

* config/riscv/riscv-protos.h (expand_vec_cmp): Change proto
* config/riscv/riscv-v.cc (expand_vec_cmp): Use default arguments
(expand_vec_cmp_float): Adapt arguments

Signed-off-by: demin.han 

Diff:
---
 gcc/config/riscv/riscv-protos.h |  2 +-
 gcc/config/riscv/riscv-v.cc | 44 +
 2 files changed, 15 insertions(+), 31 deletions(-)

diff --git a/gcc/config/riscv/riscv-protos.h b/gcc/config/riscv/riscv-protos.h
index 80efdf2b7e5..b8735593805 100644
--- a/gcc/config/riscv/riscv-protos.h
+++ b/gcc/config/riscv/riscv-protos.h
@@ -603,7 +603,7 @@ bool simm5_p (rtx);
 bool neg_simm5_p (rtx);
 #ifdef RTX_CODE
 bool has_vi_variant_p (rtx_code, rtx);
-void expand_vec_cmp (rtx, rtx_code, rtx, rtx);
+void expand_vec_cmp (rtx, rtx_code, rtx, rtx, rtx = nullptr, rtx = nullptr);
 bool expand_vec_cmp_float (rtx, rtx_code, rtx, rtx, bool);
 void expand_cond_len_unop (unsigned, rtx *);
 void expand_cond_len_binop (unsigned, rtx *);
diff --git a/gcc/config/riscv/riscv-v.cc b/gcc/config/riscv/riscv-v.cc
index 2d32db06dd1..967f4e38287 100644
--- a/gcc/config/riscv/riscv-v.cc
+++ b/gcc/config/riscv/riscv-v.cc
@@ -2775,7 +2775,8 @@ vectorize_related_mode (machine_mode vector_mode, 
scalar_mode element_mode,
 /* Expand an RVV comparison.  */
 
 void
-expand_vec_cmp (rtx target, rtx_code code, rtx op0, rtx op1)
+expand_vec_cmp (rtx target, rtx_code code, rtx op0, rtx op1, rtx mask,
+   rtx maskoff)
 {
   machine_mode mask_mode = GET_MODE (target);
   machine_mode data_mode = GET_MODE (op0);
@@ -2785,8 +2786,8 @@ expand_vec_cmp (rtx target, rtx_code code, rtx op0, rtx 
op1)
 {
   rtx lt = gen_reg_rtx (mask_mode);
   rtx gt = gen_reg_rtx (mask_mode);
-  expand_vec_cmp (lt, LT, op0, op1);
-  expand_vec_cmp (gt, GT, op0, op1);
+  expand_vec_cmp (lt, LT, op0, op1, mask, maskoff);
+  expand_vec_cmp (gt, GT, op0, op1, mask, maskoff);
   icode = code_for_pred (IOR, mask_mode);
   rtx ops[] = {target, lt, gt};
   emit_vlmax_insn (icode, BINARY_MASK_OP, ops);
@@ -2794,33 +2795,16 @@ expand_vec_cmp (rtx target, rtx_code code, rtx op0, rtx 
op1)
 }
 
   rtx cmp = gen_rtx_fmt_ee (code, mask_mode, op0, op1);
-  rtx ops[] = {target, cmp, op0, op1};
-  emit_vlmax_insn (icode, COMPARE_OP, ops);
-}
-
-void
-expand_vec_cmp (rtx target, rtx_code code, rtx mask, rtx maskoff, rtx op0,
-   rtx op1)
-{
-  machine_mode mask_mode = GET_MODE (target);
-  machine_mode data_mode = GET_MODE (op0);
-  insn_code icode = get_cmp_insn_code (code, data_mode);
-
-  if (code == LTGT)
+  if (!mask && !maskoff)
 {
-  rtx lt = gen_reg_rtx (mask_mode);
-  rtx gt = gen_reg_rtx (mask_mode);
-  expand_vec_cmp (lt, LT, mask, maskoff, op0, op1);
-  expand_vec_cmp (gt, GT, mask, maskoff, op0, op1);
-  icode = code_for_pred (IOR, mask_mode);
-  rtx ops[] = {target, lt, gt};
-  emit_vlmax_insn (icode, BINARY_MASK_OP, ops);
-  return;
+  rtx ops[] = {target, cmp, op0, op1};
+  emit_vlmax_insn (icode, COMPARE_OP, ops);
+}
+  else
+{
+  rtx ops[] = {target, mask, maskoff, cmp, op0, op1};
+  emit_vlmax_insn (icode, COMPARE_OP_MU, ops);
 }
-
-  rtx cmp = gen_rtx_fmt_ee (code, mask_mode, op0, op1);
-  rtx ops[] = {target, mask, maskoff, cmp, op0, op1};
-  emit_vlmax_insn (icode, COMPARE_OP_MU, ops);
 }
 
 /* Expand an RVV floating-point comparison:
@@ -2898,7 +2882,7 @@ expand_vec_cmp_float (rtx target, rtx_code code, rtx op0, 
rtx op1,
   else
{
  /* vmfeq.vvv0, vb, vb, v0.t  */
- expand_vec_cmp (eq0, EQ, eq0, eq0, op1, op1);
+ expand_vec_cmp (eq0, EQ, op1, op1, eq0, eq0);
}
   break;
 default:
@@ -2916,7 +2900,7 @@ expand_vec_cmp_float (rtx target, rtx_code code, rtx op0, 
rtx op1,
   if (code == ORDERED)
 emit_move_insn (target, eq0);
   else
-expand_vec_cmp (eq0, code, eq0, eq0, op0, op1);
+expand_vec_cmp (eq0, code, op0, op1, eq0, eq0);
 
   if (can_invert_p)
 {


[Bug ipa/114263] LTO generating incorrect code with -O2 -std=c++20 -fno-strict-aliasing flags in GCC13

2024-03-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114263

--- Comment #2 from Andrew Pinski  ---
the testcase in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113359#c15 makes
it even more likely the same as this one.

[Bug ipa/114263] LTO generating incorrect code with -O2 -std=c++20 -fno-strict-aliasing flags in GCC13

2024-03-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114263

--- Comment #1 from Andrew Pinski  ---
This sounds almost the same as what is mentioned in PR 113359 ("is changed by
SRA to only store 64 + 32 bits into the std::pair rather than 64 + 64 bits.").

[Bug lto/114263] New: LTO generating incorrect code with -O2 -std=c++20 -fno-strict-aliasing flags in GCC13

2024-03-06 Thread obaines at nvidia dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114263

Bug ID: 114263
   Summary: LTO generating incorrect code with -O2 -std=c++20
-fno-strict-aliasing flags in GCC13
   Product: gcc
   Version: 13.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
  Assignee: unassigned at gcc dot gnu.org
  Reporter: obaines at nvidia dot com
  Target Milestone: ---

I have a minimized test case where LTO seems to be generating incorrect code.

### Sources ###
A.cpp
```
#include 
#include 

struct A {
A(uint64_t _x, uint8_t _y) : x(_x), y(_y) {}
uint64_t x;
uint8_t y;
};

void doA() {
std::vector v;
v.emplace_back(0xULL, 0x2);
v.emplace_back(0xULL, 0x4);
}
```

B.cpp
```
#include 
#include 
#include 

struct B {
B(uint64_t _x, uint64_t _y) : x(_x), y(_y) {}
uint64_t x;
uint64_t y;
};

void doB() {
std::vector v;
v.emplace_back(0xULL, 0xULL);
v.emplace_back(0xULL, 0xULL);
std::cout << std::hex << "expected: " << 0xULL << " actual:
" << v[0].y << std::endl;
}
```

AB.cpp
```
void doA();
void doB();

int main() {
doA();
doB();
}
```

### Build Command ###
g++ -flto -g -O2 -std=c++20 -fno-strict-aliasing -Wall -Wextra -c *.cpp
g++ -flto -g -O2 -std=c++20 -fno-strict-aliasing -Wall -Wextra *.o

### Notes ###
The code doesn't generate any warnings during compilation.
The output of the program is usually `expected:  actual:
`, but with these optimization flags the output is `expected:
 actual: 66`. The bug won't reproduce if I specify C++ standard
before C++20, or if I don't disable strict-aliasing optimization.
Changing the size of A::y affects the number of bytes that are correctly copied
in the output. The bug reproduces in gcc 13.2.0 and from the latest
releases/gcc-13 branch (g++ (GCC) 13.2.1 20240306), but does not reproduce in
gcc-12.3.0 or with the latest trunk branch (g++ (GCC) 14.0.1 20240306
(experimental)). 
So, as far as I can tell the bug is exclusive to GCC13.

Re: [PATCH] LoongArch: Emit R_LARCH_RELAX for TLS IE with non-extreme code model to allow the IE to LE linker relaxation

2024-03-06 Thread chenglulu



在 2024/3/7 下午12:05, mengqinggang 写道:

Hi,

Thanks, this patch is LGTM.


I don't have a problem either.

Thanks.




在 2024/3/7 上午10:56, Xi Ruoyao 写道:

On Thu, 2024-03-07 at 10:43 +0800, mengqinggang wrote:

Hi,

Whether to add an option to control the generation of R_LARCH_RELAX,
similar to as -mrelax/-mno-relax.

There are already -mrelax and -mno-relax, they can be checked in the
compiler code with TARGET_LINKER_RELAXATION.

/* snip */


+    case 'Q':
+  if (!TARGET_LINKER_RELAXATION)
+ break;

So with -mno-relax we'll break early here, then no R_LARCH_RELAX will be
printed.


+  if (code == HIGH)
+ op = XEXP (op, 0);
+
+  if (loongarch_classify_symbolic_expression (op) == 
SYMBOL_TLS_IE)

+ fprintf (file, ".reloc\t.,R_LARCH_RELAX\n\t");
+
+  break;

The tls-ie-norelax.c test case also checks for -mno-relax:


+/* { dg-do compile } */
+/* { dg-options "-O2 -mcmodel=normal -mexplicit-relocs -mno-relax" 
} */
+/* { dg-final { scan-assembler-not "R_LARCH_RELAX" { target 
tls_native } } } */

i.e. -mno-relax is used compiling this test case, and the compiled
assembly code should not contain R_LARCH_RELAX.





[Bug tree-optimization/114238] [14 regression] Multiple 554.roms_r run-time regressions (4%-20%) since r14-9193-ga0b1798042d033

2024-03-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114238

Andrew Pinski  changed:

   What|Removed |Added

Summary|Multiple 554.roms_r |[14 regression] Multiple
   |run-time regressions|554.roms_r run-time
   |(4%-20%) since  |regressions (4%-20%) since
   |r14-9193-ga0b1798042d033|r14-9193-ga0b1798042d033
   Target Milestone|--- |14.0

[no subject]

2024-03-06 Thread Directeurschaphetdirecteurshappen Schappen via Gcc
Loadings,.


Results for 14.0.1 20240306 (experimental) [master r14-9343-gb575f37a342] (GCC) testsuite on s390x-ibm-linux-gnu arch14

2024-03-06 Thread stefansf--- via Gcc-testresults
LAST_UPDATED: Wed Mar  6 18:04:46 UTC 2024 (revision r14-9343-gb575f37a342)

=== acats tests ===
FAIL:   cb1010a

=== acats Summary ===
# of expected passes2327
# of unexpected failures1
Native configuration is s390x-ibm-linux-gnu arch14

=== gcc tests ===


Running target unix/-m31
FAIL: gcc.c-torture/execute/920501-4.c   -O1  execution test
FAIL: gcc.c-torture/execute/920501-4.c   -O2  execution test
FAIL: gcc.c-torture/execute/920501-4.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: gcc.c-torture/execute/920501-4.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: gcc.c-torture/execute/920501-4.c   -O3 -g  execution test
FAIL: gcc.c-torture/execute/920501-4.c   -Os  execution test
FAIL: gcc.c-torture/execute/920501-5.c   -O1  execution test
FAIL: gcc.c-torture/execute/920501-5.c   -O2  execution test
FAIL: gcc.c-torture/execute/920501-5.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: gcc.c-torture/execute/920501-5.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: gcc.c-torture/execute/920501-5.c   -O3 -g  execution test
FAIL: gcc.c-torture/execute/920501-5.c   -Os  execution test
FAIL: gcc.c-torture/execute/920721-4.c   -O2  execution test
FAIL: gcc.c-torture/execute/920721-4.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: gcc.c-torture/execute/920721-4.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: gcc.c-torture/execute/920721-4.c   -O3 -fomit-frame-pointer 
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: gcc.c-torture/execute/920721-4.c   -O3 -g  execution test
FAIL: gcc.c-torture/execute/920721-4.c   -Os  execution test
FAIL: gcc.dg/analyzer/pr94688.c (test for excess errors)
FAIL: gcc.dg/analyzer/pr95152-5.c (test for excess errors)
FAIL: c-c++-common/asan/pointer-compare-1.c   -O0  output pattern test
FAIL: c-c++-common/asan/pointer-compare-1.c   -O1  output pattern test
FAIL: c-c++-common/asan/pointer-compare-1.c   -O2  output pattern test
FAIL: c-c++-common/asan/pointer-compare-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  output pattern test
FAIL: c-c++-common/asan/pointer-compare-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  output pattern test
FAIL: c-c++-common/asan/pointer-compare-1.c   -O3 -g  output pattern test
FAIL: c-c++-common/asan/pointer-compare-1.c   -Os  output pattern test
FAIL: c-c++-common/asan/pointer-subtract-3.c   -O0  execution test
FAIL: c-c++-common/asan/pointer-subtract-3.c   -O1  execution test
FAIL: c-c++-common/asan/pointer-subtract-3.c   -O2  execution test
FAIL: c-c++-common/asan/pointer-subtract-3.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: c-c++-common/asan/pointer-subtract-3.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: c-c++-common/asan/pointer-subtract-3.c   -O3 -g  execution test
FAIL: c-c++-common/asan/pointer-subtract-3.c   -Os  execution test
FAIL: c-c++-common/asan/pr64820.c   -O0  output pattern test
FAIL: c-c++-common/asan/pr64820.c   -O1  output pattern test
FAIL: c-c++-common/asan/pr64820.c   -O2  output pattern test
FAIL: c-c++-common/asan/pr64820.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  output pattern test
FAIL: c-c++-common/asan/pr64820.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  output pattern test
FAIL: c-c++-common/asan/pr64820.c   -O3 -g  output pattern test
FAIL: c-c++-common/asan/pr64820.c   -Os  output pattern test
FAIL: c-c++-common/asan/use-after-return-1.c   -O0  output pattern test
FAIL: c-c++-common/asan/use-after-return-1.c   -O1  output pattern test
FAIL: c-c++-common/asan/use-after-return-1.c   -O2  output pattern test
FAIL: c-c++-common/asan/use-after-return-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  output pattern test
FAIL: c-c++-common/asan/use-after-return-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  output pattern test
FAIL: c-c++-common/asan/use-after-return-1.c   -O3 -g  output pattern test
FAIL: c-c++-common/asan/use-after-return-1.c   -Os  output pattern test
FAIL: c-c++-common/vector-subscript-4.c  -Wc++-compat   scan-tree-dump-not 
optimized "vector"
FAIL: gcc.dg/auto-init-uninit-17.c unconditional (test for warnings, line 14)
FAIL: gcc.dg/gcc-have-sync-compare-and-swap.c (test for excess errors)
FAIL: gcc.dg/loop-9.c scan-rtl-dump loop2_invariant "Decided"
FAIL: gcc.dg/loop-9.c scan-rtl-dump loop2_invariant "without introducing a new 
temporary register"
FAIL: gcc.dg/lower-subreg-1.c scan-rtl-dump subreg1 "Splitting reg"
FAIL: gcc.dg/sms-compare-debug-1.c (test for excess errors)
FAIL: gcc.dg/store_merging_5.c scan-tree-dump-times store-merging "MEM 
 [.*]" 1
FAIL: gcc.dg/uninit-17.c unconditional (test for warnings, line 14)
FAIL: c-c++-common/goacc/firstprivate-mappings-1.c 

[Bug c++/104850] Instantiating a destructor for a template class too early, before the calling destructor is seen - rejects valid code

2024-03-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104850

Andrew Pinski  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=96645

--- Comment #8 from Andrew Pinski  ---
Seems related to PR 96645 (and CWG2335).

Results for 14.0.1 20240307 (experimental) [remotes/origin/HEAD r14-9347-g8b483cd552] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-03-06 Thread Bill Seurer (POWER9 IEEE128) via Gcc-testresults


git commit g:8b483cd5521de79c13cf4807fd004d442b9ad9cd
gcc-descr r14-9347-g8b483cd5521de7

power9 IEEE128
Linux 6.8.0-0.rc6.20240229git805d849d7c3c.51.fc41.ppc64le ppc64le
GNU Make 4.4.1

DejaGnu:
DejaGnu version 1.6.3
Expect version  5.45.4
Tcl version 8.6

64-bit

LAST_UPDATED: Thu Mar  7 02:55:54 UTC 2024 (revision r14-9347-g8b483cd552)

Native configuration is powerpc64le-unknown-linux-gnu

=== gcc tests ===


Running target unix
XPASS: gcc.dg/Wtrampolines.c standard descriptors (test for warnings, line 32)
XPASS: gcc.dg/guality/example.c   -O0  execution test
XPASS: gcc.dg/guality/example.c  -Og -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O0  execution test
XPASS: gcc.dg/guality/guality.c   -O1  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O2  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/guality.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/guality.c   -O3 -g  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -Os  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c  -Og -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/inline-params.c   -O2  -DPREVENT_OPTIMIZATION  execution 
test
XPASS: gcc.dg/guality/inline-params.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/inline-params.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/inline-params.c   -O3 -g  -DPREVENT_OPTIMIZATION  
execution test
XPASS: gcc.dg/guality/inline-params.c   -Os  -DPREVENT_OPTIMIZATION  execution 
test
FAIL: gcc.dg/guality/loop-1.c   -O2  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O3 -fomit-frame-pointer -funroll-loops 
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 18 y == 2
FAIL: gcc.dg/guality/pr36728-3.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 y == 2
FAIL: gcc.dg/guality/pr36728-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 y == 
2
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i == 37
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i1 == 2 * 
37
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i2 == 3 * 
37
XPASS: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 j == 28 
+ 37
FAIL: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 34 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 39 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2  -DPREVENT_OPTIMIZATION  line 34 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2  -DPREVENT_OPTIMIZATION  line 39 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 34 c == [0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 39 c == [0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 34 c == [0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 39 c == [0]
FAIL: gcc.dg/guality/pr54200.c   -O1  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O2  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -Os  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 y == 25
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 z == 6
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 23 y == 117
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 23 z == 8
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto 

Results for 13.2.1 20240307 [releases/gcc-13 r13-8408-g58cbab9c1d] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-03-06 Thread Bill Seurer (POWER9) via Gcc-testresults


git commit g:58cbab9c1d1b863e0079a6525fe9a5b83960a5d3
gcc-descr r13-8408-g58cbab9c1d1b86

power9
Linux 5.15.0-97-generic ppc64le
GNU Make 4.3

DejaGnu:
DejaGnu version 1.6.2
Expect version  5.45.4
Tcl version 8.6

64-bit

LAST_UPDATED: Thu Mar  7 03:13:34 UTC 2024 (revision r13-8408-g58cbab9c1d)

Native configuration is powerpc64le-unknown-linux-gnu

=== gcc tests ===


Running target unix
XPASS: gcc.dg/Wtrampolines.c standard descriptors (test for warnings, line 29)
XPASS: gcc.dg/guality/example.c   -O0  execution test
XPASS: gcc.dg/guality/example.c   -O1  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/example.c  -Og -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O0  execution test
XPASS: gcc.dg/guality/guality.c   -O1  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O2  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O3 -g  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -Os  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c  -Og -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/guality.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/inline-params.c   -O2  -DPREVENT_OPTIMIZATION  execution 
test
XPASS: gcc.dg/guality/inline-params.c   -O3 -g  -DPREVENT_OPTIMIZATION  
execution test
XPASS: gcc.dg/guality/inline-params.c   -Os  -DPREVENT_OPTIMIZATION  execution 
test
XPASS: gcc.dg/guality/inline-params.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/inline-params.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/ipa-sra-1.c   -O0  line 15 k == 3
XPASS: gcc.dg/guality/ipa-sra-1.c   -O1  -DPREVENT_OPTIMIZATION  line 15 k == 3
XPASS: gcc.dg/guality/ipa-sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 15 k == 3
FAIL: gcc.dg/guality/loop-1.c   -O2  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O3 -fomit-frame-pointer -funroll-loops 
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 20 i == 1
FAIL: gcc.dg/guality/pr36728-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 18 y == 
2
FAIL: gcc.dg/guality/pr36728-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 18 y == 2
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 18 y == 2
FAIL: gcc.dg/guality/pr36728-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 y == 
2
FAIL: gcc.dg/guality/pr36728-3.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 y == 2
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i == 37
XPASS: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 j == 28 
+ 37
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i1 == 2 * 
37
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i2 == 3 * 
37
FAIL: gcc.dg/guality/pr54200.c   -O1  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O2  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -Os  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 z == 3
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 y == 25
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 z == 6
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 23 y == 117
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 23 z == 8
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 20 y == 25
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 20 z == 6
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 23 y == 117
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fuse-linker-plugin 

Re: [PATCH] LoongArch: Emit R_LARCH_RELAX for TLS IE with non-extreme code model to allow the IE to LE linker relaxation

2024-03-06 Thread mengqinggang

Hi,

Thanks, this patch is LGTM.


在 2024/3/7 上午10:56, Xi Ruoyao 写道:

On Thu, 2024-03-07 at 10:43 +0800, mengqinggang wrote:

Hi,

Whether to add an option to control the generation of R_LARCH_RELAX,
similar to as -mrelax/-mno-relax.

There are already -mrelax and -mno-relax, they can be checked in the
compiler code with TARGET_LINKER_RELAXATION.

/* snip */


+    case 'Q':
+  if (!TARGET_LINKER_RELAXATION)
+break;

So with -mno-relax we'll break early here, then no R_LARCH_RELAX will be
printed.


+  if (code == HIGH)
+op = XEXP (op, 0);
+
+  if (loongarch_classify_symbolic_expression (op) == SYMBOL_TLS_IE)
+fprintf (file, ".reloc\t.,R_LARCH_RELAX\n\t");
+
+  break;

The tls-ie-norelax.c test case also checks for -mno-relax:


+/* { dg-do compile } */
+/* { dg-options "-O2 -mcmodel=normal -mexplicit-relocs -mno-relax" } */
+/* { dg-final { scan-assembler-not "R_LARCH_RELAX" { target tls_native } } } */

i.e. -mno-relax is used compiling this test case, and the compiled
assembly code should not contain R_LARCH_RELAX.





Re: [patch, libgfortran] Part 2: PR105456 Child I/O does not propage iostat

2024-03-06 Thread Jerry D

On 3/6/24 9:13 AM, Harald Anlauf wrote:

Hi Jerry,

can you please replace the user message in e.g. your new testcase
pr105456-wf.f90 by say:

piomsg="The users message containing % and %% and %s and other stuff"

This behaves as expected with Intel, but dies horribly with gfortran
after your patch!

Cheers,
Harald




Fixed with:

commit 03932d3203bce244edd812b81921c2f16ea18d86 (HEAD -> master, 
origin/master, origin/HEAD)

Author: Jerry DeLisle 
Date:   Wed Mar 6 19:46:04 2024 -0800

Fortran: Fix issue with using snprintf function.

The previous patch used snprintf to set the message
string. The message string is not a formatted string
and the snprintf will interpret '%' related characters
as format specifiers when there are no associated
output variables. A segfault ensues.

This change replaces snprintf with a fortran string copy
function and null terminates the message string.

PR libfortran/105456

libgfortran/ChangeLog:

* io/list_read.c (list_formatted_read_scalar): Use fstrcpy
from libgfortran/runtime/string.c to replace snprintf.
(nml_read_obj): Likewise.
* io/transfer.c (unformatted_read): Likewise.
(unformatted_write): Likewise.
(formatted_transfer_scalar_read): Likewise.
(formatted_transfer_scalar_write): Likewise.
* io/write.c (list_formatted_write_scalar): Likewise.
(nml_write_obj): Likewise.

gcc/testsuite/ChangeLog:

* gfortran.dg/pr105456.f90: Revise using '%' characters
in users error message.

Jerry -



Re: [PATCH] c++: lambda capturing structured bindings [PR85889]

2024-03-06 Thread Jason Merrill

On 3/4/24 12:49, Marek Polacek wrote:

On Fri, Mar 01, 2024 at 07:58:24PM -0500, Marek Polacek wrote:

Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for 15?  (Or even trunk?)

-- >8 --
 clarifies that it's OK to capture structured
bindings.

[expr.prim.lambda.capture]/4 says "The identifier in a simple-capture shall
denote a local entity" and [basic.pre]/3: "An entity is a [...] structured
binding".

It doesn't appear that this was made a DR, so, strictly speaking, we
should have a -Wc++20-extensions warning, like clang++.

PR c++/85889

gcc/cp/ChangeLog:

* lambda.cc (add_capture): Add a pedwarn for capturing structured
bindings.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/decomp3.C: Use -Wno-c++20-extensions.
* g++.dg/cpp1z/decomp60.C: New test.
---
  gcc/cp/lambda.cc  |  9 +
  gcc/testsuite/g++.dg/cpp1z/decomp60.C | 12 
  gcc/testsuite/g++.dg/cpp2a/decomp3.C  |  2 +-
  3 files changed, 22 insertions(+), 1 deletion(-)
  create mode 100644 gcc/testsuite/g++.dg/cpp1z/decomp60.C

diff --git a/gcc/cp/lambda.cc b/gcc/cp/lambda.cc
index 4b1f9391fee..470f9d2c4f1 100644
--- a/gcc/cp/lambda.cc
+++ b/gcc/cp/lambda.cc
@@ -607,6 +607,15 @@ add_capture (tree lambda, tree id, tree orig_init, bool 
by_reference_p,
 TCTX_CAPTURE_BY_COPY, type))
return error_mark_node;
}
+
+  if (cxx_dialect < cxx20)
+   {
+ tree stripped_init = tree_strip_any_location_wrapper (initializer);


I was missing an auto_diagnostic_group here.  Fixed.


OK for 15 with that fix.


+ if (DECL_DECOMPOSITION_P (stripped_init)
+ && pedwarn (input_location, OPT_Wc__20_extensions,
+ "captured structured bindings are a C++20 extension"))
+   inform (DECL_SOURCE_LOCATION (stripped_init), "declared here");






[gcc r14-9348] Fortran: Fix issue with using snprintf function.

2024-03-06 Thread Jerry DeLisle via Gcc-cvs
https://gcc.gnu.org/g:03932d3203bce244edd812b81921c2f16ea18d86

commit r14-9348-g03932d3203bce244edd812b81921c2f16ea18d86
Author: Jerry DeLisle 
Date:   Wed Mar 6 19:46:04 2024 -0800

Fortran: Fix issue with using snprintf function.

The previous patch used snprintf to set the message
string. The message string is not a formatted string
and the snprintf will interpret '%' related characters
as format specifiers when there are no associated
output variables. A segfault ensues.

This change replaces snprintf with a fortran string copy
function and null terminates the message string.

PR libfortran/105456

libgfortran/ChangeLog:

* io/list_read.c (list_formatted_read_scalar): Use fstrcpy
from libgfortran/runtime/string.c to replace snprintf.
(nml_read_obj): Likewise.
* io/transfer.c (unformatted_read): Likewise.
(unformatted_write): Likewise.
(formatted_transfer_scalar_read): Likewise.
(formatted_transfer_scalar_write): Likewise.
* io/write.c (list_formatted_write_scalar): Likewise.
(nml_write_obj): Likewise.

gcc/testsuite/ChangeLog:

* gfortran.dg/pr105456.f90: Revise using '%' characters
in users error message.

Diff:
---
 gcc/testsuite/gfortran.dg/pr105456.f90 |  4 ++--
 libgfortran/io/list_read.c | 10 ++
 libgfortran/io/transfer.c  | 20 
 libgfortran/io/write.c | 10 ++
 4 files changed, 26 insertions(+), 18 deletions(-)

diff --git a/gcc/testsuite/gfortran.dg/pr105456.f90 
b/gcc/testsuite/gfortran.dg/pr105456.f90
index 188323847a7..60cd3b6f3e8 100644
--- a/gcc/testsuite/gfortran.dg/pr105456.f90
+++ b/gcc/testsuite/gfortran.dg/pr105456.f90
@@ -19,7 +19,7 @@ contains
 character :: ch
 read (unit,fmt='(A1)', advance="no", iostat=piostat, iomsg=piomsg) ch
 piostat = 42
-piomsg="The users message"
+piomsg="The users message containing % and %% and %s and other stuff"
 dtv%ch = ch
   end subroutine read_formatted
 end module sk1
@@ -35,4 +35,4 @@ program skip1
   write (*,'(10(A))') "Read: '",x%ch,"'"
 end program skip1
 ! { dg-output ".*(unit = 10, file = .*)" }
-! { dg-output "Fortran runtime error: The users message" }
+! { dg-output "Fortran runtime error: The users message containing % and %% 
and %s and other stuff" }
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index 707afaeb8dc..e38e9a84976 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -2268,9 +2268,10 @@ list_formatted_read_scalar (st_parameter_dt *dtp, bt 
type, void *p,
  !(dtp->common.flags & IOPARM_HAS_IOSTAT))
{
  char message[IOMSG_LEN + 1];
- child_iomsg_len = string_len_trim (IOMSG_LEN, child_iomsg) + 1;
+ child_iomsg_len = string_len_trim (IOMSG_LEN, child_iomsg);
  free_line (dtp);
- snprintf (message, child_iomsg_len, child_iomsg);
+ fstrcpy (message, child_iomsg_len, child_iomsg, child_iomsg_len);
+ message[child_iomsg_len] = '\0';
  generate_error (>common, dtp->u.p.child_saved_iostat,
  message);
}
@@ -3082,8 +3083,9 @@ nml_read_obj (st_parameter_dt *dtp, namelist_info *nl, 
index_type offset,
!(dtp->common.flags & IOPARM_HAS_IOSTAT))
  {
char message[IOMSG_LEN + 1];
-   child_iomsg_len = string_len_trim (IOMSG_LEN, child_iomsg) 
+ 1;
-   snprintf (message, child_iomsg_len, child_iomsg);
+   child_iomsg_len = string_len_trim (IOMSG_LEN, child_iomsg);
+   fstrcpy (message, child_iomsg_len, child_iomsg, 
child_iomsg_len);
+   message[child_iomsg_len] = '\0';
generate_error (>common, dtp->u.p.child_saved_iostat,
message);
goto nml_err_ret;
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index 9523a14c4bf..a86099d46f5 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -1128,8 +1128,9 @@ unformatted_read (st_parameter_dt *dtp, bt type,
  !(dtp->common.flags & IOPARM_HAS_IOSTAT))
{
  char message[IOMSG_LEN + 1];
- child_iomsg_len = string_len_trim (IOMSG_LEN, child_iomsg) + 1;
- snprintf (message, child_iomsg_len, child_iomsg);
+ child_iomsg_len = string_len_trim (IOMSG_LEN, child_iomsg);
+ fstrcpy (message, child_iomsg_len, child_iomsg, child_iomsg_len);
+ message[child_iomsg_len] = '\0';
  generate_error (>common, dtp->u.p.child_saved_iostat,
  message);
}
@@ -1271,8 +1272,9 @@ unformatted_write (st_parameter_dt *dtp, bt type,

[Bug libfortran/105456] Child I/O does not propage iostat

2024-03-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105456

--- Comment #7 from GCC Commits  ---
The master branch has been updated by Jerry DeLisle :

https://gcc.gnu.org/g:03932d3203bce244edd812b81921c2f16ea18d86

commit r14-9348-g03932d3203bce244edd812b81921c2f16ea18d86
Author: Jerry DeLisle 
Date:   Wed Mar 6 19:46:04 2024 -0800

Fortran: Fix issue with using snprintf function.

The previous patch used snprintf to set the message
string. The message string is not a formatted string
and the snprintf will interpret '%' related characters
as format specifiers when there are no associated
output variables. A segfault ensues.

This change replaces snprintf with a fortran string copy
function and null terminates the message string.

PR libfortran/105456

libgfortran/ChangeLog:

* io/list_read.c (list_formatted_read_scalar): Use fstrcpy
from libgfortran/runtime/string.c to replace snprintf.
(nml_read_obj): Likewise.
* io/transfer.c (unformatted_read): Likewise.
(unformatted_write): Likewise.
(formatted_transfer_scalar_read): Likewise.
(formatted_transfer_scalar_write): Likewise.
* io/write.c (list_formatted_write_scalar): Likewise.
(nml_write_obj): Likewise.

gcc/testsuite/ChangeLog:

* gfortran.dg/pr105456.f90: Revise using '%' characters
in users error message.

Re: [PATCH] c++: ICE with variable template and [[deprecated]] [PR110031]

2024-03-06 Thread Jason Merrill

On 3/4/24 17:11, Marek Polacek wrote:

Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/13?


OK.


-- >8 --
lookup_and_finish_template_variable already has and uses the complain
parameter but it is not passing it down to mark_used so we got the
default tf_warning_or_error, which causes various problems when
lookup_and_finish_template_variable gets called with complain=tf_none.

PR c++/110031

gcc/cp/ChangeLog:

* pt.cc (lookup_and_finish_template_variable): Pass complain to
mark_used.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/inline-var11.C: New test.
---
  gcc/cp/pt.cc  |  2 +-
  gcc/testsuite/g++.dg/cpp1z/inline-var11.C | 32 +++
  2 files changed, 33 insertions(+), 1 deletion(-)
  create mode 100644 gcc/testsuite/g++.dg/cpp1z/inline-var11.C

diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index c4bc54a8fdb..48d2b3cbac6 100644
--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -10533,7 +10533,7 @@ lookup_and_finish_template_variable (tree templ, tree 
targs,
if (var == error_mark_node)
  return error_mark_node;
var = finish_template_variable (var, complain);
-  mark_used (var);
+  mark_used (var, complain);
return var;
  }
  
diff --git a/gcc/testsuite/g++.dg/cpp1z/inline-var11.C b/gcc/testsuite/g++.dg/cpp1z/inline-var11.C

new file mode 100644
index 000..d92911ed3a9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1z/inline-var11.C
@@ -0,0 +1,32 @@
+// PR c++/110031
+// { dg-do compile { target c++17 } }
+
+template 
+[[deprecated]]
+inline constexpr bool t = true ;
+
+template 
+struct enableif;
+
+template<>
+struct enableif
+{
+using y = int;
+};
+template 
+using enableif_t = typename enableif::y;
+
+template > = 0>   // { dg-warning "deprecated" }
+struct A {  A(T &&)  {  }};
+
+template 
+struct A {
+  A(T &&) = delete;
+  A() = delete;
+};
+
+int main(void)
+{
+  A a(5.3); // { dg-error "use of deleted function" }
+  return 0;
+}

base-commit: a89c5df317d1de74871e2a05c36aed9cbbb21f42




Re: [PATCH] c++/modules: member alias tmpl partial inst [PR103994]

2024-03-06 Thread Jason Merrill

On 3/4/24 17:26, Patrick Palka wrote:

Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look
OK for trunk?

-- >8 --

Alias templates are weird in that their specializations can appear in
both decl_specializations and type_specializations.  They appear in the
latter only at parse time via finish_template_type.  This should probably
be revisited in GCC 15 since it seems sufficient to store them only in
decl_specializations.


It looks like most all of lookup_template_class is wrong for alias 
templates.


Can we move the alias template handling up higher and unconditionally 
return the result of tsubst?


Jason



Results for 14.0.1 20240306 (experimental) [master r14-9346-g74e8cc28eda] (GCC) testsuite on i686-pc-linux-gnu

2024-03-06 Thread H.J. Lu via Gcc-testresults
execution test
XPASS: gcc.dg/vect/vect-reduc-in-order-4.c -flto -ffat-lto-objects execution 
test
XPASS: gcc.dg/vect/vect-reduc-in-order-4.c execution test
FAIL: gcc.dg/vect/vect-simd-clone-16e.c scan-tree-dump-times vect "[nr] 
[^n]* = foo.simdclone" 4
FAIL: gcc.dg/vect/vect-simd-clone-16f.c scan-tree-dump-times vect "[nr] 
[^n]* = foo.simdclone" 2
FAIL: gcc.dg/vect/vect-simd-clone-17e.c scan-tree-dump-times vect "[nr] 
[^n]* = foo.simdclone" 4
FAIL: gcc.dg/vect/vect-simd-clone-17f.c scan-tree-dump-times vect "[nr] 
[^n]* = foo.simdclone" 2
FAIL: gcc.dg/vect/vect-simd-clone-18e.c scan-tree-dump-times vect "[nr] 
[^n]* = foo.simdclone" 4
FAIL: gcc.dg/vect/vect-simd-clone-18f.c scan-tree-dump-times vect "[nr] 
[^n]* = foo.simdclone" 2

=== gcc Summary ===

# of expected passes196892
# of unexpected failures126
# of unexpected successes   27
# of expected failures  1556
# of unsupported tests  4071
/export/gnu/import/git/gcc-test-master-ia32/bld/gcc/xgcc  version 14.0.1 
20240306 (experimental) [master r14-9346-g74e8cc28eda] (GCC) 

=== gfortran tests ===


Running target unix

=== gfortran Summary ===

# of expected passes69345
# of expected failures  275
# of unsupported tests  224
/export/gnu/import/git/gcc-test-master-ia32/bld/gcc/gfortran  version 14.0.1 
20240306 (experimental) [master r14-9346-g74e8cc28eda] (GCC) 

=== g++ tests ===


Running target unix
FAIL: g++.dg/guality/pr55665.C   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  line 23 p == 40

=== g++ Summary ===

# of expected passes259856
# of unexpected failures1
# of expected failures  2753
# of unsupported tests  10958
/export/gnu/import/git/gcc-test-master-ia32/bld/gcc/xg++  version 14.0.1 
20240306 (experimental) [master r14-9346-g74e8cc28eda] (GCC) 

=== objc tests ===


Running target unix

=== objc Summary ===

# of expected passes2840
# of expected failures  6
# of unsupported tests      70
/export/gnu/import/git/gcc-test-master-ia32/bld/gcc/xgcc  version 14.0.1 
20240306 (experimental) [master r14-9346-g74e8cc28eda] (GCC) 

=== libatomic tests ===


Running target unix

=== libatomic Summary ===

# of expected passes44
# of unsupported tests  5
=== libgomp tests ===


Running target unix

=== libgomp Summary ===

# of expected passes16297
# of expected failures  285
# of unsupported tests  635
=== libitm tests ===


Running target unix

=== libitm Summary ===

# of expected passes44
# of expected failures  3
# of unsupported tests  1
=== libstdc++ tests ===


Running target unix

=== libstdc++ Summary ===

# of expected passes19238
# of expected failures  126
# of unsupported tests  374

Compiler version: 14.0.1 20240306 (experimental) [master r14-9346-g74e8cc28eda] 
(GCC) 
Platform: i686-pc-linux-gnu
configure flags: --enable-clocale=gnu --with-system-zlib --enable-shared 
--enable-cet --with-demangler-in-ld --enable-libmpx --prefix=/usr/gcc-14.0.1 
i686-linux --with-fpmath=sse


[Bug tree-optimization/114246] [11/12/13 Regression] ICE: verify_gimple failed: invalid argument to gimple call with __builtin_memcpy()

2024-03-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114246

Andrew Pinski  changed:

   What|Removed |Added

   Keywords|ice-checking|

--- Comment #6 from Andrew Pinski  ---
Note even without checking there is an ICE that happens during FRE with the
invalid IR. (so removing the ice-checking marker).

Results for 12.3.1 20240307 [remotes/origin/releases/gcc-12 r12-10196-gdb302d81d2] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-03-06 Thread Bill Seurer (POWER8) via Gcc-testresults


git commit g:db302d81d246c324171422c20ffe1175feaa5e16
gcc-descr r12-10196-gdb302d81d246c3

power8
Linux 5.4.0-172-generic ppc64le
GNU Make 4.2.1

DejaGnu:
DejaGnu version 1.6.2
Expect version  5.45.4
Tcl version 8.6

64-bit

LAST_UPDATED: Thu Mar  7 02:00:20 UTC 2024 (revision r12-10196-gdb302d81d2)

Native configuration is powerpc64le-unknown-linux-gnu

=== gcc tests ===


Running target unix
XPASS: gcc.dg/Wtrampolines.c standard descriptors (test for warnings, line 29)
XPASS: gcc.dg/uninit-pred-7_a.c bogus warning (test for bogus messages, line 26)
XPASS: gcc.dg/guality/example.c   -O0  execution test
XPASS: gcc.dg/guality/example.c   -O1  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/example.c  -Og -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O0  execution test
XPASS: gcc.dg/guality/guality.c   -O1  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c  -Og -DPREVENT_OPTIMIZATION  execution test
FAIL: gcc.dg/guality/inline-params-2.c   -O2  -DPREVENT_OPTIMIZATION  execution 
test
FAIL: gcc.dg/guality/inline-params-2.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
FAIL: gcc.dg/guality/inline-params-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
FAIL: gcc.dg/guality/inline-params-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  
execution test
FAIL: gcc.dg/guality/inline-params-2.c   -Os  -DPREVENT_OPTIMIZATION  execution 
test
XPASS: gcc.dg/guality/ipa-sra-1.c   -O0  line 15 k == 3
XPASS: gcc.dg/guality/ipa-sra-1.c   -O1  -DPREVENT_OPTIMIZATION  line 15 k == 3
XPASS: gcc.dg/guality/ipa-sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 15 k == 3
FAIL: gcc.dg/guality/loop-1.c   -O2  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O3 -fomit-frame-pointer -funroll-loops 
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/pr36728-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 18 y == 2
FAIL: gcc.dg/guality/pr36728-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 18 y == 
2
FAIL: gcc.dg/guality/pr36728-3.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 y == 2
FAIL: gcc.dg/guality/pr36728-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 y == 
2
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i == 37
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i1 == 2 * 
37
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i2 == 3 * 
37
XPASS: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 j == 28 
+ 37
FAIL: gcc.dg/guality/pr41447-1.c   -O2  -DPREVENT_OPTIMIZATION  execution test
FAIL: gcc.dg/guality/pr41447-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
FAIL: gcc.dg/guality/pr41447-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  execution 
test
FAIL: gcc.dg/guality/pr41447-1.c   -Os  -DPREVENT_OPTIMIZATION  execution test
FAIL: gcc.dg/guality/pr41616-1.c   -O2  -DPREVENT_OPTIMIZATION  execution test
FAIL: gcc.dg/guality/pr41616-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
FAIL: gcc.dg/guality/pr41616-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
FAIL: gcc.dg/guality/pr41616-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  execution 
test
FAIL: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 35 v == 1
FAIL: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 40 v == 1
FAIL: gcc.dg/guality/pr43051-1.c   -O2  -DPREVENT_OPTIMIZATION  line 35 v == 1
FAIL: gcc.dg/guality/pr43051-1.c   -O2  -DPREVENT_OPTIMIZATION  line 40 v == 1
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 35 v == 1
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 40 v == 1
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 35 v == 1
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 40 v == 1
FAIL: gcc.dg/guality/pr43051-1.c   -O3 -fomit-frame-pointer -funroll-loops 
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 35 v == 1
FAIL: gcc.dg/guality/pr43051-1.c   -O3 -fomit-frame-pointer -funroll-loops 
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 40 v == 1

[Bug ipa/114262] Over-inlining when optimizing for size with gnu_inline function

2024-03-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114262

--- Comment #5 from Andrew Pinski  ---
(In reply to LIU Hao from comment #4) 
> The only difference between the C99 `extern inline` and C++ `extern inline`
> is that the C++ external definition is COMDAT.

Well not really. comdat changes heurstics here though. The reason being C++
inline functions are most likely smaller and should really be inlined. This is
all heurstics of inlining and figuring out locally in the TU that it might not
be called in another TU or not.

Note GCC has not retuned its -Os heurstics for a long time because it has been
decent enough for most folks and corner cases like this is almost never come
up.

[Bug tree-optimization/114253] False positive maybe-uninitialized with std::optional and ternary

2024-03-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114253

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||missed-optimization

--- Comment #5 from Andrew Pinski  ---
```
   [local count: 1073741824]:
  # pid_16 = PHI 
  # pid$4_26 = PHI 
  kill_pid (0);
  goto ; [100.00%]

   [count: 0]:
:
  goto ; [100.00%]

   [local count: 1073741824]:
  _12 = VIEW_CONVERT_EXPR(pid$4_26);
  if (_12 != 0)
goto ; [33.00%]
  else
goto ; [67.00%]

   [local count: 354334800]:
  kill_pid (pid_16);
  goto ; [100.00%]

```

Funny if we turn off SRA we get:
```
   [local count: 354334800]:
  _2 = MEM[(int &)];
  kill_pid (_2);
  goto ; [100.00%]

   [count: 0]:
:
  goto ; [100.00%]

   [local count: 536870912]:
  kill_pid (_2);

   [local count: 536870912]:
  goto ; [100.00%]
```

(note bb9/bb17 here looks to be landing pads for EH).

[Bug ipa/114262] Over-inlining when optimizing for size with gnu_inline function

2024-03-06 Thread lh_mouse at 126 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114262

--- Comment #4 from LIU Hao  ---
(In reply to Andrew Pinski from comment #3)
> It looks like it has been this way since r0-37737-g4838c5ee553f06 (2001) (or
> rather that is when it was used by the tree inline; I don't want to dig
> further back to understand the RTL inliner). So looks like this is just
> missing documentation ...

It's not just about `gnu_inline`. If we switch to C++ inline we get the same
result:

(https://gcc.godbolt.org/z/ehbjqj5xh)
```
struct impl;
struct impl* get_impl(int key);
int get_value(struct impl* p);


extern inline
int get_value_by_key(int key)
  {
struct impl* p = get_impl(key);
if(!p)
  return -1;
return get_value(p);
  }

int real_get_value_by_key(int key)
  {
return get_value_by_key(key);
  }
```

GCC outputs:
```
real_get_value_by_key(int):
pushrsi
callget_impl(int)
testrax, rax
je  .L2
mov rdi, rax
pop rcx
jmp get_value(impl*)
.L2:
or  eax, -1
pop rdx
ret
```


If we switched to C99 `extern inline` then it would produce desired result:
```
get_value_by_key:
pushrsi
callget_impl
testrax, rax
je  .L2
mov rdi, rax
pop rcx
jmp get_value
.L2:
or  eax, -1
pop rdx
ret
real_get_value_by_key:
jmp get_value_by_key
``

The only difference between the C99 `extern inline` and C++ `extern inline` is
that the C++ external definition is COMDAT.

[Bug tree-optimization/114253] False positive maybe-uninitialized with std::optional and ternary

2024-03-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114253

--- Comment #4 from Andrew Pinski  ---
VIEW_CONVERT_EXPR(pid$4_26)

Where I have seen this before ...

[Bug ipa/114262] Over-inlining when optimizing for size with gnu_inline function

2024-03-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114262

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||documentation

--- Comment #3 from Andrew Pinski  ---
The C++ front-end does:
  /* Handle gnu_inline attribute.  */
  if (GNU_INLINE_P (decl1))
{
  DECL_EXTERNAL (decl1) = 1;
  DECL_NOT_REALLY_EXTERN (decl1) = 0;
  DECL_INTERFACE_KNOWN (decl1) = 1;
  DECL_DISREGARD_INLINE_LIMITS (decl1) = 1;
}

C front-end does:
  /* For GNU C extern inline functions disregard inline limits.  */
  if (DECL_EXTERNAL (fndecl)
  && DECL_DECLARED_INLINE_P (fndecl)
  && (flag_gnu89_inline
  || lookup_attribute ("gnu_inline", DECL_ATTRIBUTES (fndecl
DECL_DISREGARD_INLINE_LIMITS (fndecl) = 1;

This specifically from r0-82849-gc536a6a77a19a8 but it was done different
before that (using a language hook).

https://gcc.gnu.org/pipermail/gcc-patches/2007-July/221806.html
https://gcc.gnu.org/pipermail/gcc-patches/2007-August/223406.html


It looks like it has been this way since r0-37737-g4838c5ee553f06 (2001) (or
rather that is when it was used by the tree inline; I don't want to dig further
back to understand the RTL inliner). So looks like this is just missing
documentation ...

Re: [PATCH] LoongArch: Emit R_LARCH_RELAX for TLS IE with non-extreme code model to allow the IE to LE linker relaxation

2024-03-06 Thread Xi Ruoyao
On Thu, 2024-03-07 at 10:43 +0800, mengqinggang wrote:
> Hi,
> 
> Whether to add an option to control the generation of R_LARCH_RELAX,
> similar to as -mrelax/-mno-relax.

There are already -mrelax and -mno-relax, they can be checked in the
compiler code with TARGET_LINKER_RELAXATION.

/* snip */

> > +    case 'Q':
> > +  if (!TARGET_LINKER_RELAXATION)
> > +break;

So with -mno-relax we'll break early here, then no R_LARCH_RELAX will be
printed.

> > +  if (code == HIGH)
> > +op = XEXP (op, 0);
> > +
> > +  if (loongarch_classify_symbolic_expression (op) == SYMBOL_TLS_IE)
> > +fprintf (file, ".reloc\t.,R_LARCH_RELAX\n\t");
> > +
> > +  break;

The tls-ie-norelax.c test case also checks for -mno-relax:

> > +/* { dg-do compile } */
> > +/* { dg-options "-O2 -mcmodel=normal -mexplicit-relocs -mno-relax" } */
> > +/* { dg-final { scan-assembler-not "R_LARCH_RELAX" { target tls_native } } 
> > } */

i.e. -mno-relax is used compiling this test case, and the compiled
assembly code should not contain R_LARCH_RELAX.

-- 
Xi Ruoyao 
School of Aerospace Science and Technology, Xidian University


Results for 11.4.1 20240307 [releases/gcc-11 revision 16ead05d13a:fce62c30b6e:788cf673bd752b833e81a591a820259e9198973f] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-03-06 Thread Bill Seurer (POWER9) via Gcc-testresults


git commit g:788cf673bd752b833e81a591a820259e9198973f
gcc-descr r11-11271-g788cf673bd752b

power9
Linux 5.15.0-97-generic ppc64le
GNU Make 4.3

DejaGnu:
DejaGnu version 1.6.2
Expect version  5.45.4
Tcl version 8.6

64-bit

LAST_UPDATED: Thu Mar  7 01:52:06 UTC 2024 (revision 
16ead05d13a:fce62c30b6e:788cf673bd752b833e81a591a820259e9198973f)

Native configuration is powerpc64le-unknown-linux-gnu

=== gcc tests ===


Running target unix
FAIL: gcc.dg/analyzer/analyzer-verbosity-2a.c (test for excess errors)
FAIL: gcc.dg/analyzer/analyzer-verbosity-3a.c (test for excess errors)
FAIL: gcc.dg/analyzer/edges-1.c (test for excess errors)
FAIL: gcc.dg/analyzer/file-1.c (test for excess errors)
FAIL: gcc.dg/analyzer/file-2.c (test for excess errors)
FAIL: gcc.dg/analyzer/file-paths-1.c (test for excess errors)
FAIL: gcc.dg/analyzer/file-pr58237.c (test for excess errors)
FAIL: gcc.dg/analyzer/pr99716-1.c (test for excess errors)
FAIL: c-c++-common/attr-retain-6.c  -Wc++-compat   (test for warnings, line 21)
FAIL: c-c++-common/attr-retain-6.c  -Wc++-compat   scan-assembler 
__libc_freeres_fn,"ax"
FAIL: c-c++-common/attr-retain-7.c  -Wc++-compat   (test for warnings, line 6)
FAIL: c-c++-common/attr-retain-7.c  -Wc++-compat   scan-assembler 
.data.foo,"awR"
FAIL: c-c++-common/attr-retain-8.c  -Wc++-compat   (test for warnings, line 5)
FAIL: c-c++-common/attr-retain-8.c  -Wc++-compat   scan-assembler .data.foo,"aw"
XPASS: gcc.dg/Wtrampolines.c standard descriptors (test for warnings, line 29)
XPASS: gcc.dg/graphite/pr69728.c scan-tree-dump graphite "loop nest optimized"
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O0  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O1  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O2  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O3 -g  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -Os  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: gcc.dg/torture/pr52451.c   -O0  execution test
FAIL: gcc.dg/torture/pr52451.c   -O1  execution test
FAIL: gcc.dg/torture/pr52451.c   -O2  execution test
FAIL: gcc.dg/torture/pr52451.c   -O3 -g  execution test
FAIL: gcc.dg/torture/pr52451.c   -Os  execution test
FAIL: gcc.dg/torture/pr52451.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: gcc.dg/torture/pr52451.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: gcc.dg/torture/pr91323.c   -O0  execution test
FAIL: gcc.dg/torture/pr91323.c   -O1  execution test
FAIL: gcc.dg/torture/pr91323.c   -O2  execution test
FAIL: gcc.dg/torture/pr91323.c   -O3 -g  execution test
FAIL: gcc.dg/torture/pr91323.c   -Os  execution test
FAIL: gcc.dg/torture/pr91323.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: gcc.dg/torture/pr91323.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
XPASS: gcc.dg/tree-ssa/ssa-dom-cse-2.c scan-tree-dump optimized "return 28;"
UNRESOLVED: gcc.dg/vect/pr108950.c -flto -ffat-lto-objects  scan-tree-dump-not 
vect "widen_sum"
UNRESOLVED: gcc.dg/vect/pr108950.c scan-tree-dump-not vect "widen_sum"
FAIL: gcc.target/powerpc/pr56605.c scan-rtl-dump-times combine "(compare:CC 
((?:and|zero_extend):(?:DI) ((?:sub)?reg:[SD]I" 1
FAIL: gcc.target/powerpc/rlwimi-2.c scan-assembler-times (?n)^s+[a-z] 20217
FAIL: gcc.target/powerpc/rs6000-fpint.c scan-assembler-not stfiwx
XPASS: gcc.target/powerpc/ppc-fortran/ieee128-math.f90   -O  (test for excess 
errors)

=== gcc Summary ===

# of expected passes147356
# of unexpected failures38
# of unexpected successes   4
# of expected failures  916
# of unresolved testcases   2
# of unsupported tests  2763
/home/gccbuild/build/nightly/build-gcc-11/gcc/xgcc  version 11.4.1 20240307 
[releases/gcc-11 revision 
16ead05d13a:fce62c30b6e:788cf673bd752b833e81a591a820259e9198973f] (GCC) 

=== gfortran tests ===


Running target unix
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O0  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O1  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O2  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O3 -fomit-frame-pointer 
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O3 -g  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -Os  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O0  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O1  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O2  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O3 -fomit-frame-pointer 

Results for 12.3.1 20240307 [releases/gcc-12 r12-10196-gdb302d81d2] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-03-06 Thread Bill Seurer (POWER9 IEEE128) via Gcc-testresults


git commit g:db302d81d246c324171422c20ffe1175feaa5e16
gcc-descr r12-10196-gdb302d81d246c3

power9 IEEE128
Linux 6.8.0-0.rc6.20240229git805d849d7c3c.51.fc41.ppc64le ppc64le
GNU Make 4.4.1

DejaGnu:
DejaGnu version 1.6.3
Expect version  5.45.4
Tcl version 8.6

64-bit

LAST_UPDATED: Thu Mar  7 01:45:10 UTC 2024 (revision r12-10196-gdb302d81d2)

Native configuration is powerpc64le-unknown-linux-gnu

=== gcc tests ===


Running target unix
FAIL: gcc.dg/analyzer/data-model-4.c (test for excess errors)
FAIL: gcc.dg/analyzer/torture/conftest-1.c   -O0  (test for excess errors)
FAIL: gcc.dg/analyzer/torture/conftest-1.c   -O1  (test for excess errors)
FAIL: gcc.dg/analyzer/torture/conftest-1.c   -O2  (test for excess errors)
FAIL: gcc.dg/analyzer/torture/conftest-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  (test for excess errors)
FAIL: gcc.dg/analyzer/torture/conftest-1.c   -O3 -g  (test for excess errors)
FAIL: gcc.dg/analyzer/torture/conftest-1.c   -Os  (test for excess errors)
XPASS: gcc.dg/Wtrampolines.c standard descriptors (test for warnings, line 29)
FAIL: gcc.dg/split-1.c (test for excess errors)
UNRESOLVED: gcc.dg/split-1.c compilation failed to produce executable
FAIL: gcc.dg/split-2.c (test for excess errors)
UNRESOLVED: gcc.dg/split-2.c compilation failed to produce executable
FAIL: gcc.dg/split-3.c (test for excess errors)
UNRESOLVED: gcc.dg/split-3.c compilation failed to produce executable
FAIL: gcc.dg/split-4.c (test for excess errors)
UNRESOLVED: gcc.dg/split-4.c compilation failed to produce executable
FAIL: gcc.dg/split-5.c (test for excess errors)
UNRESOLVED: gcc.dg/split-5.c compilation failed to produce executable
FAIL: gcc.dg/split-6.c (test for excess errors)
UNRESOLVED: gcc.dg/split-6.c compilation failed to produce executable
FAIL: gcc.dg/split-7.c (test for excess errors)
UNRESOLVED: gcc.dg/split-7.c compilation failed to produce executable
FAIL: gcc.dg/split-8.c (test for excess errors)
UNRESOLVED: gcc.dg/split-8.c compilation failed to produce executable
XPASS: gcc.dg/uninit-pred-7_a.c bogus warning (test for bogus messages, line 26)
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O0  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O1  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O2  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O3 -g  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -Os  execution test
FAIL: gcc.dg/torture/float128-nan.c   -O0  execution test
FAIL: gcc.dg/torture/float128-nan.c   -O1  execution test
FAIL: gcc.dg/torture/float128-nan.c   -O2  execution test
FAIL: gcc.dg/torture/float128-nan.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: gcc.dg/torture/float128-nan.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: gcc.dg/torture/float128-nan.c   -O3 -g  execution test
FAIL: gcc.dg/torture/float128-nan.c   -Os  execution test
FAIL: gcc.dg/torture/pr52451.c   -O0  execution test
FAIL: gcc.dg/torture/pr52451.c   -O1  execution test
FAIL: gcc.dg/torture/pr52451.c   -O2  execution test
FAIL: gcc.dg/torture/pr52451.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: gcc.dg/torture/pr52451.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: gcc.dg/torture/pr52451.c   -O3 -g  execution test
FAIL: gcc.dg/torture/pr52451.c   -Os  execution test
FAIL: gcc.dg/torture/pr91323.c   -O0  execution test
FAIL: gcc.dg/torture/pr91323.c   -O1  execution test
FAIL: gcc.dg/torture/pr91323.c   -O2  execution test
FAIL: gcc.dg/torture/pr91323.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: gcc.dg/torture/pr91323.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: gcc.dg/torture/pr91323.c   -O3 -g  execution test
FAIL: gcc.dg/torture/pr91323.c   -Os  execution test
FAIL: gcc.dg/tree-prof/split-1.c compilation,  -fprofile-generate 
-D_PROFILE_GENERATE
UNRESOLVED: gcc.dg/tree-prof/split-1.c compilation,  -fprofile-use 
-D_PROFILE_USE
UNRESOLVED: gcc.dg/tree-prof/split-1.c execution,-fprofile-generate 
-D_PROFILE_GENERATE
UNRESOLVED: gcc.dg/tree-prof/split-1.c execution,-fprofile-use 
-D_PROFILE_USE
XPASS: gcc.dg/tree-ssa/ssa-dom-cse-2.c scan-tree-dump optimized "return 28;"
FAIL: gcc.target/powerpc/nan128-1.c execution test
FAIL: gcc.target/powerpc/pr105334.c (test for excess errors)
FAIL: gcc.target/powerpc/pr56605.c scan-rtl-dump-times combine "(compare:CC 
((?:and|zero_extend):(?:[SD]I) ((?:sub)?reg:[SD]I" 1
FAIL: gcc.target/powerpc/rlwimi-2.c scan-assembler-times (?n)^s+[a-z] 20217
FAIL: gcc.target/powerpc/rs6000-fpint.c scan-assembler-not stfiwx

Re: [PATCH] LoongArch: Emit R_LARCH_RELAX for TLS IE with non-extreme code model to allow the IE to LE linker relaxation

2024-03-06 Thread mengqinggang

Hi,

Whether to add an option to control the generation of R_LARCH_RELAX,
similar to as -mrelax/-mno-relax.


在 2024/2/29 下午3:11, Xi Ruoyao 写道:

In Binutils we need to make IE to LE relaxation only allowed when there
is an R_LARCH_RELAX after R_LARCH_TLE_IE_PC_{HI20,LO12} so an invalid
"partial" relaxation won't happen with the extreme code model.  So if we
are emitting %ie_pc_{hi20,lo12} in a non-extreme code model, emit an
R_LARCH_RELAX to allow the relaxation.  The IE to LE relaxation does not
require the pcalau12i and the ld instruction to be adjacent, so we don't
need to limit ourselves to use the macro.

For the distro maintainers backporting changes: this change depends on
r14-8721, without r14-8721 R_LARCH_RELAX can be emitted mistakenly in
the extreme code model.

gcc/ChangeLog:

* config/loongarch/loongarch.cc (loongarch_print_operand_reloc):
Support 'Q' for R_LARCH_RELAX for TLS IE.
(loongarch_output_move): Use 'Q' to print R_LARCH_RELAX for TLS
IE.
* config/loongarch/loongarch.md (ld_from_got): Likewise.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/tls-ie-relax.c: New test.
* gcc.target/loongarch/tls-ie-norelax.c: New test.
* gcc.target/loongarch/tls-ie-extreme.c: New test.
---

Bootstrapped & regtested on loongarch64-linux-gnu.  Ok for trunk?

  gcc/config/loongarch/loongarch.cc | 15 ++-
  gcc/config/loongarch/loongarch.md |  2 +-
  .../gcc.target/loongarch/tls-ie-extreme.c |  5 +
  .../gcc.target/loongarch/tls-ie-norelax.c |  5 +
  gcc/testsuite/gcc.target/loongarch/tls-ie-relax.c | 11 +++
  5 files changed, 36 insertions(+), 2 deletions(-)
  create mode 100644 gcc/testsuite/gcc.target/loongarch/tls-ie-extreme.c
  create mode 100644 gcc/testsuite/gcc.target/loongarch/tls-ie-norelax.c
  create mode 100644 gcc/testsuite/gcc.target/loongarch/tls-ie-relax.c

diff --git a/gcc/config/loongarch/loongarch.cc 
b/gcc/config/loongarch/loongarch.cc
index 0428b6e65d5..70e31bb831c 100644
--- a/gcc/config/loongarch/loongarch.cc
+++ b/gcc/config/loongarch/loongarch.cc
@@ -4981,7 +4981,7 @@ loongarch_output_move (rtx dest, rtx src)
  if (type == SYMBOL_TLS_LE)
return "lu12i.w\t%0,%h1";
  else
-   return "pcalau12i\t%0,%h1";
+   return "%Q1pcalau12i\t%0,%h1";
}
  
if (src_code == CONST_INT)

@@ -6145,6 +6145,7 @@ loongarch_print_operand_reloc (FILE *file, rtx op, bool 
hi64_part,
 'L'  Print the low-part relocation associated with OP.
 'm'Print one less than CONST_INT OP in decimal.
 'N'Print the inverse of the integer branch condition for 
comparison OP.
+   'Q'  Print R_LARCH_RELAX for TLS IE.
 'r'  Print address 12-31bit relocation associated with OP.
 'R'  Print address 32-51bit relocation associated with OP.
 'T'Print 'f' for (eq:CC ...), 't' for (ne:CC ...),
@@ -6282,6 +6283,18 @@ loongarch_print_operand (FILE *file, rtx op, int letter)
letter);
break;
  
+case 'Q':

+  if (!TARGET_LINKER_RELAXATION)
+   break;
+
+  if (code == HIGH)
+   op = XEXP (op, 0);
+
+  if (loongarch_classify_symbolic_expression (op) == SYMBOL_TLS_IE)
+   fprintf (file, ".reloc\t.,R_LARCH_RELAX\n\t");
+
+  break;
+
  case 'r':
loongarch_print_operand_reloc (file, op, false /* hi64_part */,
 true /* lo_reloc */);
diff --git a/gcc/config/loongarch/loongarch.md 
b/gcc/config/loongarch/loongarch.md
index f3b5c641fce..525e1e82183 100644
--- a/gcc/config/loongarch/loongarch.md
+++ b/gcc/config/loongarch/loongarch.md
@@ -2620,7 +2620,7 @@ (define_insn "@ld_from_got"
(match_operand:P 2 "symbolic_operand")))]
UNSPEC_LOAD_FROM_GOT))]
""
-  "ld.\t%0,%1,%L2"
+  "%Q2ld.\t%0,%1,%L2"
[(set_attr "type" "move")]
  )
  
diff --git a/gcc/testsuite/gcc.target/loongarch/tls-ie-extreme.c b/gcc/testsuite/gcc.target/loongarch/tls-ie-extreme.c

new file mode 100644
index 000..00c545a3e8c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/tls-ie-extreme.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=loongarch64 -mabi=lp64d -mcmodel=extreme 
-mexplicit-relocs=auto -mrelax" } */
+/* { dg-final { scan-assembler-not "R_LARCH_RELAX" { target tls_native } } } */
+
+#include "tls-ie-relax.c"
diff --git a/gcc/testsuite/gcc.target/loongarch/tls-ie-norelax.c 
b/gcc/testsuite/gcc.target/loongarch/tls-ie-norelax.c
new file mode 100644
index 000..dd6bf3634a4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/tls-ie-norelax.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mcmodel=normal -mexplicit-relocs -mno-relax" } */
+/* { dg-final { scan-assembler-not "R_LARCH_RELAX" { target tls_native } } } */
+
+#include "tls-ie-relax.c"
diff --git 

[Bug ipa/114262] Over-inlining when optimizing for size with gnu_inline function

2024-03-06 Thread lh_mouse at 126 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114262

--- Comment #2 from LIU Hao  ---
(In reply to Andrew Pinski from comment #1)
> I thought it was documented that gnu_inline also causes always_inline if
> optimization is turned on but I can't seem to find that ...

Is that the case in GCC source? I think I would have to find a workaround for
it.

Re: [PATCH] c++/modules: inline namespace abi_tag streaming [PR110730]

2024-03-06 Thread Patrick Palka
On Wed, 6 Mar 2024, Jason Merrill wrote:

> On 3/6/24 14:10, Patrick Palka wrote:
> > Tested on x86_64-pc-linux-gnu, does this look OK for trunk?
> > 
> > -- >8 --
> > 
> > The unreduced testcase from this PR crashes at runtime ultimately
> > because we don't stream the abi_tag attribute on inline namespaces and
> > so the filesystem::current_path() call resolves to the non-C++11 ABI
> > version even though the C++11 ABI is active, leading to a crash when
> > destructing the call result (which contains an std::string member).
> > 
> > While we do stream the DECL_ATTRIBUTES of all decls that go through
> > the generic tree streaming routines, it seems namespaces are streamed
> > separately from other decls and we don't use the generic routines for
> > them.  So this patch makes us stream the abi_tag manually for (inline)
> > namespaces.
> 
> Why not stream all DECL_ATTRIBUTES of all namespaces?

AFAICT abi_tag and deprecated are the only attributes that we recognize
on a namespace, and for deprecated it should suffice to stream the
TREE_DEPRECATED flag instead of the actual attribute, so hardcoding
abi_tag streaming seems convenient.

If we wanted to stream all DECL_ATTRIBUTES of a namespace then we'd have
to assume up front what kind of tree arguments of the attributes can be,
e.g. an INTEGER_CST or a STRING_CST etc and implement streaming of these
trees within the bytes_in/out base classes instead of trees_in/out (we
only have access to a bytes_in/out object from read/write_namespaces).
I'm not sure that's worth it unless there's other namespace attributes
we want to stream?

> 
> Jason
> 
> 



[Bug tree-optimization/114262] Over-inlining when optimizing for size?

2024-03-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114262

--- Comment #1 from Andrew Pinski  ---
I thought it was documented that gnu_inline also causes always_inline if
optimization is turned on but I can't seem to find that ...

[Bug tree-optimization/114262] New: Over-inlining when optimizing for size?

2024-03-06 Thread lh_mouse at 126 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114262

Bug ID: 114262
   Summary: Over-inlining when optimizing for size?
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: lh_mouse at 126 dot com
  Target Milestone: ---

(https://gcc.godbolt.org/z/a4ox6oEfT)
```
struct impl;
struct impl* get_impl(int key);
int get_value(struct impl* p);


extern __inline__ __attribute__((__gnu_inline__))
int get_value_by_key(int key)
  {
struct impl* p = get_impl(key);
if(!p)
  return -1;
return get_value(p);
  }

int real_get_value_by_key(int key)
  {
return get_value_by_key(key);
  }

```

This is actually two functions, one is `gnu_inline` and the other is a
non-inline one. It looks to me that if I mark a function `gnu_inline`, I assert
that 'somewhere I shall provide an external definition for you' so when
optimizing for size, GCC may generate a call instead of using the more complex
inline definition.

The `real_get_value_by_key` function is made a deliberate sibling call, so
ideally this should be
```
real_get_value_by_key:
jmp get_value_by_key
```
and not 
```
real_get_value_by_key:
pushrsi
callget_impl
testrax, rax
je  .L2
mov rdi, rax
pop rcx
jmp get_value
.L2:
or  eax, -1
pop rdx
ret
```

It still gets inlined with `-finline-limit=0` and can only be disabled by
`-fno-inline`. I have no idea how it is controlled.

---

# Trivia

These are two `gnu_inline` functions from the same library. Most of the time
they should both be inlined in user code. However, external definitions are
required when optimization is not turned on, or when their addresses are taken,
so they must still exist. As they are unlikely to be used  anyway, optimizing
for size makes much more sense.

Results for 14.0.1 20240306 (experimental) [remotes/origin/HEAD r14-9346-g74e8cc28ed] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-03-06 Thread Bill Seurer (POWER8) via Gcc-testresults
e-ssa/copy-headers-8.c scan-tree-dump-times ch2 "Will duplicate 
bb" 2
XPASS: gcc.dg/tree-ssa/ssa-dom-cse-2.c scan-tree-dump optimized "return 28;"
FAIL: gcc.dg/tree-ssa/update-threading.c scan-tree-dump-times optimized 
"Invalid sum" 0
FAIL: gcc.dg/vect/vect-117.c -flto -ffat-lto-objects  scan-tree-dump-not 
optimized "Invalid sum"
FAIL: gcc.dg/vect/vect-117.c scan-tree-dump-not optimized "Invalid sum"
FAIL: gcc.target/powerpc/rlwimi-2.c scan-assembler-times (?n)^s+[a-z] 20217
XPASS: gcc.target/powerpc/ppc-fortran/ieee128-math.f90   -O  (test for excess 
errors)

=== gcc Summary ===

# of expected passes177989
# of unexpected failures148
# of unexpected successes   12
# of expected failures  1597
# of unsupported tests  4948
/home/gccbuild/build/nightly/build-gcc-trunk/gcc/xgcc  version 14.0.1 20240306 
(experimental) [remotes/origin/HEAD r14-9346-g74e8cc28ed] (GCC) 

=== gfortran tests ===


Running target unix
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O0  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O1  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O2  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O3 -fomit-frame-pointer 
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O3 -g  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -Os  execution test
FAIL: gfortran.dg/ieee/comparisons_3.F90   -O0  execution test
FAIL: gfortran.dg/ieee/comparisons_3.F90   -O1  execution test
FAIL: gfortran.dg/ieee/comparisons_3.F90   -O2  execution test
FAIL: gfortran.dg/ieee/comparisons_3.F90   -O3 -fomit-frame-pointer 
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/ieee/comparisons_3.F90   -O3 -g  execution test
FAIL: gfortran.dg/ieee/comparisons_3.F90   -Os  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O0  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O1  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O2  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O3 -fomit-frame-pointer -funroll-loops 
-fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O3 -g  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -Os  execution test

=== gfortran Summary ===

# of expected passes69414
# of unexpected failures12
# of unexpected successes   6
# of expected failures  285
# of unsupported tests  173
/home/gccbuild/build/nightly/build-gcc-trunk/gcc/gfortran  version 14.0.1 
20240306 (experimental) [remotes/origin/HEAD r14-9346-g74e8cc28ed] (GCC) 

=== g++ tests ===


Running target unix

=== g++ Summary ===

# of expected passes258953
# of expected failures  2623
# of unsupported tests  11621
/home/gccbuild/build/nightly/build-gcc-trunk/gcc/xg++  version 14.0.1 20240306 
(experimental) [remotes/origin/HEAD r14-9346-g74e8cc28ed] (GCC) 

=== obj-c++ tests ===


Running target unix

=== obj-c++ Summary ===

# of expected passes1503
# of expected failures  10
# of unsupported tests  79
/home/gccbuild/build/nightly/build-gcc-trunk/gcc/xg++  version 14.0.1 20240306 
(experimental) [remotes/origin/HEAD r14-9346-g74e8cc28ed] (GCC) 

=== objc tests ===


Running target unix

=== objc Summary ===

# of expected passes2846
# of unsupported tests  70
/home/gccbuild/build/nightly/build-gcc-trunk/gcc/xgcc  version 14.0.1 20240306 
(experimental) [remotes/origin/HEAD r14-9346-g74e8cc28ed] (GCC) 

=== libatomic tests ===


Running target unix

=== libatomic Summary ===

# of expected passes54
=== libgomp tests ===


Running target unix

=== libgomp Summary ===

# of expected passes16151
# of expected failures  285
# of unsupported tests  697
=== libitm tests ===


Running target unix

=== libitm Summary ===

# of expected passes44
# of expected failures  3
# of unsupported tests  1
=== libstdc++ tests ===


Running target unix

=== libstdc++ Summary ===

# of expected passes18843
# of expected failures  126
# of unsupported tests  567

Compiler version: 14.0.1 20240306 (experimental) [remotes/origin/HEAD 
r14-9346-g74e8cc28ed] (GCC) 
Platform: powerpc64le-unknown-linux-gnu
configure flags: --prefix=/opt/gcc-nightly/trunk 
--enable-languages=c,c++,fortran,objc,obj-c++ --with-cpu=power8 
--enable-secureplt
fail   WARNING: Could not generate test framework tests
fail   WARNING: Could not generate test framework tests

Re: [PATCH] c++: Fix ICE diagnosing incomplete type of overloaded function set [PR98356]

2024-03-06 Thread Jason Merrill

On 3/4/24 18:30, Nathaniel Shead wrote:

Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk?


OK.


-- >8 --

In the linked PR the result of 'get_first_fn' is a USING_DECL against
the template parameter, to be filled in on instantiation. But we don't
actually need to get the first set of the member functions: it's enough
to know that we have a (possibly overloaded) member function at all.

PR c++/98356

gcc/cp/ChangeLog:

* typeck2.cc (cxx_incomplete_type_diagnostic): Don't assume
'member' will be a FUNCTION_DECL (or something like it).

gcc/testsuite/ChangeLog:

* g++.dg/pr98356.C: New test.

Signed-off-by: Nathaniel Shead 
---
  gcc/cp/typeck2.cc  | 11 +--
  gcc/testsuite/g++.dg/pr98356.C |  9 +
  2 files changed, 14 insertions(+), 6 deletions(-)
  create mode 100644 gcc/testsuite/g++.dg/pr98356.C

diff --git a/gcc/cp/typeck2.cc b/gcc/cp/typeck2.cc
index 9608bdccd8b..31198b2f9f5 100644
--- a/gcc/cp/typeck2.cc
+++ b/gcc/cp/typeck2.cc
@@ -350,16 +350,15 @@ cxx_incomplete_type_diagnostic (location_t loc, 
const_tree value,
  bad_member:
{
tree member = TREE_OPERAND (value, 1);
-   if (is_overloaded_fn (member))
- member = get_first_fn (member);
-
-   if (DECL_FUNCTION_MEMBER_P (member)
-   && ! flag_ms_extensions)
+   if (is_overloaded_fn (member) && !flag_ms_extensions)
  {
gcc_rich_location richloc (loc);
/* If "member" has no arguments (other than "this"), then
   add a fix-it hint.  */
-   if (type_num_arguments (TREE_TYPE (member)) == 1)
+   member = MAYBE_BASELINK_FUNCTIONS (member);
+   if (TREE_CODE (member) == FUNCTION_DECL
+   && DECL_OBJECT_MEMBER_FUNCTION_P (member)
+   && type_num_arguments (TREE_TYPE (member)) == 1)
  richloc.add_fixit_insert_after ("()");
complained = emit_diagnostic (diag_kind, , 0,
 "invalid use of member function %qD "
diff --git a/gcc/testsuite/g++.dg/pr98356.C b/gcc/testsuite/g++.dg/pr98356.C
new file mode 100644
index 000..acea238593b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr98356.C
@@ -0,0 +1,9 @@
+// PR c++/98356
+// { dg-do compile { target c++11 } }
+
+template  class T> struct S {
+  using A = T;
+  using A::foo;
+  void foo ();
+  void bar () {foo.}  // { dg-error "invalid use of member function" }
+};




RE: [PATCH v2] Draft|Internal-fn: Introduce internal fn saturation US_PLUS

2024-03-06 Thread Li, Pan2
Thanks Richard for comments.

> gen_int_libfunc will no longer make it emit libcalls for fixed point
> modes, so this can't be correct
> and there's no libgcc implementation for integer mode saturating ops,
> so it's pointless to emit calls
> to them.

Got the pointer here, the OPTAB_NL(usadd_optab, "usadd$Q$a3", US_PLUS, "usadd", 
'3', gen_unsigned_fixed_libfunc)
Is designed for the fixed point, cannot cover integer mode right now.

Given we have saturating integer alu like below, could you help to coach me the 
most reasonable way to represent
It in scalar as well as vectorize part? Sorry not familiar with this part and 
still dig into how it works...

uint32_t sat_uadd (uint32_t a, uint32_t b)
{
  uint32_t add = a + b;
  return add | -(add < a);
}

sint32_t sat_sadd (sint32_t a, sint32_t b)
{
  sint32_t add = a + b;
  sint32_t x = a ^ b;
  sint32_t y = add ^ x;
  return x < 0 ? add : (y >= 0 ? add : INT32_MAX + (x < 0));
}

uint32_t sat_usub (uint32_t a, uint32_t b)
{
  return a >= b ? a - b : 0;
}

sint32_t sat_ssub (sint32_t a, sint32_t b)
{
  sint32_t sub = a - b;
  sint32_t x = a ^ b;
  sint32_t y = sub ^ x;
  return x >= 0 ? sub : (y >= 0 ? sub : INT32_MAX + (x < 0));
}

uint32_t sat_umul (uint32_t a, uint32_t b)
{
  uint64_t mul = a * b;

  return mul <= (uint64_t)UINT32_MAX ? (uint32_t)mul : UINT32_MAX;
}

sint32_t sat_smul (sint32_t a, sint32_t b)
{
  sint64_t mul = a * b;

  return mul >= (sint64_t)INT32_MIN && mul <= (sint64_t)INT32_MAX ? 
(sint32_t)mul : INT32_MAX + ((x ^ y) < 0);
}

uint32_t sat_udiv (uint32_t a, uint32_t b)
{
  return a / b; // never overflow
}

sint32_t sat_sdiv (sint32_t a, sint32_t b)
{
  return a == INT32_MIN && b == -1 ? INT32_MAX : a / b;
}

sint32_t sat_abs (sint32_t a)
{
  return a >= 0 ? a : (a == INT32_MIN ? INT32_MAX : -a);
}

Pan

-Original Message-
From: Richard Biener  
Sent: Tuesday, March 5, 2024 4:41 PM
To: Li, Pan2 
Cc: Tamar Christina ; gcc-patches@gcc.gnu.org; 
juzhe.zh...@rivai.ai; Wang, Yanzhang ; 
kito.ch...@gmail.com; jeffreya...@gmail.com
Subject: Re: [PATCH v2] Draft|Internal-fn: Introduce internal fn saturation 
US_PLUS

On Tue, Mar 5, 2024 at 8:09 AM Li, Pan2  wrote:
>
> Thanks Richard for comments.
>
> > I do wonder what the existing usadd patterns with integer vector modes
> > in various targets do?
> > Those define_insn will at least not end up in the optab set I guess,
> > so they must end up
> > being either unused or used by explicit gen_* (via intrinsic
> > functions?) or by combine?
>
> For usadd with vector modes, I think the backend like RISC-V try to leverage 
> instructions
> like Vector Single-Width Saturating Add(aka vsaddu.vv/x/i).
>
> > I think simply changing gen_*_fixed_libfunc to gen_int_libfunc won't
> > work.  Since there's
> > no libgcc support I'd leave it as gen_*_fixed_libfunc thus no library
> > fallback for integers?
>
> Change to gen_int_libfunc follows other int optabs. I am not sure if it will 
> hit the standard name usaddm3 for vector mode.
> But the happy path for scalar modes works up to a point, please help to 
> correct me if any misunderstanding.

gen_int_libfunc will no longer make it emit libcalls for fixed point
modes, so this can't be correct
and there's no libgcc implementation for integer mode saturating ops,
so it's pointless to emit calls
to them.

> #0  riscv_expand_usadd (dest=0x76a8c7c8, x=0x76a8c798, 
> y=0x76a8c7b0) at 
> /home/pli/gcc/111/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/config/riscv/riscv.cc:10662
> #1  0x029f142a in gen_usaddsi3 (operand0=0x76a8c7c8, 
> operand1=0x76a8c798, operand2=0x76a8c7b0) at 
> /home/pli/gcc/111/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/config/riscv/riscv.md:3848
> #2  0x01751e60 in insn_gen_fn::operator() rtx_def*> (this=0x4910e70 ) at 
> /home/pli/gcc/111/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/recog.h:441
> #3  0x0180f553 in maybe_gen_insn (icode=CODE_FOR_usaddsi3, nops=3, 
> ops=0x7fffd2c0) at 
> /home/pli/gcc/111/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/optabs.cc:8232
> #4  0x0180fa42 in maybe_expand_insn (icode=CODE_FOR_usaddsi3, nops=3, 
> ops=0x7fffd2c0) at 
> /home/pli/gcc/111/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/optabs.cc:8275
> #5  0x0180fade in expand_insn (icode=CODE_FOR_usaddsi3, nops=3, 
> ops=0x7fffd2c0) at 
> /home/pli/gcc/111/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/optabs.cc:8306
> #6  0x015cebdc in expand_fn_using_insn (stmt=0x76a36480, 
> icode=CODE_FOR_usaddsi3, noutputs=1, ninputs=2) at 
> /home/pli/gcc/111/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/internal-fn.cc:254
> #7  0x015de146 in expand_direct_optab_fn (fn=IFN_SAT_ADD, 
> stmt=0x76a36480, optab=usadd_optab, nargs=2) at 
> /home/pli/gcc/111/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/internal-fn.cc:3818
> #8  0x015e3610 in expand_SAT_ADD (fn=IFN_SAT_ADD, 
> stmt=0x76a36480) at 
> 

Results for 14.0.1 20240307 (experimental) [remotes/origin/HEAD r14-9347-g8b483cd5521] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-03-06 Thread Bill Seurer (POWER9) via Gcc-testresults


git commit g:8b483cd5521de79c13cf4807fd004d442b9ad9cd
gcc-descr r14-9347-g8b483cd5521de7

power9
Linux 5.15.0-97-generic ppc64le
GNU Make 4.3

DejaGnu:
DejaGnu version 1.6.2
Expect version  5.45.4
Tcl version 8.6

64-bit

LAST_UPDATED: Thu Mar  7 00:23:56 UTC 2024 (revision r14-9347-g8b483cd5521)

Native configuration is powerpc64le-unknown-linux-gnu

=== gcc tests ===


Running target unix
XPASS: gcc.dg/Wtrampolines.c standard descriptors (test for warnings, line 32)
XPASS: gcc.dg/guality/example.c   -O0  execution test
XPASS: gcc.dg/guality/example.c  -Og -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O0  execution test
XPASS: gcc.dg/guality/guality.c   -O1  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O2  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O3 -g  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -Os  -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c  -Og -DPREVENT_OPTIMIZATION  execution test
XPASS: gcc.dg/guality/guality.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/guality.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/inline-params.c   -O2  -DPREVENT_OPTIMIZATION  execution 
test
XPASS: gcc.dg/guality/inline-params.c   -O3 -g  -DPREVENT_OPTIMIZATION  
execution test
XPASS: gcc.dg/guality/inline-params.c   -Os  -DPREVENT_OPTIMIZATION  execution 
test
XPASS: gcc.dg/guality/inline-params.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
XPASS: gcc.dg/guality/inline-params.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION execution test
FAIL: gcc.dg/guality/loop-1.c   -O2  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O3 -fomit-frame-pointer -funroll-loops 
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 i == 1
FAIL: gcc.dg/guality/loop-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 20 i == 1
FAIL: gcc.dg/guality/pr36728-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 18 y == 2
FAIL: gcc.dg/guality/pr36728-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 y == 
2
FAIL: gcc.dg/guality/pr36728-3.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 y == 2
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i == 37
XPASS: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 j == 28 
+ 37
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i1 == 2 * 
37
FAIL: gcc.dg/guality/pr41353-1.c  -Og -DPREVENT_OPTIMIZATION  line 28 i2 == 3 * 
37
FAIL: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 34 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 39 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2  -DPREVENT_OPTIMIZATION  line 34 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2  -DPREVENT_OPTIMIZATION  line 39 c == 
[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 34 c == [0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 39 c == [0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 34 c == [0]
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 39 c == [0]
FAIL: gcc.dg/guality/pr54200.c   -O1  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O2  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -Os  -DPREVENT_OPTIMIZATION  line 20 z == 3
FAIL: gcc.dg/guality/pr54200.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 z == 3
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 y == 25
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 20 z == 6
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 23 y == 117
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 23 z == 8
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  

[PATCH] LoongArch: testsuite: Add compilation options to the regname-fp-s9.c.

2024-03-06 Thread Lulu Cheng
When the value of the macro DEFAULT_CFLAGS is set to '-ansi -pedantic-errors',
regname-s9-fp.c will test to fail. To solve this problem, add the compilation
option '-Wno-pedantic -std=gnu90' to this test case.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/regname-fp-s9.c: Add compilation option
'-Wno-pedantic -std=gnu90'.
---
 gcc/testsuite/gcc.target/loongarch/regname-fp-s9.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/testsuite/gcc.target/loongarch/regname-fp-s9.c 
b/gcc/testsuite/gcc.target/loongarch/regname-fp-s9.c
index d2e3b80f83c..77a74f1f667 100644
--- a/gcc/testsuite/gcc.target/loongarch/regname-fp-s9.c
+++ b/gcc/testsuite/gcc.target/loongarch/regname-fp-s9.c
@@ -1,3 +1,4 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-Wno-pedantic -std=gnu90" } */
 register long s9 asm("s9"); /* { dg-note "conflicts with 's9'" } */
 register long fp asm("fp"); /* { dg-warning "register of 'fp' used for 
multiple global register variables" } */
-- 
2.39.3



Results for 13.2.1 20240307 [releases/gcc-13 r13-8408-g58cbab9c1d] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-03-06 Thread Bill Seurer (POWER9 IEEE128) via Gcc-testresults


git commit g:58cbab9c1d1b863e0079a6525fe9a5b83960a5d3
gcc-descr r13-8408-g58cbab9c1d1b86

power9 IEEE128
Linux 6.8.0-0.rc6.20240229git805d849d7c3c.51.fc41.ppc64le ppc64le
GNU Make 4.4.1

DejaGnu:
DejaGnu version 1.6.3
Expect version  5.45.4
Tcl version 8.6

64-bit

LAST_UPDATED: Thu Mar  7 00:36:47 UTC 2024 (revision r13-8408-g58cbab9c1d)

Native configuration is powerpc64le-unknown-linux-gnu

=== gcc tests ===


Running target unix
FAIL: gcc.dg/analyzer/data-model-4.c (test for excess errors)
FAIL: gcc.dg/analyzer/torture/conftest-1.c   -O0  (test for excess errors)
FAIL: gcc.dg/analyzer/torture/conftest-1.c   -O1  (test for excess errors)
FAIL: gcc.dg/analyzer/torture/conftest-1.c   -O2  (test for excess errors)
FAIL: gcc.dg/analyzer/torture/conftest-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  (test for excess errors)
FAIL: gcc.dg/analyzer/torture/conftest-1.c   -O3 -g  (test for excess errors)
FAIL: gcc.dg/analyzer/torture/conftest-1.c   -Os  (test for excess errors)
XPASS: gcc.dg/Wtrampolines.c standard descriptors (test for warnings, line 29)
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O0  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O1  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O2  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O3 -g  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -Os  execution test
FAIL: gcc.dg/torture/pr52451.c   -O0  execution test
FAIL: gcc.dg/torture/pr52451.c   -O1  execution test
FAIL: gcc.dg/torture/pr52451.c   -O2  execution test
FAIL: gcc.dg/torture/pr52451.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: gcc.dg/torture/pr52451.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: gcc.dg/torture/pr52451.c   -O3 -g  execution test
FAIL: gcc.dg/torture/pr52451.c   -Os  execution test
FAIL: gcc.dg/torture/pr91323.c   -O0  execution test
FAIL: gcc.dg/torture/pr91323.c   -O1  execution test
FAIL: gcc.dg/torture/pr91323.c   -O2  execution test
FAIL: gcc.dg/torture/pr91323.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: gcc.dg/torture/pr91323.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: gcc.dg/torture/pr91323.c   -O3 -g  execution test
FAIL: gcc.dg/torture/pr91323.c   -Os  execution test
XPASS: gcc.dg/tree-ssa/ssa-dom-cse-2.c scan-tree-dump optimized "return 28;"
FAIL: gcc.target/powerpc/pr105334.c (test for excess errors)
FAIL: gcc.target/powerpc/rlwimi-2.c scan-assembler-times (?n)^s+[a-z] 20217
FAIL: gcc.target/powerpc/rs6000-fpint.c scan-assembler-not stfiwx
XPASS: gcc.target/powerpc/ppc-fortran/ieee128-math.f90   -O  (test for excess 
errors)

=== gcc Summary ===

# of expected passes165607
# of unexpected failures31
# of unexpected successes   3
# of expected failures  1481
# of unsupported tests  2963
/home/gccbuild/build/nightly/build-gcc-13/gcc/xgcc  version 13.2.1 20240307 
[releases/gcc-13 r13-8408-g58cbab9c1d] (GCC) 

=== gfortran tests ===


Running target unix
XPASS: gfortran.dg/default_format_2.f90   -O0  execution test
XPASS: gfortran.dg/default_format_2.f90   -O1  execution test
XPASS: gfortran.dg/default_format_2.f90   -O2  execution test
XPASS: gfortran.dg/default_format_2.f90   -O3 -fomit-frame-pointer 
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
XPASS: gfortran.dg/default_format_2.f90   -O3 -g  execution test
XPASS: gfortran.dg/default_format_2.f90   -Os  execution test
XPASS: gfortran.dg/default_format_denormal_2.f90   -O0  execution test
XPASS: gfortran.dg/default_format_denormal_2.f90   -O1  execution test
XPASS: gfortran.dg/default_format_denormal_2.f90   -O2  execution test
XPASS: gfortran.dg/default_format_denormal_2.f90   -O3 -fomit-frame-pointer 
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
XPASS: gfortran.dg/default_format_denormal_2.f90   -O3 -g  execution test
XPASS: gfortran.dg/default_format_denormal_2.f90   -Os  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O0  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O1  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O2  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O3 -fomit-frame-pointer 
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O3 -g  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -Os  execution test

=== gfortran Summary ===

# of expected passes68021
# of unexpected successes   18
# 

[Bug rtl-optimization/114261] [13/14 Regression] Scheduling takes excessive time (97%)

2024-03-06 Thread patrick at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114261

--- Comment #2 from Patrick O'Neill  ---
Created attachment 57641
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57641=edit
unreduced preprocessed testcase

[Bug rtl-optimization/114261] [13/14 Regression] Scheduling takes excessive time (97%)

2024-03-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114261

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |13.3
 CC||amonakov at gcc dot gnu.org,
   ||pinskia at gcc dot gnu.org

[Bug rtl-optimization/114261] [13/14 Regression] Scheduling takes excessive time (97%)

2024-03-06 Thread patrick at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114261

--- Comment #1 from Patrick O'Neill  ---
Created attachment 57640
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57640=edit
Raw testcase and headers

[Bug rtl-optimization/114261] New: [13/14 Regression] Scheduling takes excessive time (97%)

2024-03-06 Thread patrick at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114261

Bug ID: 114261
   Summary: [13/14 Regression] Scheduling takes excessive time
(97%)
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: patrick at rivosinc dot com
  Target Milestone: ---

I recently enabled timeout detection for the risc-v fuzzer so I'm not sure how
interesting this is. Seems like something weird is going on in scheduling that
should be short circuited/bailed out.

tip-of-tree
> ./bin/riscv64-unknown-linux-gnu-gcc red.c -O1 -fschedule-insns -w 
> -ftime-report

Time variable   usr   sys  wall
  GGC
 phase setup:   0.02 (  0%)   0.00 (  0%)   0.02 (  0%)
 2779k (  1%)
 phase parsing  :   0.72 (  0%)   0.54 ( 38%)   1.35 (  0%)
   36M ( 13%)
 phase opt and generate : 917.85 (100%)   0.89 ( 62%) 925.29 (100%)
  241M ( 86%)
 phase last asm :   0.07 (  0%)   0.00 (  0%)   0.06 (  0%)
  343k (  0%)
 garbage collection :   0.31 (  0%)   0.01 (  1%)   0.37 (  0%)
0  (  0%)
 dump files :   0.01 (  0%)   0.00 (  0%)   0.00 (  0%)
0  (  0%)
 callgraph construction :   0.06 (  0%)   0.00 (  0%)   0.10 (  0%)
 8997k (  3%)
 callgraph optimization :   0.02 (  0%)   0.01 (  1%)   0.03 (  0%)
   10k (  0%)
 callgraph functions expansion  : 915.19 (100%)   0.76 ( 53%) 922.36 (100%)
  198M ( 71%)
 callgraph ipa passes   :   2.45 (  0%)   0.10 (  7%)   2.68 (  0%)
   19M (  7%)
 ipa function summary   :   0.20 (  0%)   0.00 (  0%)   0.21 (  0%)
 5358k (  2%)
 ipa dead code removal  :   0.00 (  0%)   0.00 (  0%)   0.01 (  0%)
0  (  0%)
 ipa inlining heuristics:   0.01 (  0%)   0.00 (  0%)   0.00 (  0%)
  192  (  0%)
 ipa pure const :   0.01 (  0%)   0.00 (  0%)   0.01 (  0%)
 1080  (  0%)
 ipa modref :   0.01 (  0%)   0.00 (  0%)   0.01 (  0%)
 4336  (  0%)
 cfg construction   :   0.02 (  0%)   0.00 (  0%)   0.02 (  0%)
   28k (  0%)
 cfg cleanup:   0.08 (  0%)   0.00 (  0%)   0.07 (  0%)
 2496  (  0%)
 CFG verifier   :   1.27 (  0%)   0.01 (  1%)   1.26 (  0%)
0  (  0%)
 trivially dead code:   0.11 (  0%)   0.00 (  0%)   0.12 (  0%)
0  (  0%)
 df scan insns  :   0.20 (  0%)   0.04 (  3%)   0.26 (  0%)
  528  (  0%)
 df reaching defs   :   1.03 (  0%)   0.03 (  2%)   1.07 (  0%)
0  (  0%)
 df live regs   :   0.75 (  0%)   0.00 (  0%)   0.80 (  0%)
0  (  0%)
 df live regs   :   0.22 (  0%)   0.00 (  0%)   0.22 (  0%)
0  (  0%)
 df use-def / def-use chains:   0.00 (  0%)   0.00 (  0%)   0.03 (  0%)
0  (  0%)
 df reg dead/unused notes   :   0.66 (  0%)   0.00 (  0%)   0.68 (  0%)
 7041k (  2%)
 register information   :   0.27 (  0%)   0.00 (  0%)   0.28 (  0%)
0  (  0%)
 alias analysis :   0.45 (  0%)   0.01 (  1%)   0.45 (  0%)
   14M (  5%)
 alias stmt walking :   0.38 (  0%)   0.03 (  2%)   0.50 (  0%)
 3192  (  0%)
 register scan  :   0.03 (  0%)   0.00 (  0%)   0.05 (  0%)
  586k (  0%)
 rebuild jump labels:   0.05 (  0%)   0.00 (  0%)   0.05 (  0%)
0  (  0%)
 preprocessing  :   0.08 (  0%)   0.09 (  6%)   0.24 (  0%)
 1861k (  1%)
 lexical analysis   :   0.24 (  0%)   0.16 ( 11%)   0.30 (  0%)
0  (  0%)
 parser (global):   0.18 (  0%)   0.12 (  8%)   0.35 (  0%)
10103k (  4%)
 parser function body   :   0.19 (  0%)   0.17 ( 12%)   0.40 (  0%)
   24M (  9%)
 inline parameters  :   0.10 (  0%)   0.00 (  0%)   0.07 (  0%)
  128k (  0%)
 tree gimplify  :   0.04 (  0%)   0.02 (  1%)   0.05 (  0%)
   12M (  5%)
 tree eh:   0.00 (  0%)   0.01 (  1%)   0.00 (  0%)
10056  (  0%)
 tree CFG construction  :   0.01 (  0%)   0.00 (  0%)   0.02 (  0%)
 8660k (  3%)
 tree CFG cleanup   :   0.03 (  0%)   0.00 (  0%)   0.02 (  0%)
   20k (  0%)
 tree copy propagation  :   0.02 (  0%)   0.00 (  0%)   0.03 (  0%)
  200  (  0%)
 tree PTA   :   0.36 (  0%)   0.06 (  4%)   0.44 (  0%)
 2128k (  1%)
 tree SSA other :   0.01 (  0%)   0.00 (  0%)   0.00 (  0%)
0  (  0%)
 tree SSA rewrite   :   0.03 (  0%)   0.00 (  0%)   0.02 (  0%)
 2079k (  1%)
 tree SSA incremental   :   0.01 (  0%)   0.00 (  0%)   0.01 (  0%)
  196k (  0%)
 tree operand 

Results for 14.0.1 20240307 (experimental) [master revision 74e8cc28eda:bad6306994b:8b483cd5521de79c13cf4807fd004d442b9ad9cd] (GCC) testsuite on pru-unknown-elf

2024-03-06 Thread The GnuPru BuildBot via Gcc-testresults
LAST_UPDATED:  7.03.2024 (чт)  1:00:12 UTC (revision )

Target is pru-unknown-elf
Host   is x86_64-pc-linux-gnu

=== gcc tests ===


Running target pru-sim
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-11.c (test for excess errors)
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-11.c 2 blank line(s) in output
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-11.c expected multiline 
pattern lines 46-61
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-8.c (test for excess errors)
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-8.c 2 blank line(s) in output
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-8.c expected multiline 
pattern lines 19-34
FAIL: gcc.dg/analyzer/out-of-bounds-diagram-10.c (test for excess errors)
FAIL: gcc.dg/analyzer/out-of-bounds-diagram-10.c 2 blank line(s) in output
FAIL: gcc.dg/analyzer/out-of-bounds-diagram-10.c expected multiline pattern 
lines 13-28
FAIL: c-c++-common/pr103798-2.c  -Wc++-compat   scan-assembler-not memchr
FAIL: c-c++-common/pr103798-3.c  -Wc++-compat   scan-assembler-not memchr
FAIL: c-c++-common/pr103798-4.c  -Wc++-compat   scan-assembler-not memchr
FAIL: gcc.dg/20141029-1.c scan-rtl-dump-times final "mem/v(/.)*:HI" 4
XPASS: gcc.dg/attr-alloc_size-11.c missing range info for short (test for 
warnings, line 51)
XPASS: gcc.dg/attr-alloc_size-11.c missing range info for signed char (test for 
warnings, line 50)
FAIL: gcc.dg/c23-nullptr-1.c (test for excess errors)
UNRESOLVED: gcc.dg/c23-nullptr-1.c compilation failed to produce executable
FAIL: gcc.dg/gnu23-tag-composite-1.c  (test for errors, line 43)
FAIL: gcc.dg/gnu23-tag-composite-1.c (test for excess errors)
FAIL: gcc.dg/loop-9.c scan-rtl-dump loop2_invariant "Decided"
FAIL: gcc.dg/loop-9.c scan-rtl-dump loop2_invariant "without introducing a new 
temporary register"
FAIL: gcc.dg/pr110279-1.c scan-tree-dump-times widening_mul "Generated FMA" 3
FAIL: gcc.dg/pr23623.c scan-rtl-dump-times final "mem/v(/.)*:SI" 12
FAIL: gcc.dg/pr82929-2.c scan-tree-dump-times store-merging "Merging 
successful" 1
FAIL: gcc.dg/pr82929.c scan-tree-dump-times store-merging "Merging successful" 1
FAIL: gcc.dg/pr84877.c execution test
FAIL: gcc.dg/store_merging_1.c scan-tree-dump-times store-merging "Merging 
successful" 2
FAIL: gcc.dg/store_merging_10.c scan-tree-dump-times store-merging "Merging 
successful" 2
FAIL: gcc.dg/store_merging_11.c scan-tree-dump-times store-merging "Merging 
successful" 2
FAIL: gcc.dg/store_merging_13.c scan-tree-dump-times store-merging "Merging 
successful" 13
FAIL: gcc.dg/store_merging_14.c scan-tree-dump-times store-merging "Merging 
successful" 9
FAIL: gcc.dg/store_merging_15.c scan-tree-dump-times store-merging "Merging 
successful" 2
FAIL: gcc.dg/store_merging_2.c scan-tree-dump-times store-merging "Merging 
successful" 2
FAIL: gcc.dg/store_merging_20.c scan-tree-dump-times store-merging "Merging 
successful" 3
FAIL: gcc.dg/store_merging_21.c scan-tree-dump-times store-merging "Merging 
successful" 4
FAIL: gcc.dg/store_merging_22.c scan-tree-dump-times store-merging "Merging 
successful" 1
FAIL: gcc.dg/store_merging_22.c scan-tree-dump-times store-merging "New 
sequence of 1 stores to replace old one of 3 stores" 1
FAIL: gcc.dg/store_merging_26.c scan-tree-dump store-merging "New sequence of 1 
stores to replace old one of 2 stores"
FAIL: gcc.dg/store_merging_27.c scan-tree-dump store-merging "New sequence of 
[12] stores to replace old one of 3 stores"
FAIL: gcc.dg/store_merging_28.c scan-tree-dump-times store-merging "New 
sequence of [24] stores to replace old one of 6 stores" 1
FAIL: gcc.dg/store_merging_29.c scan-tree-dump store-merging "New sequence of 3 
stores to replace old one of 6 stores"
FAIL: gcc.dg/store_merging_4.c scan-tree-dump-times store-merging "Merging 
successful" 2
FAIL: gcc.dg/store_merging_5.c scan-tree-dump-times store-merging "MEM 
 [.*]" 1
FAIL: gcc.dg/store_merging_5.c scan-tree-dump-times store-merging "Merging 
successful" 1
FAIL: gcc.dg/store_merging_7.c scan-tree-dump-times store-merging "Merging 
successful" 1
FAIL: gcc.dg/store_merging_8.c scan-tree-dump-times store-merging "Merging 
successful" 2
FAIL: gcc.dg/store_merging_9.c scan-tree-dump-times store-merging "Merging 
successful" 2
WARNING: gcc.dg/torture/pr112305.c   -O0  execution test program timed out.
FAIL: gcc.dg/torture/pr112305.c   -O0  execution test
FAIL: gcc.dg/tree-ssa/copy-headers-8.c scan-tree-dump-times ch2 "Conditional 
combines static and invariant" 1
FAIL: gcc.dg/tree-ssa/copy-headers-8.c scan-tree-dump-times ch2 "Will duplicate 
bb" 2
FAIL: gcc.dg/tree-ssa/ctz-char.c scan-tree-dump-times optimized 
"__builtin_ctz|.CTZ" 1
FAIL: gcc.dg/tree-ssa/ctz-complement-char.c scan-tree-dump-times optimized 
"__builtin_ctz|.CTZ" 1
FAIL: gcc.dg/tree-ssa/ctz-complement-int.c scan-tree-dump-times optimized 
"__builtin_ctz|.CTZ" 1
FAIL: gcc.dg/tree-ssa/ctz-complement-long.c scan-tree-dump-times optimized 
"__builtin_ctz|.CTZ" 1
FAIL: 

Re: [PATCH] c++: Don't set DECL_CONTEXT to nested template-template parameters [PR98881]

2024-03-06 Thread Jason Merrill

On 3/5/24 00:24, Nathaniel Shead wrote:

On Mon, Mar 04, 2024 at 10:07:33PM -0500, Patrick Palka wrote:

On Tue, 5 Mar 2024, Nathaniel Shead wrote:


On Mon, Mar 04, 2024 at 09:26:00PM -0500, Patrick Palka wrote:

On Tue, 5 Mar 2024, Nathaniel Shead wrote:


On Mon, Mar 04, 2024 at 07:14:54PM -0500, Patrick Palka wrote:

On Sat, 2 Mar 2024, Nathaniel Shead wrote:


Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk?

-- >8 --

When streaming in a nested template-template parameter as in the
attached testcase, we end up reaching the containing template-template
parameter in 'tpl_parms_fini'. We should not set the DECL_CONTEXT to
this (nested) template-template parameter, as it should already be the
struct that the outer template-template parameter is declared on.

PR c++/98881

gcc/cp/ChangeLog:

* module.cc (trees_out::tpl_parms_fini): Clarify logic purely
for checking purposes. Don't consider a template template
parameter as the owning template.
(trees_in::tpl_parms_fini): Don't consider a template template
parameter as the owning template.

gcc/testsuite/ChangeLog:

* g++.dg/modules/tpl-tpl-parm-3_a.H: New test.
* g++.dg/modules/tpl-tpl-parm-3_b.C: New test.

Signed-off-by: Nathaniel Shead 
---
  gcc/cp/module.cc| 17 -
  gcc/testsuite/g++.dg/modules/tpl-tpl-parm-3_a.H | 11 +++
  gcc/testsuite/g++.dg/modules/tpl-tpl-parm-3_b.C | 13 +
  3 files changed, 36 insertions(+), 5 deletions(-)
  create mode 100644 gcc/testsuite/g++.dg/modules/tpl-tpl-parm-3_a.H
  create mode 100644 gcc/testsuite/g++.dg/modules/tpl-tpl-parm-3_b.C

diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index 67f132d28d7..5663d01ed9c 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -10126,10 +10126,14 @@ trees_out::tpl_parms_fini (tree tmpl, unsigned 
tpl_levels)
  tree dflt = TREE_PURPOSE (parm);
  tree_node (dflt);
  
-	  if (streaming_p ())

+ if (CHECKING_P && streaming_p ())
{
+ /* Sanity check that the DECL_CONTEXT we'll infer when
+streaming in is correct.  */
  tree decl = TREE_VALUE (parm);
- if (TREE_CODE (decl) == TEMPLATE_DECL)
+ if (TREE_CODE (decl) == TEMPLATE_DECL
+ /* A template template parm is not the owning template.  */
+ && !DECL_TEMPLATE_TEMPLATE_PARM_P (tmpl))
{
  tree ctx = DECL_CONTEXT (decl);
  tree inner = DECL_TEMPLATE_RESULT (decl);
@@ -10164,8 +10168,13 @@ trees_in::tpl_parms_fini (tree tmpl, unsigned 
tpl_levels)
return false;
  TREE_PURPOSE (parm) = dflt;
  
+	  /* Original template template parms have a context

+of their owning template.  Reduced ones do not.
+But if TMPL is itself a template template parm
+then it cannot be the owning template.  */
  tree decl = TREE_VALUE (parm);
- if (TREE_CODE (decl) == TEMPLATE_DECL)
+ if (TREE_CODE (decl) == TEMPLATE_DECL
+ && !DECL_TEMPLATE_TEMPLATE_PARM_P (tmpl))


IIUC a TEMPLATE_DECL inside a template parameter list always represents
a template template parm, so won't this effectively disable the
DECL_CONTEXT setting logic?


This is only when 'tmpl' (i.e. the containing TEMPLATE_DECL that we're
streaming) is itself a template template parm.


D'oh, makes sense.




{
  tree inner = DECL_TEMPLATE_RESULT (decl);
  tree tpi = (TREE_CODE (inner) == TYPE_DECL
@@ -10173,8 +10182,6 @@ trees_in::tpl_parms_fini (tree tmpl, unsigned 
tpl_levels)
  : DECL_INITIAL (inner));
  bool original = (TEMPLATE_PARM_LEVEL (tpi)
   == TEMPLATE_PARM_ORIG_LEVEL (tpi));
- /* Original template template parms have a context
-of their owning template.  Reduced ones do not.  */
  if (original)
DECL_CONTEXT (decl) = tmpl;
}
diff --git a/gcc/testsuite/g++.dg/modules/tpl-tpl-parm-3_a.H 
b/gcc/testsuite/g++.dg/modules/tpl-tpl-parm-3_a.H
new file mode 100644
index 000..21bbc054fa3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/tpl-tpl-parm-3_a.H
@@ -0,0 +1,11 @@
+// PR c++/98881
+// { dg-additional-options "-fmodule-header" }
+// { dg-module-cmi {} }
+
+template  struct X {};
+
+template typename TT>
+struct X> {
+  template typename UU>
+  void f (X>&);
+};


I wonder why the partial specialization is relevant here?  I can't
seem to trigger the ICE without the partial specialization.
Slightly further reduced to not use bound ttps:

 template class TT>
 struct X { };

 template class TT> requires true
 struct X {
   template class UU>
   void f(X);
 };

Maybe the expectation is that tpl_parms_fini for UU should be called
with tpl_levels=1 (so that we stream only its own 

Re: [PATCH] c++/modules: inline namespace abi_tag streaming [PR110730]

2024-03-06 Thread Jason Merrill

On 3/6/24 14:10, Patrick Palka wrote:

Tested on x86_64-pc-linux-gnu, does this look OK for trunk?

-- >8 --

The unreduced testcase from this PR crashes at runtime ultimately
because we don't stream the abi_tag attribute on inline namespaces and
so the filesystem::current_path() call resolves to the non-C++11 ABI
version even though the C++11 ABI is active, leading to a crash when
destructing the call result (which contains an std::string member).

While we do stream the DECL_ATTRIBUTES of all decls that go through
the generic tree streaming routines, it seems namespaces are streamed
separately from other decls and we don't use the generic routines for
them.  So this patch makes us stream the abi_tag manually for (inline)
namespaces.


Why not stream all DECL_ATTRIBUTES of all namespaces?

Jason



[Bug libstdc++/114244] Need to use round when parsing fractional seconds

2024-03-06 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114244

--- Comment #5 from Jonathan Wakely  ---
Yup, that's what I have in my local tree now.

[PATCH v1] LoongArch: Fixed an issue with the implementation of the template atomic_compare_and_swapsi.

2024-03-06 Thread Lulu Cheng
If the hardware does not support LAMCAS, atomic_compare_and_swapsi needs to be
implemented through "ll.w+sc.w". In the implementation of the instruction 
sequence,
it is necessary to determine whether the two registers are equal.
Since LoongArch's comparison instructions do not distinguish between 32-bit
and 64-bit, the two operand registers that need to be compared are symbolically
extended, and one of the operand registers is obtained from memory through the
"ll.w" instruction, which can ensure that the symbolic expansion is carried out.
However, the value of the other operand register is not guaranteed to be the
value of the sign extension.

gcc/ChangeLog:

* config/loongarch/sync.md (atomic_cas_value_strong):
In loongarch64, a sign extension operation is added when
operands[2] is a register operand and the mode is SImode.

gcc/testsuite/ChangeLog:

* g++.target/loongarch/atomic-cas-int.C: New test.
---
 gcc/config/loongarch/sync.md  | 46 ++-
 .../g++.target/loongarch/atomic-cas-int.C | 32 +
 2 files changed, 67 insertions(+), 11 deletions(-)
 create mode 100644 gcc/testsuite/g++.target/loongarch/atomic-cas-int.C

diff --git a/gcc/config/loongarch/sync.md b/gcc/config/loongarch/sync.md
index 8f35a5b48d2..d41c2d26811 100644
--- a/gcc/config/loongarch/sync.md
+++ b/gcc/config/loongarch/sync.md
@@ -245,18 +245,42 @@ (define_insn "atomic_cas_value_strong"
(clobber (match_scratch:GPR 5 "="))]
   ""
 {
-  return "1:\\n\\t"
-"ll.\\t%0,%1\\n\\t"
-"bne\\t%0,%z2,2f\\n\\t"
-"or%i3\\t%5,$zero,%3\\n\\t"
-"sc.\\t%5,%1\\n\\t"
-"beqz\\t%5,1b\\n\\t"
-"b\\t3f\\n\\t"
-"2:\\n\\t"
-"%G4\\n\\t"
-"3:\\n\\t";
+  output_asm_insn ("1:", operands);
+  output_asm_insn ("ll.\t%0,%1", operands);
+
+  /* Like the test case atomic-cas-int.C, in loongarch64, O1 and higher, the
+ return value of the val_without_const_folding will not be truncated and
+ will be passed directly to the function compare_exchange_strong.
+ However, the instruction 'bne' does not distinguish between 32-bit and
+ 64-bit operations.  so if the upper 32 bits of the register are not
+ extended by the 32nd bit symbol, then the comparison may not be valid
+ here.  This will affect the result of the operation.  */
+
+  if (TARGET_64BIT && REG_P (operands[2])
+  && GET_MODE (operands[2]) == SImode)
+{
+  output_asm_insn ("addi.w\t%5,%2,0", operands);
+  output_asm_insn ("bne\t%0,%5,2f", operands);
+}
+  else
+output_asm_insn ("bne\t%0,%z2,2f", operands);
+
+  output_asm_insn ("or%i3\t%5,$zero,%3", operands);
+  output_asm_insn ("sc.\t%5,%1", operands);
+  output_asm_insn ("beqz\t%5,1b", operands);
+  output_asm_insn ("b\t3f", operands);
+  output_asm_insn ("2:", operands);
+  output_asm_insn ("%G4", operands);
+  output_asm_insn ("3:", operands);
+
+  return "";
 }
-  [(set (attr "length") (const_int 28))])
+  [(set (attr "length")
+ (if_then_else
+   (and (match_test "GET_MODE (operands[2]) == SImode")
+(match_test "REG_P (operands[2])"))
+   (const_int 32)
+   (const_int 28)))])
 
 (define_insn "atomic_cas_value_strong_amcas"
   [(set (match_operand:QHWD 0 "register_operand" "=")
diff --git a/gcc/testsuite/g++.target/loongarch/atomic-cas-int.C 
b/gcc/testsuite/g++.target/loongarch/atomic-cas-int.C
new file mode 100644
index 000..830ce48267a
--- /dev/null
+++ b/gcc/testsuite/g++.target/loongarch/atomic-cas-int.C
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+#include 
+#include 
+
+__attribute__ ((noinline)) long
+val_without_const_folding (long val)
+{
+  return val;
+}
+
+int
+main ()
+{
+  int oldval = 0xaa;
+  int newval = 0xbb;
+  std::atomic amo;
+
+  amo.store (oldval);
+
+  long longval = val_without_const_folding (0xff80 + oldval);
+  oldval = static_cast (longval);
+
+  amo.compare_exchange_strong (oldval, newval);
+
+  if (newval != amo.load (std::memory_order_relaxed))
+__builtin_abort ();
+
+  return 0;
+}
+
-- 
2.39.3



[Bug libstdc++/114244] Need to use round when parsing fractional seconds

2024-03-06 Thread howard.hinnant at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114244

--- Comment #4 from Howard Hinnant  ---
Not positive (because I don't know your code that well), but I think:

  __s = round<_Duration>(__fs);

will do it.

Results for 14.0.1 20240306 (experimental) [master r14-9337-g71aad523144] (GCC) testsuite on x86_64-pc-linux-gnu

2024-03-06 Thread H.J. Lu via Gcc-testresults
746 * 2
FAIL: gcc.dg/guality/pr78726.c   -Os  -DPREVENT_OPTIMIZATION  line 21 d3 == 
~36U * 1023094746
FAIL: gcc.dg/guality/pr78726.c   -Os  -DPREVENT_OPTIMIZATION  line 21 d6 == 
~36U * 1023094746 * 2
FAIL: gcc.dg/guality/pr78726.c  -Og -DPREVENT_OPTIMIZATION  line 21 d6 == ~36U 
* 1023094746 * 2
FAIL: gcc.dg/guality/pr89463.c   -O1  -DPREVENT_OPTIMIZATION  line 23 i + 1 == 7
FAIL: gcc.dg/guality/pr90074.c   -O1  -DPREVENT_OPTIMIZATION  line 28 c + 1 == 2
FAIL: gcc.dg/guality/pr90074.c   -O1  -DPREVENT_OPTIMIZATION  line 28 i + 1 == 8
FAIL: gcc.dg/guality/pr90074.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 28 c + 1 == 2
FAIL: gcc.dg/guality/pr90074.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 28 i + 1 == 8
FAIL: gcc.dg/guality/pr90716.c   -O1  -DPREVENT_OPTIMIZATION  line 23 j + 1 == 9
FAIL: gcc.dg/guality/pr90716.c   -O2  -DPREVENT_OPTIMIZATION  line 23 j + 1 == 9
FAIL: gcc.dg/guality/pr90716.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 23 j + 1 == 9
FAIL: gcc.dg/guality/pr90716.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 23 j + 1 == 9
FAIL: gcc.dg/guality/pr90716.c   -Os  -DPREVENT_OPTIMIZATION  line 23 j + 1 == 9
FAIL: gcc.dg/guality/sra-1.c   -O2  -DPREVENT_OPTIMIZATION  line 43 a.j == 14
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 43 a.j == 14
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 a.i == 4
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 a.j == 14
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 32 a[0] == 4
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 32 a[1] == 14
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 43 a.i == 4
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 43 a.j == 14
FAIL: gcc.dg/guality/sra-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 43 a.j == 14
FAIL: gcc.dg/guality/sra-1.c   -Os  -DPREVENT_OPTIMIZATION  line 43 a.j == 14
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 21 a.i == 4
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 21 a.j == 14
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 32 a[0] == 4
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 32 a[1] == 14
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 43 a.i == 4
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 43 a.j == 14
FAIL: gcc.dg/guality/vla-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 17 sizeof (a) == 6
XPASS: gcc.dg/tree-ssa/builtin-snprintf-6.c scan-tree-dump-times optimized 
"Function test_assign_aggregate" 1
FAIL: gcc.dg/tree-ssa/dump-6.c scan-tree-dump store-merging "MEM  
[(char *)] = "
FAIL: gcc.target/i386/bmi2-pr112526.c (test for excess errors)
FAIL: gcc.target/i386/bmi2-pr112526.c execution test
FAIL: gcc.target/i386/invariant-ternlog-1.c scan-assembler-times 
vpternlog[^nr]*(%rdx) 2
FAIL: gcc.target/i386/pr105854.c (test for excess errors)
FAIL: gcc.target/i386/pr112943.c (test for excess errors)
FAIL: gcc.target/i386/pr53533-1.c scan-assembler-times (?:addl|subl)[ \\t] 1
FAIL: gcc.target/i386/pr53533-3.c scan-assembler-times (?:addl|subl)[ \\t] 1
FAIL: gcc.target/i386/pr55583.c scan-assembler-times (?n)shld[ql]?[t 
]*\$2 2
FAIL: gcc.target/i386/pr55583.c scan-assembler-times (?n)shrd[ql]?[t 
]*\$2 4
FAIL: gcc.target/i386/pr89618-2.c scan-tree-dump vect "loop vectorized using 16 
byte vectors"
FAIL: gcc.target/i386/pr96539.c scan-assembler-not rep[^\\n\\r]*movs
FAIL: gcc.target/i386/pr97971.c  (test for errors, line 10)
FAIL: gcc.target/i386/shrink_wrap_1.c scan-rtl-dump pro_and_epilogue 
"Performing shrink-wrapping"

=== gcc Summary for unix/-mx32 ===

# of expected passes200200
# of unexpected failures152
# of unexpected successes   16
# of expected failures  1550
# of unsupported tests  3401

=== gcc Summary ===

# of expected passes600655
# of unexpected failures403
# of unexpected successes   59
# of expected failures  4657
# of unresolved testcases   2
# of unsupported tests  10710
/export/gnu/import/git/gcc-test-master-intel64/bld/gcc/xgcc  version 14.0.1 
20240306 (experimental) [master r14-9337-g71aad523144] (GCC) 

=== gfortran tests ===


Running target unix

=== gfortran Summary for unix ===

# of expected

Regressions on master at commit r14-9337 vs commit r14-9326 on Linux/x86_64

2024-03-06 Thread H.J. Lu via Gcc-regression
Regressions on master at commit r14-9337 vs commit r14-9326 on Linux/x86_64
New failures:
FAIL: gcc.dg/lto/save-temps c_lto_save-temps_0.o-c_lto_save-temps_0.o link,  -O 
-flto -save-temps
FAIL: gcc.dg/torture/convert-dfp-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  (test for excess errors)
FAIL: gcc.dg/torture/convert-dfp.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  (test for excess errors)

New passes:


[Bug libstdc++/114244] Need to use round when parsing fractional seconds

2024-03-06 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114244

--- Comment #3 from Jonathan Wakely  ---
(In reply to Jonathan Wakely from comment #1)
> Yup, the seconds part "00.002" is parsed using std::numpunct (in order to

Oops, std::num_get obviously.

> handle the locale's decimal point) and then converted to milliseconds using
> duration_cast:
> 
> auto& __ng = use_facet>(__loc);
> long double __val;
> ios_base::iostate __err2{};
> __ng.get(__buf, {}, __buf, __err2, __val);
> if (__is_failed(__err2)) [[unlikely]]
>   __err |= __err2;
> else
>   {
> duration __fs(__val);
> __s = duration_cast<_Duration>(__fs);
>   }

As an unrelated optimization, when the locale is "C" we could use
std::from_chars or std::stod instead of std::num_get.

[Bug libstdc++/114244] Need to use round when parsing fractional seconds

2024-03-06 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114244

--- Comment #2 from Jonathan Wakely  ---
(In reply to Jonathan Wakely from comment #1)
> and another duration_cast in chrono::from_stream for durations. That one
> could be used with either integral or floating-point reps.

Ah, but we're converting from common_type_t to Duration, so
either it's float-to-float or integer-to-integer, and duration_cast is OK if
we're fine with truncating.

[Bug target/114200] [14] RISC-V fixed-length vector miscompile at -O3

2024-03-06 Thread patrick at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114200

Patrick O'Neill  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Patrick O'Neill  ---
Thanks for the fix!
Once the other ICEs (pr114196, pr114195) get resolved I'll be able to turn on
the yarpgen fuzzer without getting overwhelmed with duplicates.
The failures from the existing csmith fuzzer are getting more rare :)

[Bug libstdc++/114244] Need to use round when parsing fractional seconds

2024-03-06 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114244

--- Comment #1 from Jonathan Wakely  ---
Yup, the seconds part "00.002" is parsed using std::numpunct (in order to
handle the locale's decimal point) and then converted to milliseconds using
duration_cast:

  auto& __ng = use_facet>(__loc);
  long double __val;
  ios_base::iostate __err2{};
  __ng.get(__buf, {}, __buf, __err2, __val);
  if (__is_failed(__err2)) [[unlikely]]
__err |= __err2;
  else
{
  duration __fs(__val);
  __s = duration_cast<_Duration>(__fs);
}


We also use duration_cast when parsing %c and %X using std::time_get, but
that's an integer conversion there (but the duration_cast should have been
qualified to prevent ADL):

  __h = hours(__tm.tm_hour);
  __min = minutes(__tm.tm_min);
  __s = duration_cast<_Duration>(seconds(__tm.tm_sec));

and another duration_cast in chrono::from_stream for durations. That one could
be used with either integral or floating-point reps.

Do we want to parse "00:00:31" as minutes(1)? I don't think we do, so only the
first case where converting long double to milliseconds should be rounded?

Results for 14.0.1 20240306 (experimental) [remotes/origin/HEAD r14-9346-g74e8cc28ed] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-03-06 Thread Bill Seurer (POWER9 IEEE128) via Gcc-testresults
-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 a.i == 4
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 a.j == 14
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 32 a[0] == 4
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 32 a[1] == 14
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 43 a.i == 4
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 43 a.j == 14
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 21 a.i == 4
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 21 a.j == 14
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 32 a[0] == 4
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 32 a[1] == 14
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 43 a.i == 4
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 43 a.j == 14
FAIL: gcc.dg/guality/vla-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 17 sizeof (a) == 6
FAIL: gcc.dg/guality/vla-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 25 sizeof (a) == 6 * sizeof 
(int)
FAIL: gcc.dg/torture/pr52451.c   -O0  execution test
FAIL: gcc.dg/torture/pr52451.c   -O1  execution test
FAIL: gcc.dg/torture/pr52451.c   -O2  execution test
FAIL: gcc.dg/torture/pr52451.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: gcc.dg/torture/pr52451.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: gcc.dg/torture/pr52451.c   -O3 -g  execution test
FAIL: gcc.dg/torture/pr52451.c   -Os  execution test
FAIL: gcc.dg/torture/pr91323.c   -O0  execution test
FAIL: gcc.dg/torture/pr91323.c   -O1  execution test
FAIL: gcc.dg/torture/pr91323.c   -O2  execution test
FAIL: gcc.dg/torture/pr91323.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: gcc.dg/torture/pr91323.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: gcc.dg/torture/pr91323.c   -O3 -g  execution test
FAIL: gcc.dg/torture/pr91323.c   -Os  execution test
FAIL: gcc.dg/tree-ssa/abs-4.c scan-tree-dump-times optimized "= -" 1
FAIL: gcc.dg/tree-ssa/abs-4.c scan-tree-dump-times optimized "= .COPYSIGN" 2
FAIL: gcc.dg/tree-ssa/abs-4.c scan-tree-dump-times optimized "= ABS_EXPR" 1
FAIL: gcc.dg/tree-ssa/backprop-6.c scan-tree-dump-times backprop 
"Deleting[^n]* = -" 4
FAIL: gcc.dg/tree-ssa/backprop-6.c scan-tree-dump-times backprop 
"Deleting[^n]* = ABS_EXPR <" 1
FAIL: gcc.dg/tree-ssa/backprop-6.c scan-tree-dump-times backprop 
"Deleting[^n]* = .COPYSIGN" 2
FAIL: gcc.dg/tree-ssa/copy-headers-8.c scan-tree-dump-times ch2 "Conditional 
combines static and invariant" 1
FAIL: gcc.dg/tree-ssa/copy-headers-8.c scan-tree-dump-times ch2 "Will duplicate 
bb" 2
XPASS: gcc.dg/tree-ssa/ssa-dom-cse-2.c scan-tree-dump optimized "return 28;"
FAIL: gcc.dg/tree-ssa/update-threading.c scan-tree-dump-times optimized 
"Invalid sum" 0
FAIL: gcc.dg/vect/vect-117.c -flto -ffat-lto-objects  scan-tree-dump-not 
optimized "Invalid sum"
FAIL: gcc.dg/vect/vect-117.c scan-tree-dump-not optimized "Invalid sum"
FAIL: gcc.target/powerpc/pr105334.c (test for excess errors)
FAIL: gcc.target/powerpc/rlwimi-2.c scan-assembler-times (?n)^s+[a-z] 20217
XPASS: gcc.target/powerpc/ppc-fortran/ieee128-math.f90   -O  (test for excess 
errors)

=== gcc Summary ===

# of expected passes178997
# of unexpected failures116
# of unexpected successes   19
# of expected failures      1614
# of unsupported tests  4171
/home/gccbuild/build/nightly/build-gcc-trunk/gcc/xgcc  version 14.0.1 20240306 
(experimental) [remotes/origin/HEAD r14-9346-g74e8cc28ed] (GCC) 

=== gfortran tests ===


Running target unix
XPASS: gfortran.dg/default_format_2.f90   -O0  execution test
XPASS: gfortran.dg/default_format_2.f90   -O1  execution test
XPASS: gfortran.dg/default_format_2.f90   -O2  execution test
XPASS: gfortran.dg/default_format_2.f90   -O3 -fomit-frame-pointer 
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
XPASS: gfortran.dg/default_format_2.f90   -O3 -g  execution test
XPASS: gfortran.dg/default_format_2.f90   -Os  execution test
XPASS: gfortran.dg/default_format_denormal_2.f90   -O0  execution test
XPASS: gfortran.dg/default_format_denormal_2.f90   -O1  execution test
XPASS: gfortran.dg/default_format_denormal_2.f90   -O2  execution test
XPASS: gfortran.dg/default_format_denormal_2.f90   -O3 -fomit-frame-pointer 
-funroll-loops -fpeel-loops -ftracer -fin

[Linaro-TCWG-CI] gcc-14-9343-gb575f37a342: FAIL: 6 regressions on arm

2024-03-06 Thread ci_notify--- via Gcc-regression
Dear contributor, our automatic CI has detected problems related to your 
patch(es).  Please find some details below.  If you have any questions, please 
follow up on linaro-toolch...@lists.linaro.org mailing list, Libera's 
#linaro-tcwg channel, or ping your favourite Linaro toolchain developer on the 
usual project channel.

We appreciate that it might be difficult to find the necessary logs or 
reproduce the issue locally. If you can't get what you need from our CI within 
minutes, let us know and we will be happy to help.

We track this report status in https://linaro.atlassian.net/browse/GNU-1171 , 
please let us know if you are looking at the problem and/or when you have a fix.

In gcc_check master-arm after:

  | commit gcc-14-9343-gb575f37a342
  | Author: Wilco Dijkstra 
  | Date:   Wed Mar 6 17:35:16 2024 +
  | 
  | ARM: Fix conditional execution [PR113915]
  | 
  | By default most patterns can be conditionalized on Arm targets.  However
  | Thumb-2 predication requires the "predicable" attribute be explicitly
  | set to "yes".  Most patterns are shared between Arm and Thumb(-2) and 
are
  | marked with "predicable".  Given this sharing, it does not make sense to
  | use a different default for Arm.  So only consider conditional execution
  | ... 14 lines of the commit log omitted.

FAIL: 6 regressions

regressions.sum:
=== gcc tests ===

Running gcc:gcc.target/arm/arm.exp ...
FAIL: gcc.target/arm/builtin-bswap-1.c scan-assembler-times rev16\\t 1
FAIL: gcc.target/arm/builtin-bswap-1.c scan-assembler-times rev16ne\\t 1
FAIL: gcc.target/arm/builtin-bswap-1.c scan-assembler-times rev\\t 2
FAIL: gcc.target/arm/builtin-bswap-1.c scan-assembler-times revne\\t 2
FAIL: gcc.target/arm/builtin-bswap-1.c scan-assembler-times revsh\\t 1
FAIL: gcc.target/arm/builtin-bswap-1.c scan-assembler-times revshne\\t 1


You can find the failure logs in *.log.1.xz files in
 - 
https://ci.linaro.org/job/tcwg_gcc_check--master-arm-build/1807/artifact/artifacts/00-sumfiles/
The full lists of regressions and progressions as well as configure and make 
commands are in
 - 
https://ci.linaro.org/job/tcwg_gcc_check--master-arm-build/1807/artifact/artifacts/notify/
The list of [ignored] baseline and flaky failures are in
 - 
https://ci.linaro.org/job/tcwg_gcc_check--master-arm-build/1807/artifact/artifacts/sumfiles/xfails.xfail

The configuration of this build is:
CI config tcwg_gcc_check master-arm

-8<--8<--8<--
The information below can be used to reproduce a debug environment:

Current build   : 
https://ci.linaro.org/job/tcwg_gcc_check--master-arm-build/1807/artifact/artifacts
Reference build : 
https://ci.linaro.org/job/tcwg_gcc_check--master-arm-build/1806/artifact/artifacts

Reproduce last good and first bad builds: 
https://git-us.linaro.org/toolchain/ci/interesting-commits.git/plain/gcc/sha1/b575f37a342cebb954aa85fa45df0604bfa1ada9/tcwg_gcc_check/master-arm/reproduction_instructions.txt

Full commit : 
https://github.com/gcc-mirror/gcc/commit/b575f37a342cebb954aa85fa45df0604bfa1ada9

List of configurations that regressed due to this commit :
* tcwg_gcc_check
** master-arm
*** FAIL: 6 regressions
*** 
https://git-us.linaro.org/toolchain/ci/interesting-commits.git/plain/gcc/sha1/b575f37a342cebb954aa85fa45df0604bfa1ada9/tcwg_gcc_check/master-arm/details.txt
*** 
https://ci.linaro.org/job/tcwg_gcc_check--master-arm-build/1807/artifact/artifacts


[Bug libstdc++/114240] sys_days not being parsed with only a date in the stream

2024-03-06 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114240

--- Comment #5 from Jonathan Wakely  ---
>using __format::_ChronoParts;
>auto __need = _ChronoParts::_Year | _ChronoParts::_Month
> -   | _ChronoParts::_Day | _ChronoParts::_TimeOfDay;
> +   | _ChronoParts::_Day;
> +  if constexpr (ratio_less_v)
> +   __need |= _ChronoParts::_TimeOfDay;

This condition's not right.

If we have a period of days, but a floating-point rep, we probably do want to
parse and use a time if one is present in the input. "2024-03-07 00:05" can be
represented by sys_time> and is not the same
time as "2024-03-07".

And if we have a period like ratio then it's greater
than days, but not using the time of day in the result will lose accuracy.

I'm leaning towards Howard's approach of just assuming 00:00:00 if no time is
present, rather than making it depend on the period in any way.

Results for 13.2.1 20240306 [releases/gcc-13 r13-8407-g1f5787e4b8] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-03-06 Thread Bill Seurer (POWER9) via Gcc-testresults
  -DPREVENT_OPTIMIZATION line 16 y == 2
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 y == 2
FAIL: gcc.dg/guality/pr68860-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 y == 
2
FAIL: gcc.dg/guality/pr68860-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 y == 2
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 21 a.i == 4
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 21 a.j == 14
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 32 a[0] == 4
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 32 a[1] == 14
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 43 a.i == 4
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 43 a.j == 14
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 a.i == 4
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 a.j == 14
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 32 a[0] == 4
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 32 a[1] == 14
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 43 a.i == 4
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 43 a.j == 14
FAIL: gcc.dg/guality/vla-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 25 sizeof (a) == 6 * sizeof 
(int)
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O0  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O1  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O2  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O3 -g  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -Os  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: gcc.dg/torture/pr52451.c   -O0  execution test
FAIL: gcc.dg/torture/pr52451.c   -O1  execution test
FAIL: gcc.dg/torture/pr52451.c   -O2  execution test
FAIL: gcc.dg/torture/pr52451.c   -O3 -g  execution test
FAIL: gcc.dg/torture/pr52451.c   -Os  execution test
FAIL: gcc.dg/torture/pr52451.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: gcc.dg/torture/pr52451.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: gcc.dg/torture/pr91323.c   -O0  execution test
FAIL: gcc.dg/torture/pr91323.c   -O1  execution test
FAIL: gcc.dg/torture/pr91323.c   -O2  execution test
FAIL: gcc.dg/torture/pr91323.c   -O3 -g  execution test
FAIL: gcc.dg/torture/pr91323.c   -Os  execution test
FAIL: gcc.dg/torture/pr91323.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: gcc.dg/torture/pr91323.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
XPASS: gcc.dg/tree-ssa/ssa-dom-cse-2.c scan-tree-dump optimized "return 28;"
FAIL: gcc.target/powerpc/rlwimi-2.c scan-assembler-times (?n)^s+[a-z] 20217
FAIL: gcc.target/powerpc/rs6000-fpint.c scan-assembler-not stfiwx
XPASS: gcc.target/powerpc/ppc-fortran/ieee128-math.f90   -O  (test for excess 
errors)

=== gcc Summary ===

# of expected passes169697
# of unexpected failures115
# of unexpected successes   23
# of expected failures  1560
# of unsupported tests  3195
/home/gccbuild/build/nightly/build-gcc-13/gcc/xgcc  version 13.2.1 20240306 
[releases/gcc-13 r13-8407-g1f5787e4b8] (GCC) 

=== gfortran tests ===


Running target unix
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O0  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O1  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O2  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O3 -fomit-frame-pointer 
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O3 -g  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -Os  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O0  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O1  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O2  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O3 -fomit-frame-pointer -funroll-loops 
-fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O3 -g  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -Os  execution test

=== gfortran Summary ===

# of expected passes68041
# of unexpected failure

[Bug c++/106851] [modules] Name conflict for exported using-declaration

2024-03-06 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106851

--- Comment #6 from Jonathan Wakely  ---
Excellent! Thanks for the fix.

Re: [PATCH] c-family, c++, v2: Fix up handling of types which may have padding in __atomic_{compare_}exchange

2024-03-06 Thread Jason Merrill

On 2/20/24 05:02, Jakub Jelinek wrote:

On Tue, Feb 20, 2024 at 09:01:10AM +0100, Richard Biener wrote:

I'm not sure those would be really equivalent (MEM_REF vs. V_C_E
as well as combined vs. split).  It really depends how RTL expansion
handles this (as you can see padding can be fun here).

So I'd be nervous for a match.pd rule here (also we can't match
memory defs).


Ok.  Perhaps forwprop then; anyway, that would be an optimization.


As for your patch I'd go with a MEM_REF unconditionally, I don't
think we want different behavior whether there's padding or not ...


I've made it conditional so that the MEM_REFs don't appear that often in the
FE trees, but maybe that is fine.

The unconditional patch would then be:


OK.


2024-02-20  Jakub Jelinek  

gcc/c-family/
* c-common.cc (resolve_overloaded_atomic_exchange): Instead of setting
p1 to VIEW_CONVERT_EXPR (*p1), set it to MEM_REF with p1 and
(typeof (p1)) 0 operands and I_type type.
(resolve_overloaded_atomic_compare_exchange): Similarly for p2.
gcc/cp/
* pt.cc (tsubst_expr): Handle MEM_REF.
gcc/testsuite/
* g++.dg/ext/atomic-5.C: New test.

--- gcc/c-family/c-common.cc.jj 2024-02-17 16:40:42.831571693 +0100
+++ gcc/c-family/c-common.cc2024-02-20 10:58:56.599865656 +0100
@@ -7793,9 +7793,14 @@ resolve_overloaded_atomic_exchange (loca
/* Convert object pointer to required type.  */
p0 = build1 (VIEW_CONVERT_EXPR, I_type_ptr, p0);
(*params)[0] = p0;
-  /* Convert new value to required type, and dereference it.  */
-  p1 = build_indirect_ref (loc, p1, RO_UNARY_STAR);
-  p1 = build1 (VIEW_CONVERT_EXPR, I_type, p1);
+  /* Convert new value to required type, and dereference it.
+ If *p1 type can have padding or may involve floating point which
+ could e.g. be promoted to wider precision and demoted afterwards,
+ state of padding bits might not be preserved.  */
+  build_indirect_ref (loc, p1, RO_UNARY_STAR);
+  p1 = build2_loc (loc, MEM_REF, I_type,
+  build1 (VIEW_CONVERT_EXPR, I_type_ptr, p1),
+  build_zero_cst (TREE_TYPE (p1)));
(*params)[1] = p1;
  
/* Move memory model to the 3rd position, and end param list.  */

@@ -7873,9 +7878,14 @@ resolve_overloaded_atomic_compare_exchan
p1 = build1 (VIEW_CONVERT_EXPR, I_type_ptr, p1);
(*params)[1] = p1;
  
-  /* Convert desired value to required type, and dereference it.  */

-  p2 = build_indirect_ref (loc, p2, RO_UNARY_STAR);
-  p2 = build1 (VIEW_CONVERT_EXPR, I_type, p2);
+  /* Convert desired value to required type, and dereference it.
+ If *p2 type can have padding or may involve floating point which
+ could e.g. be promoted to wider precision and demoted afterwards,
+ state of padding bits might not be preserved.  */
+  build_indirect_ref (loc, p2, RO_UNARY_STAR);
+  p2 = build2_loc (loc, MEM_REF, I_type,
+  build1 (VIEW_CONVERT_EXPR, I_type_ptr, p2),
+  build_zero_cst (TREE_TYPE (p2)));
(*params)[2] = p2;
  
/* The rest of the parameters are fine. NULL means no special return value

--- gcc/cp/pt.cc.jj 2024-02-17 16:40:42.868571182 +0100
+++ gcc/cp/pt.cc2024-02-20 10:57:36.646973603 +0100
@@ -20088,6 +20088,14 @@ tsubst_expr (tree t, tree args, tsubst_f
RETURN (r);
}
  
+case MEM_REF:

+  {
+   tree op0 = RECUR (TREE_OPERAND (t, 0));
+   tree op1 = RECUR (TREE_OPERAND (t, 0));
+   tree new_type = tsubst (TREE_TYPE (t), args, complain, in_decl);
+   RETURN (build2_loc (EXPR_LOCATION (t), MEM_REF, new_type, op0, op1));
+  }
+
  case NOP_EXPR:
{
tree type = tsubst (TREE_TYPE (t), args, complain, in_decl);
--- gcc/testsuite/g++.dg/ext/atomic-5.C.jj  2024-02-20 10:57:36.647973589 
+0100
+++ gcc/testsuite/g++.dg/ext/atomic-5.C 2024-02-20 10:57:36.647973589 +0100
@@ -0,0 +1,42 @@
+// { dg-do compile { target c++14 } }
+
+template 
+void
+foo (long double *ptr, long double *val, long double *ret)
+{
+  __atomic_exchange (ptr, val, ret, __ATOMIC_RELAXED);
+}
+
+template 
+bool
+bar (long double *ptr, long double *exp, long double *des)
+{
+  return __atomic_compare_exchange (ptr, exp, des, false,
+   __ATOMIC_RELAXED, __ATOMIC_RELAXED);
+}
+
+bool
+baz (long double *p, long double *q, long double *r)
+{
+  foo<0> (p, q, r);
+  foo<1> (p + 1, q + 1, r + 1);
+  return bar<0> (p + 2, q + 2, r + 2) || bar<1> (p + 3, q + 3, r + 3);
+}
+
+constexpr int
+qux (long double *ptr, long double *val, long double *ret)
+{
+  __atomic_exchange (ptr, val, ret, __ATOMIC_RELAXED);
+  return 0;
+}
+
+constexpr bool
+corge (long double *ptr, long double *exp, long double *des)
+{
+  return __atomic_compare_exchange (ptr, exp, des, false,
+   __ATOMIC_RELAXED, __ATOMIC_RELAXED);
+}
+
+long double a[6];
+const int b = qux (a, a + 1, a + 2);
+const bool c = corge (a + 3, a + 4, a + 5);


Jakub





[Bug c++/106851] [modules] Name conflict for exported using-declaration

2024-03-06 Thread nshead at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106851

--- Comment #5 from Nathaniel Shead  ---
(In reply to Jonathan Wakely from comment #4)
> I tried doing it this way instead
> 
> namespace std {
>   export using std::vector;
>   namespace pmr {
> export using std::vector;
>   }
> }
> 
> but that didn't work, nothing got exported. But maybe that will be fixed by
> Nathaniel's https://gcc.gnu.org/pipermail/gcc-patches/2024-March/647088.html

Yup, looks to be this issue. This is merged into trunk now and with a quick
test appears to work: https://godbolt.org/z/T5zPfPGro

[Bug libstdc++/114260] New: std::formatter> formats as the previous day

2024-03-06 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114260

Bug ID: 114260
   Summary: std::formatter> formats as the previous day
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

We give surprising output for std::formatter>:

#include 
#include 
#include 

using namespace std::chrono;

int main(){
  auto sdays = std::chrono::sys_days(2024y/March/5);
  auto udays = std::chrono::utc_clock::from_sys(sdays);
  std::cout << udays << '\n';
  std::cout << round(udays) << '\n';
}

This prints:

2024-03-05 00:00:00
2024-03-04 23:59:33

This happens because formatter> subtracts leap seconds
to get a sys_time (and checks to see whether we need to format the seconds as
"60") and then formats that result using formatter. The
result has a higher precision than utc_time and is no longer the
"correct" day.

I think we want to use chrono::round after subtracting leap seconds, to get
back to the original resolution. Otherwise we're formatting a sys_time that
differs from the supplied utc_time by less than that time's minimum tick.

So:

--- a/libstdc++-v3/include/bits/chrono_io.h
+++ b/libstdc++-v3/include/bits/chrono_io.h
@@ -2067,7 +2067,7 @@ namespace __format
  const auto __li = chrono::get_leap_second_info(__t);
  sys_time<_CDur> __s{__t.time_since_epoch() - __li.elapsed};
  if (!__li.is_leap_second) [[likely]]
-   return _M_f._M_format(__s, __fc);
+   return _M_f._M_format(chrono::round<_Duration>(__s), __fc);
  else
return _M_f._M_format(__utc_leap_second(__s), __fc);
}



Or maybe not even subtract leap seconds at all when the the sum of elapsed leap
seconds is less than Duration{1}? If the time being formatted can't represent
the number of elapsed leap seconds, is it meaningful to say the time falls
within a leap second? For the first ever leap second, yes it is:

clock_cast(sys_days{July/1/1972} - 500ms) + 500ms
-> 1972-06-30 23:59:60.000
round(clock_cast(sys_days{July/1/1972} - 500ms) + 500ms)
-> 1972-06-30 23:59:60

But for every leap second after that (and all future ones, unless the sum of
positive and negative leap seconds becomes a multiple of 60 again) rounding a
sys_time to utc_time cannot fall within a leap second and so doesn't
need to print "60" for the seconds:

clock_cast(sys_days{January/1/1973} - 500ms) + 500ms
-> 1972-12-31 23:59:60.000
round(clock_cast(sys_days{January/1/1973} - 500ms) + 500ms)
-> 1972-12-31 23:59:59 (with current GCC trunk, so not rounded to minutes)
-> 1973-01-01 00:00:00 (with the patch above to round to minutes)

The 23:59:59 result is not useful, it's neither a leap second like 23:59:60,
nor a round number of minutes like 00:00:00. I think we should format it as
00:00:00, which we could do by not subtracting the leap seconds at all.

Maybe we could do:

if (auto li = get_leap_second_info(ut); !li.is_leap_second && li.elapsed <
Duration{1})
  _M_format(sys_time(ut.time_since_epoch()), fc);
else if (!li.is_leap_second)
  _M_format(round(sys_time(ut.time_since_epoch()) -
li.elapsed), fc);
else
  // ...

But I don't think that's necessary, just round should give the
desired result. Avoiding the subtraction doesn't seem like a useful
optimization (especially as we'd still have done the much slower
get_leap_second_info lookup anyway).

CC Howard to check I'm not talking nonsense.

Results for 13.2.1 20240306 [releases/gcc-13 r13-8407-g1f5787e4b8] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-03-06 Thread Bill Seurer (POWER8) via Gcc-testresults
/pr54693-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 21 y == 
20 - 2 * i
FAIL: gcc.dg/guality/pr56154-1.c  -Og -DPREVENT_OPTIMIZATION  line 
pr56154-1.c:20 x.a == 6
FAIL: gcc.dg/guality/pr59776.c  -Og -DPREVENT_OPTIMIZATION  line pr59776.c:17 
s1.f == 5.0
FAIL: gcc.dg/guality/pr59776.c  -Og -DPREVENT_OPTIMIZATION  line pr59776.c:17 
s1.g == 6.0
FAIL: gcc.dg/guality/pr59776.c  -Og -DPREVENT_OPTIMIZATION  line pr59776.c:17 
s2.f == 0.0
FAIL: gcc.dg/guality/pr59776.c  -Og -DPREVENT_OPTIMIZATION  line pr59776.c:20 
s1.f == 5.0
FAIL: gcc.dg/guality/pr59776.c  -Og -DPREVENT_OPTIMIZATION  line pr59776.c:20 
s1.g == 6.0
FAIL: gcc.dg/guality/pr59776.c  -Og -DPREVENT_OPTIMIZATION  line pr59776.c:20 
s2.f == 5.0
FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 16 y == 2
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 16 y == 2
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 y == 2
FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 y == 
2
FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 16 y == 2
FAIL: gcc.dg/guality/pr68860-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 16 y == 2
FAIL: gcc.dg/guality/pr68860-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 y == 
2
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 a.i == 4
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 a.j == 14
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 32 a[0] == 4
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 32 a[1] == 14
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 43 a.i == 4
FAIL: gcc.dg/guality/sra-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 43 a.j == 14
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 21 a.i == 4
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 21 a.j == 14
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 32 a[0] == 4
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 32 a[1] == 14
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 43 a.i == 4
FAIL: gcc.dg/guality/sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 43 a.j == 14
FAIL: gcc.dg/torture/pr52451.c   -O0  execution test
FAIL: gcc.dg/torture/pr52451.c   -O1  execution test
FAIL: gcc.dg/torture/pr52451.c   -O2  execution test
FAIL: gcc.dg/torture/pr52451.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: gcc.dg/torture/pr52451.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: gcc.dg/torture/pr52451.c   -O3 -g  execution test
FAIL: gcc.dg/torture/pr52451.c   -Os  execution test
FAIL: gcc.dg/torture/pr91323.c   -O0  execution test
FAIL: gcc.dg/torture/pr91323.c   -O1  execution test
FAIL: gcc.dg/torture/pr91323.c   -O2  execution test
FAIL: gcc.dg/torture/pr91323.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
FAIL: gcc.dg/torture/pr91323.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: gcc.dg/torture/pr91323.c   -O3 -g  execution test
FAIL: gcc.dg/torture/pr91323.c   -Os  execution test
XPASS: gcc.dg/tree-ssa/ssa-dom-cse-2.c scan-tree-dump optimized "return 28;"
FAIL: gcc.target/powerpc/pr105586.c (test for excess errors)
FAIL: gcc.target/powerpc/rlwimi-2.c scan-assembler-times (?n)^s+[a-z] 20217
FAIL: gcc.target/powerpc/rs6000-fpint.c scan-assembler-not stfiwx
XPASS: gcc.target/powerpc/ppc-fortran/ieee128-math.f90   -O  (test for excess 
errors)

=== gcc Summary ===

# of expected passes168683
# of unexpected failures128
# of unexpected successes   16
# of expected failures  1550
# of unsupported tests  3982
/home/gccbuild/build/nightly/build-gcc-13/gcc/xgcc  version 13.2.1 20240306 
[releases/gcc-13 r13-8407-g1f5787e4b8] (GCC) 

=== gfortran tests ===


Running target unix
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O0  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O1  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O2  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O3 -fomit-frame-pointer 
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O3 -g  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -Os  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O0  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O1  execution test
FAIL: gfortran.dg/ieee/large_2

Re: [PATCH] dwarf2out, v3: Emit DW_AT_export_symbols on anon unions/structs [PR113918]

2024-03-06 Thread Jason Merrill

On 2/16/24 16:06, Jakub Jelinek wrote:

On Fri, Feb 16, 2024 at 03:40:39PM -0500, Jason Merrill wrote:

--- gcc/cp/cp-objcp-common.cc.jj2024-02-13 12:50:21.666846296 +0100
+++ gcc/cp/cp-objcp-common.cc   2024-02-16 20:40:51.374763528 +0100
@@ -410,6 +410,15 @@ cp_type_dwarf_attribute (const_tree type
return 1;
 break;
+case DW_AT_export_symbols:


For C++ this can use ANON_AGGR_TYPE_P, so it doesn't need to involve the
FIELD_DECL at all.  But I suppose the C front-end doesn't have a similar
flag?


Yes, using ANON_AGGR_TYPE_P there works for C++, but C doesn't have anything
like that.  All it uses is DECL_NAME == NULL on FIELD_DECL +
RECORD_OR_UNION_TYPE_P on its type to determine anon struct/union.

The patch below has updated cp_type_dwarf_attribute, otherwise the same as
before.


OK.


2024-02-16  Jakub Jelinek  

PR debug/113918
gcc/
* dwarf2out.cc (gen_field_die): Emit DW_AT_export_symbols
on anonymous unions or structs for -gdwarf-5 or -gno-strict-dwarf.
gcc/c/
* c-tree.h (c_type_dwarf_attribute): Declare.
* c-objc-common.h (LANG_HOOKS_TYPE_DWARF_ATTRIBUTE): Redefine.
* c-objc-common.cc: Include dwarf2.h.
(c_type_dwarf_attribute): New function.
gcc/cp/
* cp-objcp-common.cc (cp_type_dwarf_attribute): Return 1
for DW_AT_export_symbols on anonymous structs or unions.
gcc/testsuite/
* c-c++-common/dwarf2/pr113918.c: New test.

--- gcc/dwarf2out.cc.jj 2024-02-15 13:54:29.284358101 +0100
+++ gcc/dwarf2out.cc2024-02-16 20:38:19.718841259 +0100
@@ -25153,6 +25153,17 @@ gen_field_die (tree decl, struct vlr_con
  
add_accessibility_attribute (decl_die, decl);
  
+  /* Add DW_AT_export_symbols to anonymous unions or structs.  */

+  if ((dwarf_version >= 5 || !dwarf_strict) && DECL_NAME (decl) == NULL_TREE)
+if (tree type = member_declared_type (decl))
+  if (lang_hooks.types.type_dwarf_attribute (TYPE_MAIN_VARIANT (type),
+DW_AT_export_symbols) != -1)
+   {
+ dw_die_ref type_die = lookup_type_die (TYPE_MAIN_VARIANT (type));
+ if (type_die && get_AT (type_die, DW_AT_export_symbols) == NULL)
+   add_AT_flag (type_die, DW_AT_export_symbols, 1);
+   }
+
/* Equate decl number to die, so that we can look up this decl later on.  */
equate_decl_number_to_die (decl, decl_die);
  }
--- gcc/c/c-tree.h.jj   2024-01-31 10:46:35.164761720 +0100
+++ gcc/c/c-tree.h  2024-02-16 20:43:45.993372908 +0100
@@ -731,6 +731,7 @@ extern bool c_warn_unused_global_decl (c
  extern void c_initialize_diagnostics (diagnostic_context *);
  extern bool c_var_mod_p (tree x, tree fn);
  extern alias_set_type c_get_alias_set (tree);
+extern int c_type_dwarf_attribute (const_tree, int);
  
  /* in c-typeck.cc */

  extern int in_alignof;
--- gcc/c/c-objc-common.h.jj2024-01-03 12:06:52.973862999 +0100
+++ gcc/c/c-objc-common.h   2024-02-16 20:42:21.073535465 +0100
@@ -119,6 +119,9 @@ static const scoped_attribute_specs *con
  #undef LANG_HOOKS_GIMPLIFY_EXPR
  #define LANG_HOOKS_GIMPLIFY_EXPR c_gimplify_expr
  
+#undef LANG_HOOKS_TYPE_DWARF_ATTRIBUTE

+#define LANG_HOOKS_TYPE_DWARF_ATTRIBUTE c_type_dwarf_attribute
+
  #undef LANG_HOOKS_OMP_PREDETERMINED_SHARING
  #define LANG_HOOKS_OMP_PREDETERMINED_SHARING c_omp_predetermined_sharing
  
--- gcc/c/c-objc-common.cc.jj	2024-01-03 12:06:53.213859637 +0100

+++ gcc/c/c-objc-common.cc  2024-02-16 20:45:24.649022305 +0100
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3.
  #include "gcc-rich-location.h"
  #include "stringpool.h"
  #include "attribs.h"
+#include "dwarf2.h"
  
  static bool c_tree_printer (pretty_printer *, text_info *, const char *,

int, bool, bool, bool, bool *, const char **);
@@ -446,3 +447,25 @@ instantiation_dependent_expression_p (tr
  {
return false;
  }
+
+/* Return -1 if dwarf ATTR shouldn't be added for TYPE, or the attribute
+   value otherwise.  */
+int
+c_type_dwarf_attribute (const_tree type, int attr)
+{
+  if (type == NULL_TREE)
+return -1;
+
+  switch (attr)
+{
+case DW_AT_export_symbols:
+  if (RECORD_OR_UNION_TYPE_P (type) && TYPE_NAME (type) == NULL_TREE)
+   return 1;
+  break;
+
+default:
+  break;
+}
+
+  return -1;
+}
--- gcc/cp/cp-objcp-common.cc.jj2024-02-13 12:50:21.666846296 +0100
+++ gcc/cp/cp-objcp-common.cc   2024-02-16 21:48:33.880458318 +0100
@@ -410,6 +410,11 @@ cp_type_dwarf_attribute (const_tree type
return 1;
break;
  
+case DW_AT_export_symbols:

+  if (ANON_AGGR_TYPE_P (type))
+   return 1;
+  break;
+
  default:
break;
  }
--- gcc/testsuite/c-c++-common/dwarf2/pr113918.c.jj 2024-02-16 
20:27:13.996961811 +0100
+++ gcc/testsuite/c-c++-common/dwarf2/pr113918.c2024-02-16 
20:27:13.996961811 +0100
@@ -0,0 +1,33 @@
+/* PR debug/113918 */
+/* { dg-do compile } */
+/* { dg-options 

Re: [PATCH] c++: Fix up parameter pack diagnostics on xobj vs. varargs functions [PR113802]

2024-03-06 Thread Jason Merrill

On 2/16/24 17:15, Jakub Jelinek wrote:

On Fri, Feb 16, 2024 at 10:47:47PM +0100, Jakub Jelinek wrote:

The following patch works.


Or yet another option would be instead of (sometimes) clearing
declarator->parameter_pack_p when we diagnose this bug for error
recovery ignore the this specifier.


Let's go with this one.  OK.


With the following patch (testsuite patch remains the same),
I get excess errors though:
/usr/src/gcc/gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics3.C:30:25: 
error: expansion pattern 'Selves' contains no parameter packs
/usr/src/gcc/gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics3.C:42:26: 
error: expansion pattern 'Selves' contains no parameter packs
/usr/src/gcc/gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics3.C:56:26: error: 
expansion pattern 'Selves&' contains no parameter packs
/usr/src/gcc/gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics3.C:68:27: error: 
expansion pattern 'Selves&' contains no parameter packs
/usr/src/gcc/gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics3.C:82:27: error: 
expansion pattern 'Selves&&' contains no parameter packs
/usr/src/gcc/gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics3.C:94:28: error: 
expansion pattern 'Selves&&' contains no parameter packs
/usr/src/gcc/gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics3.C:108:32: error: 
expansion pattern 'const Selves&' contains no parameter packs
/usr/src/gcc/gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics3.C:120:33: error: 
expansion pattern 'const Selves&' contains no parameter packs
/usr/src/gcc/gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics3.C:134:33: error: 
expansion pattern 'const Selves&&' contains no parameter packs
/usr/src/gcc/gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics3.C:146:34: error: 
expansion pattern 'const Selves&&' contains no parameter packs
though, that is e.g. on
struct S0 {
   template
   void g(this Selves... selves) {}  // { dg-error "an explicit object parameter 
cannot be a function parameter pack" }
}
where such an extra error would have been emitted if the this keyword was
omitted.

--- gcc/cp/parser.cc.jj 2024-02-16 17:38:27.802845433 +0100
+++ gcc/cp/parser.cc2024-02-16 23:08:40.835437740 +0100
@@ -25734,22 +25734,6 @@ cp_parser_parameter_declaration (cp_pars
decl_specifiers.locations[ds_this] = 0;
  }
  
-  if (xobj_param_p

-  && ((declarator && declarator->parameter_pack_p)
- || cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS)))
-{
-  location_t xobj_param
-   = make_location (decl_specifiers.locations[ds_this],
-decl_spec_token_start->location,
-input_location);
-  error_at (xobj_param,
-   "an explicit object parameter cannot "
-   "be a function parameter pack");
-  /* Suppress errors that occur down the line.  */
-  if (declarator)
-   declarator->parameter_pack_p = false;
-}
-
/* If a function parameter pack was specified and an implicit template
   parameter was introduced during cp_parser_parameter_declaration,
   change any implicit parameters introduced into packs.  */
@@ -25762,9 +25746,10 @@ cp_parser_parameter_declaration (cp_pars
(INNERMOST_TEMPLATE_PARMS (current_template_parms));
  
if (latest_template_parm_idx != template_parm_idx)

-   decl_specifiers.type = convert_generic_types_to_packs
- (decl_specifiers.type,
-  template_parm_idx, latest_template_parm_idx);
+   decl_specifiers.type
+ = convert_generic_types_to_packs (decl_specifiers.type,
+   template_parm_idx,
+   latest_template_parm_idx);
  }
  
if (cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS))

@@ -25794,6 +25779,21 @@ cp_parser_parameter_declaration (cp_pars
}
  }
  
+  if (xobj_param_p

+  && (declarator ? declarator->parameter_pack_p
+: PACK_EXPANSION_P (decl_specifiers.type)))
+{
+  location_t xobj_param
+   = make_location (decl_specifiers.locations[ds_this],
+decl_spec_token_start->location,
+input_location);
+  error_at (xobj_param,
+   "an explicit object parameter cannot "
+   "be a function parameter pack");
+  xobj_param_p = false;
+  decl_specifiers.locations[ds_this] = 0;
+}
+
/* The restriction on defining new types applies only to the type
   of the parameter, not to the default argument.  */
parser->type_definition_forbidden_message = saved_message;

Jakub





Results for 14.0.1 20240306 (experimental) [master revision gcc-14-9346-g74e8cc28eda] (GCC) testsuite on aarch64-unknown-linux-gnu

2024-03-06 Thread ci_notify--- via Gcc-testresults
 test
FAIL: gcc.dg/vect/tsvc/vect-tsvc-s352.c execution test
FAIL: gcc.dg/vect/tsvc/vect-tsvc-s443.c execution test
FAIL: gcc.dg/vect/tsvc/vect-tsvc-s452.c -flto -ffat-lto-objects execution test
FAIL: gcc.dg/vect/tsvc/vect-tsvc-s452.c execution test
FAIL: gcc.dg/vect/tsvc/vect-tsvc-vdotr.c -flto -ffat-lto-objects execution test
FAIL: gcc.dg/vect/tsvc/vect-tsvc-vdotr.c execution test
FAIL: gcc.dg/vect/tsvc/vect-tsvc-vpvtv.c execution test
FAIL: gcc.dg/vect/tsvc/vect-tsvc-vsumr.c -flto -ffat-lto-objects execution test
FAIL: gcc.dg/vect/tsvc/vect-tsvc-vsumr.c execution test
FAIL: gcc.misc-tests/gcov-pr94029.c gcov failed: spawn failed
FAIL: gcc.target/aarch64/sve/mask_struct_load_3_run.c execution test

=== gcc Summary ===

# of expected passes338088
# of unexpected failures310
# of expected failures  1764
# of unresolved testcases   1
# of unsupported tests  4410
/home/tcwg-buildslave/workspace/tcwg_gnu_0/abe/builds/destdir/x86_64-pc-linux-gnu/bin/aarch64-linux-gnu-gcc
  version 14.0.1 20240306 (experimental) [master revision 
gcc-14-9346-g74e8cc28eda] (GCC) 

Host   is x86_64-pc-linux-gnu

=== gfortran tests ===


Running target qemu
FAIL: gfortran.dg/asan/pointer_assign_16.f90 -fsanitize=address  -O0  execution 
test
FAIL: gfortran.dg/asan/pointer_assign_16.f90 -fsanitize=address  -O1  execution 
test
FAIL: gfortran.dg/asan/pointer_assign_16.f90 -fsanitize=address  -O2  execution 
test
FAIL: gfortran.dg/asan/pointer_assign_16.f90 -fsanitize=address  -O3 
-fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  
execution test
FAIL: gfortran.dg/asan/pointer_assign_16.f90 -fsanitize=address  -O3 -g  
execution test
FAIL: gfortran.dg/asan/pointer_assign_16.f90 -fsanitize=address  -Os  execution 
test
FAIL: gfortran.dg/asan/pr110415-2.f90 -fsanitize=address  -O0  execution test
FAIL: gfortran.dg/asan/pr110415-2.f90 -fsanitize=address  -O1  execution test
FAIL: gfortran.dg/asan/pr110415-2.f90 -fsanitize=address  -O2  execution test
FAIL: gfortran.dg/asan/pr110415-2.f90 -fsanitize=address  -O3 
-fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  
execution test
FAIL: gfortran.dg/asan/pr110415-2.f90 -fsanitize=address  -O3 -g  execution test
FAIL: gfortran.dg/asan/pr110415-2.f90 -fsanitize=address  -Os  execution test
FAIL: gfortran.dg/asan/pr110415-3.f90 -fsanitize=address  -O0  execution test
FAIL: gfortran.dg/asan/pr110415-3.f90 -fsanitize=address  -O1  execution test
FAIL: gfortran.dg/asan/pr110415-3.f90 -fsanitize=address  -O2  execution test
FAIL: gfortran.dg/asan/pr110415-3.f90 -fsanitize=address  -O3 
-fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  
execution test
FAIL: gfortran.dg/asan/pr110415-3.f90 -fsanitize=address  -O3 -g  execution test
FAIL: gfortran.dg/asan/pr110415-3.f90 -fsanitize=address  -Os  execution test
FAIL: gfortran.dg/matmul_15.f90   -O  execution test

=== gfortran Summary ===

# of expected passes68758
# of unexpected failures19
# of expected failures  263
# of unsupported tests  156
/home/tcwg-buildslave/workspace/tcwg_gnu_0/abe/builds/destdir/x86_64-pc-linux-gnu/bin/aarch64-linux-gnu-gfortran
  version 14.0.1 20240306 (experimental) [master revision 
gcc-14-9346-g74e8cc28eda] (GCC) 

Host   is x86_64-pc-linux-gnu

=== g++ tests ===


Running target qemu
FAIL: c-c++-common/asan/alloca_instruments_all_paddings.c   -O0  execution test
FAIL: c-c++-common/asan/alloca_instruments_all_paddings.c   -O1  execution test
FAIL: c-c++-common/asan/alloca_instruments_all_paddings.c   -O2  execution test
FAIL: c-c++-common/asan/alloca_instruments_all_paddings.c   -O2 -flto 
-fno-use-linker-plugin -flto-partition=none  execution test
FAIL: c-c++-common/asan/alloca_instruments_all_paddings.c   -O2 -flto 
-fuse-linker-plugin -fno-fat-lto-objects  execution test
FAIL: c-c++-common/asan/alloca_instruments_all_paddings.c   -O3 
-fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  
execution test
FAIL: c-c++-common/asan/alloca_instruments_all_paddings.c   -O3 -g  execution 
test
FAIL: c-c++-common/asan/alloca_instruments_all_paddings.c   -Os  execution test
FAIL: c-c++-common/asan/alloca_loop_unpoisoning.c   -O0  execution test
FAIL: c-c++-common/asan/alloca_loop_unpoisoning.c   -O1  execution test
FAIL: c-c++-common/asan/alloca_loop_unpoisoning.c   -O2  execution test
FAIL: c-c++-common/asan/alloca_loop_unpoisoning.c   -O2 -flto 
-fno-use-linker-plugin -flto-partition=none  execution test
FAIL: c-c++-common/asan/alloca_loop_unpoisoning.c   -O2 -flto 
-fuse-linker-plugin -fno-fat-lto-objects  execution test
FAIL: c-c++-common/asan/alloca_loop_unpoisoning.c   -O3 -fomit-frame-pointer 
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: c-c++-common/asan/alloca_loop_unpoisoning.c   -O3 -g  execution test
FAIL: c-c++-common/asan/alloca_loop_unp

Results for 14.0.1 20240306 (experimental) [master r14-9343-gb575f37a342] (GCC) testsuite on s390x-ibm-linux-gnu default

2024-03-06 Thread stefansf--- via Gcc-testresults
42:\\n\\tsllg\\t%r2,%r2,63\\n\\tsrag\\t%r2,%r2,63\\n\\tllgcr\\t%r2,%r2
FAIL: gcc.target/s390/risbg-ll-2.c scan-assembler 
f10:\\n\\tsrlg\\t%r2,%r2,48\\n\\trosbg\\t%r2,%r3,32,39,0
FAIL: gcc.target/s390/unaligned-1.c scan-assembler-times 
larl\\t%r[0-9]*,extern_explicitly_aligned\\n 1
FAIL: gcc.target/s390/vector/align-1.c scan-assembler-times 
vl\\t%v[0-9]*,[0-9]*(%r[0-9]*),3\\n 1
FAIL: gcc.target/s390/vector/align-1.c scan-assembler-times 
vst\\t%v[0-9]*,[0-9]*(%r[0-9]*),3\\n 1
FAIL: gcc.target/s390/vector/long-double-to-i64.c scan-assembler-times 
ntvpdit%vd+,%vd+,%vd+,1n 1
FAIL: gcc.target/s390/vector/long-double-to-i64.c scan-assembler-times 
ntvpdit%vd+,%vd+,%vd+,5n 1
FAIL: gcc.target/s390/vector/vec-abi-vararg-1.c scan-assembler 
ld\\t%v[0-9]*,368(%r15)
FAIL: gcc.target/s390/vector/vec-abi-vararg-1.c scan-assembler 
ld\\t%v[0-9]*,392(%r15)
FAIL: gcc.target/s390/vector/vec-abi-vararg-1.c scan-assembler 
vl\\t%v[0-9]*,352(%r15)
FAIL: gcc.target/s390/vector/vec-abi-vararg-1.c scan-assembler 
vl\\t%v[0-9]*,376(%r15)
FAIL: gcc.target/s390/vector/vec-scalar-cmp-1.c scan-assembler 
eq:\\n[^:]*\\twfcdb\\t%v[0-9]*,%v[0-9]*\\n\\t[^:]+\\tlocghie\\t%r2,1
FAIL: gcc.target/s390/vector/vec-scalar-cmp-1.c scan-assembler 
ge:\\n[^:]*\\twfkdb\\t%v[0-9]*,%v[0-9]*\\n\\t[^:]+\\tlocghihe\\t%r2,1
FAIL: gcc.target/s390/vector/vec-scalar-cmp-1.c scan-assembler 
gt:\\n[^:]*\\twfkdb\\t%v[0-9]*,%v[0-9]*\\n\\t[^:]+\\tlocghih\\t%r2,1
FAIL: gcc.target/s390/vector/vec-scalar-cmp-1.c scan-assembler 
le:\\n[^:]*\\twfkdb\\t%v[0-9]*,%v[0-9]*\\n\\t[^:]+\\tlocghile\\t%r2,1
FAIL: gcc.target/s390/vector/vec-scalar-cmp-1.c scan-assembler 
lt:\\n[^:]*\\twfkdb\\t%v[0-9]*,%v[0-9]*\\n\\t[^:]+\\tlocghil\\t%r2,1
FAIL: gcc.target/s390/vector/vec-scalar-cmp-1.c scan-assembler 
ne:\\n[^:]*\\twfcdb\\t%v[0-9]*,%v[0-9]*\\n\\t[^:]+\\tlocghine\\t%r2,1
XPASS: gcc.target/s390/vxe/popcount-1.c scan-assembler vpopctb\\t%v24,%v24
XPASS: gcc.target/s390/vxe/popcount-1.c scan-assembler vpopcth\\t%v24,%v24

=== gcc Summary for unix/-m64 ===

# of expected passes180406
# of unexpected failures199
# of unexpected successes   19
# of expected failures  1467
# of unsupported tests  4212

=== gcc Summary ===

# of expected passes357746
# of unexpected failures421
# of unexpected successes   35
# of expected failures  2935
# of unsupported tests  9031
-default/gcc/xgcc  version 14.0.1 20240306 (experimental) [master 
r14-9343-gb575f37a342] (GCC) 

=== gdc tests ===


Running target unix/-m31
UNRESOLVED: gdc.test/runnable/literal.d   compilation failed to produce 
executable
UNRESOLVED: gdc.test/runnable/literal.d -shared-libphobos   compilation failed 
to produce executable
FAIL: gdc.test/runnable/sdtor.d -O2   execution test
FAIL: gdc.test/runnable/sdtor.d -O2 -finline-functions   execution test
FAIL: gdc.test/runnable/sdtor.d -O2 -finline-functions -frelease -funittest   
execution test
FAIL: gdc.test/runnable/sdtor.d -O2 -finline-functions -frelease -funittest -g  
 execution test
FAIL: gdc.test/runnable/sdtor.d -O2 -finline-functions -frelease -funittest -g 
-shared-libphobos   execution test
FAIL: gdc.test/runnable/sdtor.d -O2 -finline-functions -frelease -funittest 
-shared-libphobos   execution test
FAIL: gdc.test/runnable/sdtor.d -O2 -finline-functions -funittest   execution 
test
FAIL: gdc.test/runnable/sdtor.d -O2 -finline-functions -funittest -g   
execution test
FAIL: gdc.test/runnable/sdtor.d -O2 -finline-functions -funittest -g 
-shared-libphobos   execution test
FAIL: gdc.test/runnable/sdtor.d -O2 -finline-functions -funittest 
-shared-libphobos   execution test
FAIL: gdc.test/runnable/sdtor.d -O2 -finline-functions -g   execution test
FAIL: gdc.test/runnable/sdtor.d -O2 -finline-functions -g -shared-libphobos   
execution test
FAIL: gdc.test/runnable/sdtor.d -O2 -finline-functions -shared-libphobos   
execution test
FAIL: gdc.test/runnable/sdtor.d -O2 -frelease -funittest   execution test
FAIL: gdc.test/runnable/sdtor.d -O2 -frelease -funittest -g   execution test
FAIL: gdc.test/runnable/sdtor.d -O2 -frelease -funittest -g -shared-libphobos   
execution test
FAIL: gdc.test/runnable/sdtor.d -O2 -frelease -funittest -shared-libphobos   
execution test
FAIL: gdc.test/runnable/sdtor.d -O2 -funittest   execution test
FAIL: gdc.test/runnable/sdtor.d -O2 -funittest -g   execution test
FAIL: gdc.test/runnable/sdtor.d -O2 -funittest -g -shared-libphobos   execution 
test
FAIL: gdc.test/runnable/sdtor.d -O2 -funittest -shared-libphobos   execution 
test
FAIL: gdc.test/runnable/sdtor.d -O2 -g   execution test
FAIL: gdc.test/runnable/sdtor.d -O2 -g -shared-libphobos   execution test
FAIL: gdc.test/runnable/sdtor.d -O2 -shared-libphobos   execution test
FAIL: gdc.test/runnable/test34.d   execution test
FAIL: gdc.test/runnable/test34.d -sha

[Bug rtl-optimization/101523] Huge number of combine attempts

2024-03-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101523

--- Comment #18 from Andrew Pinski  ---
Hmm, looking at what is done in combine, I wonder why forwprop didn't do the
address add into the memory. That would definitely decrease the # of combines
being done.

Maybe it is because it is used more than once. But still seems like another
pass should have done the a=b+c; d=e*[a] into a=b+c; d=e*[b+c] before hand.

Maybe there is some address cost going wrong here that forwprop is causing
issues. And it just happens combine does not take that into account due to rtl
cost not taking address cost into account.

Re: [PATCH] Include safe-ctype.h after C++ standard headers, to avoid over-poisoning

2024-03-06 Thread Dimitry Andric
On 6 Mar 2024, at 15:57, FX Coudert  wrote:
> 
>> Hmm I recall trying it and finding a problem - was there some different fix 
>> applied
>> in the end?
> 
> The bug is still open, I don’t think a patch was applied, and I don’t find 
> any email to the list stating what the problem could be.

The original patch (https://gcc.gnu.org/bugzilla/attachment.cgi?id=56010) still 
applies to the master branch. It turned out there is also a related problem in 
libcc1plugin.cc and libcp1plugin.cc , which is fixed 
by https://gcc.gnu.org/bugzilla/attachment.cgi?id=57639 :

commit 49222b98ac8e30a4a042ada0ece3d7df93f049d2
Author: Dimitry Andric 
Date:   2024-03-06T23:46:27+01:00

Fix libcc1plugin and libc1plugin to use INCLUDE_VECTOR before including
system.h, instead of directly including , to avoid running into
poisoned identifiers.

diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
index 72d17c3b81c..e64847466f4 100644
--- a/libcc1/libcc1plugin.cc
+++ b/libcc1/libcc1plugin.cc
@@ -32,6 +32,7 @@
 #undef PACKAGE_VERSION
 
 #define INCLUDE_MEMORY
+#define INCLUDE_VECTOR
 #include "gcc-plugin.h"
 #include "system.h"
 #include "coretypes.h"
@@ -69,8 +70,6 @@
 #include "gcc-c-interface.h"
 #include "context.hh"
 
-#include 
-
 using namespace cc1_plugin;
 
 
diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
index 0eff7c68d29..da68c5d0ac1 100644
--- a/libcc1/libcp1plugin.cc
+++ b/libcc1/libcp1plugin.cc
@@ -33,6 +33,7 @@
 #undef PACKAGE_VERSION
 
 #define INCLUDE_MEMORY
+#define INCLUDE_VECTOR
 #include "gcc-plugin.h"
 #include "system.h"
 #include "coretypes.h"
@@ -71,8 +72,6 @@
 #include "rpc.hh"
 #include "context.hh"
 
-#include 
-
 using namespace cc1_plugin;
 
 



Results for 14.0.1 20240306 (experimental) [remotes/origin/HEAD r14-9346-g74e8cc28eda] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-03-06 Thread Bill Seurer (POWER9) via Gcc-testresults
 === gcc Summary ===

# of expected passes178997
# of unexpected failures132
# of unexpected successes   19
# of expected failures  1614
# of unsupported tests  4169
/home/gccbuild/build/nightly/build-gcc-trunk/gcc/xgcc  version 14.0.1 20240306 
(experimental) [remotes/origin/HEAD r14-9346-g74e8cc28eda] (GCC) 

=== gfortran tests ===


Running target unix
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O0  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O1  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O2  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O3 -fomit-frame-pointer 
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -O3 -g  execution test
XPASS: gfortran.dg/large_real_kind_form_io_2.f90   -Os  execution test
FAIL: gfortran.dg/ieee/comparisons_3.F90   -O0  execution test
FAIL: gfortran.dg/ieee/comparisons_3.F90   -O1  execution test
FAIL: gfortran.dg/ieee/comparisons_3.F90   -O2  execution test
FAIL: gfortran.dg/ieee/comparisons_3.F90   -O3 -fomit-frame-pointer 
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/ieee/comparisons_3.F90   -O3 -g  execution test
FAIL: gfortran.dg/ieee/comparisons_3.F90   -Os  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O0  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O1  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O2  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O3 -fomit-frame-pointer -funroll-loops 
-fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -O3 -g  execution test
FAIL: gfortran.dg/ieee/large_2.f90   -Os  execution test

=== gfortran Summary ===

# of expected passes69416
# of unexpected failures12
# of unexpected successes   6
# of expected failures  285
# of unsupported tests  171
/home/gccbuild/build/nightly/build-gcc-trunk/gcc/gfortran  version 14.0.1 
20240306 (experimental) [remotes/origin/HEAD r14-9346-g74e8cc28eda] (GCC) 

=== g++ tests ===


Running target unix

=== g++ Summary ===

# of expected passes258959
# of expected failures  2623
# of unsupported tests  11615
/home/gccbuild/build/nightly/build-gcc-trunk/gcc/xg++  version 14.0.1 20240306 
(experimental) [remotes/origin/HEAD r14-9346-g74e8cc28eda] (GCC) 

=== obj-c++ tests ===


Running target unix

=== obj-c++ Summary ===

# of expected passes1503
# of expected failures  10
# of unsupported tests  79
/home/gccbuild/build/nightly/build-gcc-trunk/gcc/xg++  version 14.0.1 20240306 
(experimental) [remotes/origin/HEAD r14-9346-g74e8cc28eda] (GCC) 

=== objc tests ===


Running target unix

=== objc Summary ===

# of expected passes2846
# of unsupported tests  70
/home/gccbuild/build/nightly/build-gcc-trunk/gcc/xgcc  version 14.0.1 20240306 
(experimental) [remotes/origin/HEAD r14-9346-g74e8cc28eda] (GCC) 

=== libatomic tests ===


Running target unix

=== libatomic Summary ===

# of expected passes54
=== libgomp tests ===


Running target unix

=== libgomp Summary ===

# of expected passes16151
# of expected failures  285
# of unsupported tests  697
=== libitm tests ===


Running target unix

=== libitm Summary ===

# of expected passes44
# of expected failures  3
# of unsupported tests  1
=== libstdc++ tests ===


Running target unix

=== libstdc++ Summary ===

# of expected passes18501
# of expected failures  126
# of unsupported tests  738

Compiler version: 14.0.1 20240306 (experimental) [remotes/origin/HEAD 
r14-9346-g74e8cc28eda] (GCC) 
Platform: powerpc64le-unknown-linux-gnu
configure flags: --prefix=/opt/gcc-nightly/trunk 
--enable-languages=c,c++,fortran,objc,obj-c++ --with-cpu=power9 
--enable-secureplt
fail   WARNING: Could not generate test framework tests
fail   WARNING: Could not generate test framework tests
fail   WARNING: Could not generate test framework tests
fail   WARNING: Could not generate test framework tests
fail   WARNING: Could not generate test framework tests
fail   WARNING: Could not generate test framework tests
fail   FAIL: dg-do-assemble-exp-P.c (assemble: produce .o test) (PRMS 42)
fail   FAIL: dg-do-compile-exp-P.c (compile) (PRMS 42)
fail   FAIL: dg-do-link-exp-P.c (link: produce a.out test) (PRMS 42)
fail   XPASS: gcc.test-framework/dg-bogus-exp-XF.c (test for excess errors)
fail   FAIL: gcc.test-framework/dg-do-assemble-exp-P.c (test for excess errors) 
(PRMS 42)
fail   FAIL: gcc.test-framework/dg-do-com

[Bug rtl-optimization/101523] Huge number of combine attempts

2024-03-06 Thread segher at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101523

--- Comment #17 from Segher Boessenkool  ---
Why does this happen so extremely often for s390x customers?  It should from
first principles happen way more often for e.g. powerpc, but we never see such
big problems, let alone "all of the time"!

So what is really happening?  And, when did this start, anyway, because
apparently
at some point in time all was fine?

  1   2   3   4   5   >