[Bug c/115532] New: Small documentation fixes for -Wsuggest-attribute=returns_nonnull

2024-06-17 Thread peter at eisentraut dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115532

Bug ID: 115532
   Summary: Small documentation fixes for
-Wsuggest-attribute=returns_nonnull
   Product: gcc
   Version: 14.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: peter at eisentraut dot org
  Target Milestone: ---

Created attachment 58457
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58457=edit
patch with fixes

The documentation for -Wsuggest-attribute=returns_nonnull (new in gcc 14,
commit 53ba8d66955) contains a few small mistakes.

See
https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gcc/Warning-Options.html#index-Wsuggest-attribute_003d
for the current rendering.

1. Wrong punctuation:
"-Wsuggest-attribute=[pure|const|noreturn|format|cold|malloc]returns_nonnull|"
(note "]" after "malloc").

2. Not added to the overview earlier in the page (also "cold" was missing
there).

3. Not added to the index. (Instead, the "no" form was added as in @itemx,
which is inconsistent with the other entries.)

I'm attaching a patch with these three things fixed.  (Note, I have not built
the documentation with this.)

[Bug c/115516] constexpr use before C23 could give a better error message

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

Richard Biener  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2024-06-18
 Status|UNCONFIRMED |NEW

--- Comment #1 from Richard Biener  ---
Confirmed.

RE: [PATCH] aarch64: Add fix_truncv4sfv4hi2 pattern [PR113882]

2024-06-17 Thread Richard Biener
On Tue, 18 Jun 2024, Pengxuan Zheng (QUIC) wrote:

> > Pengxuan Zheng  writes:
> > > This patch adds the fix_truncv4sfv4hi2 (V4SF->V4HI) pattern which is
> > > implemented using fix_truncv4sfv4si2 (V4SF->V4SI) and then truncv4siv4hi2
> > (V4SI->V4HI).
> > >
> > >   PR target/113882
> > >
> > > gcc/ChangeLog:
> > >
> > >   * config/aarch64/aarch64-simd.md (fix_truncv4sfv4hi2): New pattern.
> > 
> > Could we handle this by extending the target-independent code instead?
> > Richard mentioned in comment 1 that the current set of intermediate
> > conversions is hard-coded, but it didn't sound like he was implying that the
> > set shouldn't change.
> 
> Yes, Richard. I checked the target-independent code. In fact, SLP already 
> handles this type of intermediate conversions. However, the logic is guarded 
> by 
> "!flag_trapping_math". Therefore, if we pass -fno-trapping-math , SLP 
> actually 
> generates the right vectorized code. Also, looks like the check for 
> "!flag_trapping_math" was added intentionally in r14-2085-g77a50c772771f6 to 
> fix 
> some PRs. So, I'm not sure what we should do here. Thoughts?
> 
>   if (GET_MODE_SIZE (lhs_mode) != GET_MODE_SIZE (rhs_mode)
>   && (code == FLOAT_EXPR ||
>   (code == FIX_TRUNC_EXPR && !flag_trapping_math)))

That is because of missing FE_INVALID(?) when say float -> signed char
doesn't fit but float -> int does and the remaining converts are done
as int -> {short,char}.

There has been multiple rounds of discussion whether flag_trapping_math
should be off by default.

Richard.

> Thanks,
> Pengxuan
> > 
> > Thanks,
> > Richard
> > 
> > > gcc/testsuite/ChangeLog:
> > >
> > >   * gcc.target/aarch64/fix_trunc2.c: New test.
> > >
> > > Signed-off-by: Pengxuan Zheng 
> > > ---
> > >  gcc/config/aarch64/aarch64-simd.md| 13 +
> > >  gcc/testsuite/gcc.target/aarch64/fix_trunc2.c | 14 ++
> > >  2 files changed, 27 insertions(+)
> > >  create mode 100644 gcc/testsuite/gcc.target/aarch64/fix_trunc2.c
> > >
> > > diff --git a/gcc/config/aarch64/aarch64-simd.md
> > > b/gcc/config/aarch64/aarch64-simd.md
> > > index 868f4486218..096f7b56a27 100644
> > > --- a/gcc/config/aarch64/aarch64-simd.md
> > > +++ b/gcc/config/aarch64/aarch64-simd.md
> > > @@ -3032,6 +3032,19 @@ (define_expand
> > "2"
> > >"TARGET_SIMD"
> > >{})
> > >
> > > +
> > > +(define_expand "fix_truncv4sfv4hi2"
> > > +  [(match_operand:V4HI 0 "register_operand")
> > > +   (match_operand:V4SF 1 "register_operand")]
> > > +  "TARGET_SIMD"
> > > +  {
> > > +rtx tmp = gen_reg_rtx (V4SImode);
> > > +emit_insn (gen_fix_truncv4sfv4si2 (tmp, operands[1]));
> > > +emit_insn (gen_truncv4siv4hi2 (operands[0], tmp));
> > > +DONE;
> > > +  }
> > > +)
> > > +
> > >  (define_expand "ftrunc2"
> > >[(set (match_operand:VHSDF 0 "register_operand")
> > >   (unspec:VHSDF [(match_operand:VHSDF 1 "register_operand")] diff
> > > --git a/gcc/testsuite/gcc.target/aarch64/fix_trunc2.c
> > > b/gcc/testsuite/gcc.target/aarch64/fix_trunc2.c
> > > new file mode 100644
> > > index 000..57cc00913a3
> > > --- /dev/null
> > > +++ b/gcc/testsuite/gcc.target/aarch64/fix_trunc2.c
> > > @@ -0,0 +1,14 @@
> > > +/* { dg-do compile } */
> > > +/* { dg-options "-O2" } */
> > > +
> > > +void
> > > +f (short *__restrict a, float *__restrict b) {
> > > +  a[0] = b[0];
> > > +  a[1] = b[1];
> > > +  a[2] = b[2];
> > > +  a[3] = b[3];
> > > +}
> > > +
> > > +/* { dg-final { scan-assembler-times {fcvtzs\tv[0-9]+.4s, v[0-9]+.4s}
> > > +1 } } */
> > > +/* { dg-final { scan-assembler-times {xtn\tv[0-9]+.4h, v[0-9]+.4s} 1
> > > +} } */
> 

-- 
Richard Biener 
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)


[to-be-committed][RISC-V] Improve bset generation when bit position is limited

2024-06-17 Thread Jeff Law


So more work in the ongoing effort to make better use of the Zbs 
extension.  This time we're trying to exploit knowledge of the shift 
count/bit position to allow us to use a bset instruction.


Consider this expression in SImode


 (1 << (pos & 0xf)

None of the resulting values will have bit 31 set.  So if there's an 
explicit zero or sign extension to DI we can drop that explicit 
extension and generate a simple bset with x0 as the input value.


Or another example (which I think came from spec at some point and IIRC 
was the primary motivation for this patch):




(1 << (7-(pos) % 8))



Before this change they'd generate something like this respectively:

li  a5,1
andia0,a0,15
sllwa0,a5,a0


li  a5,7
andna0,a5,a0
li  a5,1
sllwa0,a5,a0



After this change they generate:



andia0,a0,15# 9 [c=4 l=4]  *anddi3/1
bseta0,x0,a0# 17[c=8 l=4]  *bsetdi_2


li  a5,7# 27[c=4 l=4]  *movdi_64bit/1
andna0,a5,a0# 28[c=4 l=4]  and_notdi3
bseta0,x0,a0# 19[c=8 l=4]  *bsetdi_2



We achieve this with simple define_splits which target the bsetdi_2 
pattern I recently added.  Much better than the original implementation 
I did a few months back :-)  I've got a bclr/binv variant from a few 
months back as well, but it needs to be updated to the simpler 
implementation found here.


Just ran this through my tester.  Will wait for the precommit CI to 
render its verdict before moving forward.



Jeffdiff --git a/gcc/config/riscv/bitmanip.md b/gcc/config/riscv/bitmanip.md
index 094bc2acf1c..dc7a7e7fba7 100644
--- a/gcc/config/riscv/bitmanip.md
+++ b/gcc/config/riscv/bitmanip.md
@@ -609,6 +609,36 @@ (define_insn "*bsetdi_2"
   "bset\t%0,x0,%1"
   [(set_attr "type" "bitmanip")])
 
+;; These two splitters take advantage of the limited range of the
+;; shift constant.   With the limited range we know the SImode sign
+;; bit is never set, thus we can treat this as zero extending and
+;; generate the bsetdi_2 pattern.
+(define_split
+  [(set (match_operand:DI 0 "register_operand")
+   (any_extend:DI
+(ashift:SI (const_int 1)
+   (subreg:QI (and:DI (not:DI (match_operand:DI 1 
"register_operand"))
+  (match_operand 2 "const_int_operand")) 0
+   (clobber (match_operand:DI 3 "register_operand"))]
+  "TARGET_64BIT
+   && TARGET_ZBS
+   && (TARGET_ZBB || TARGET_ZBKB)
+   && (INTVAL (operands[2]) & 0x1f) != 0x1f"
+   [(set (match_dup 0) (and:DI (not:DI (match_dup 1)) (match_dup 2)))
+(set (match_dup 0) (zero_extend:DI (ashift:SI (const_int 1) (subreg:QI 
(match_dup 0) 0])
+
+(define_split
+  [(set (match_operand:DI 0 "register_operand")
+   (any_extend:DI
+(ashift:SI (const_int 1)
+   (subreg:QI (and:DI (match_operand:DI 1 "register_operand")
+  (match_operand 2 "const_int_operand")) 
0]
+  "TARGET_64BIT
+   && TARGET_ZBS
+   && (INTVAL (operands[2]) & 0x1f) != 0x1f"
+   [(set (match_dup 0) (and:DI (match_dup 1) (match_dup 2)))
+(set (match_dup 0) (zero_extend:DI (ashift:SI (const_int 1) (subreg:QI 
(match_dup 0) 0])
+
 (define_insn "*bset_1_mask"
   [(set (match_operand:X 0 "register_operand" "=r")
(ashift:X (const_int 1)
diff --git a/gcc/testsuite/gcc.target/riscv/zbs-ext-2.c 
b/gcc/testsuite/gcc.target/riscv/zbs-ext-2.c
new file mode 100644
index 000..301bc9d89c4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/zbs-ext-2.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gc_zbb_zbs -mabi=lp64" } */
+/* { dg-skip-if "" { *-*-* } { "-O0" "-Og" "-Os" } } */
+
+
+typedef unsigned int uint32_t;
+uint32_t foo(uint32_t pos)
+{
+return (1 << (7-(pos) % 8));
+}
+
+typedef unsigned int uint32_t;
+uint32_t foo2(uint32_t pos)
+{
+return (1 << (pos & 0xf));
+}
+
+/* { dg-final { scan-assembler-not "sll\t" } } */
+/* { dg-final { scan-assembler-times "bset\t" 2 } } */
+/* { dg-final { scan-assembler-times "andi\t" 1 } } */
+/* { dg-final { scan-assembler-times "andn\t" 1 } } */
+/* { dg-final { scan-assembler-times "li\t" 1 } } */
+/* { dg-final { scan-assembler-times "ret" 2 } } */
+


Results for 12.3.1 20240618 [remotes/origin/releases/gcc-12 r12-10563-gb87418f64b] (GCC) testsuite on powerpc64-unknown-linux-gnu

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


git commit g:b87418f64ba0877bd90281a9142c280ccc08cbef
gcc-descr r12-10563-gb87418f64ba087

power9 BE
Linux 6.8.12-powerpc64 ppc64
GNU Make 4.3

DejaGnu:
DejaGnu version 1.6.3
Expect version  5.45.4
Tcl version 8.6

64-bit

LAST_UPDATED: Tue Jun 18 04:47:24 UTC 2024 (revision r12-10563-gb87418f64b)

Native configuration is powerpc64-unknown-linux-gnu

=== g++ tests ===


Running target unix/-m32

=== g++ Summary for unix/-m32 ===

# of expected passes219552
# of expected failures  1922
# of unsupported tests  10367

Running target unix/-m64
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array + 3, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array - 1, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array, NULL, 36) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array + 3, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array - 1, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array, NULL, 36) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O0  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O1  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O2  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O3 -g  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -Os  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O2 -flto 
-fno-use-linker-plugin -flto-partition=none  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test

=== g++ Summary for unix/-m64 ===

# of expected passes228255
# of unexpected failures21
# of expected failures  1930
# of unsupported tests  10551

=== g++ Summary ===

# of expected passes447807
# of unexpected failures21
# of expected failures  3852
# of unsupported tests  20918
/home/gccbuild/build/nightly/build-gcc-12/gcc/xg++  version 12.3.1 20240618 
[remotes/origin/releases/gcc-12 r12-10563-gb87418f64b] (GCC) 

=== gcc tests ===


Running target unix/-m32
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   -O3 -g  (test for excess errors)
FAIL: gcc.dg/analyzer/torture/conftest-1.c   -Os  (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)
XPASS: gcc.dg/uninit-pred-7_a.c bogus warning (test for bogus messages, line 26)
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/vect/slp-24-big-array.c -flto -ffat-lto-objects  

[Bug tree-optimization/111793] OpenMP SIMD inbranch clones for AVX512 are highly sub-optimal

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

--- Comment #8 from Richard Biener  ---
The committed fix should resolve the stray masked stores observed but not the
inefficiency dealing with incoming AVX512 mask arguments.

[Bug tree-optimization/84203] add -Wsuggest-attribute=returns_nonnull

2024-06-17 Thread peter at eisentraut dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84203

Peter Eisentraut  changed:

   What|Removed |Added

 CC||peter at eisentraut dot org

--- Comment #4 from Peter Eisentraut  ---
This is implemented in gcc 14:

commit 53ba8d66955
Author: Jan Hubicka 
Date:   Mon Nov 20 19:35:53 2023

inter-procedural value range propagation

implement very basic propapgation of return value ranges from VRP
pass.  This helps std::vector's push_back since we work out value range of
allocated block.  This propagates only within single translation unit.  I
hoped
we will also do the propagation at WPA stage, but that needs more work on
ipa-cp side.

I also added code auto-detecting return_nonnull and corresponding
-Wsuggest-attribute.

[It is misspelled in the commit message.]

[Bug target/115493] [15 regression] gcc.c-torture/execute/pr94734.c fails on MVE after r15-1054-g202a9c8fe7d

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

Richard Biener  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #9 from Richard Biener  ---
Should be fixed now.

[gcc r15-1392] tree-optimization/115493 - fix wrong code with SLP induction cond reduction

2024-06-17 Thread Richard Biener via Gcc-cvs
https://gcc.gnu.org/g:19258ca1b85bc15e3a49054eff209f4f0d1c5bee

commit r15-1392-g19258ca1b85bc15e3a49054eff209f4f0d1c5bee
Author: Richard Biener 
Date:   Mon Jun 17 16:01:15 2024 +0200

tree-optimization/115493 - fix wrong code with SLP induction cond reduction

The following fixes a bad final value being used when doing single-lane
SLP integer induction cond reduction vectorization.

PR tree-optimization/115493
* tree-vect-loop.cc (vect_create_epilog_for_reduction): Use
the first scalar result.

Diff:
---
 gcc/tree-vect-loop.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index d9a2ad694843..7c79e9da1060 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -6843,8 +6843,8 @@ vect_create_epilog_for_reduction (loop_vec_info 
loop_vinfo,
 with the original initial value, unless induc_val is
 the same as initial_def already.  */
  tree zcompare = make_ssa_name (boolean_type_node);
- epilog_stmt = gimple_build_assign (zcompare, EQ_EXPR, new_temp,
-induc_val);
+ epilog_stmt = gimple_build_assign (zcompare, EQ_EXPR,
+scalar_results[0], induc_val);
  gsi_insert_before (_gsi, epilog_stmt, GSI_SAME_STMT);
  tree initial_def = reduc_info->reduc_initial_values[0];
  tree tmp = make_ssa_name (new_scalar_dest);


[Bug target/115493] [15 regression] gcc.c-torture/execute/pr94734.c fails on MVE after r15-1054-g202a9c8fe7d

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

--- Comment #8 from GCC Commits  ---
The master branch has been updated by Richard Biener :

https://gcc.gnu.org/g:19258ca1b85bc15e3a49054eff209f4f0d1c5bee

commit r15-1392-g19258ca1b85bc15e3a49054eff209f4f0d1c5bee
Author: Richard Biener 
Date:   Mon Jun 17 16:01:15 2024 +0200

tree-optimization/115493 - fix wrong code with SLP induction cond reduction

The following fixes a bad final value being used when doing single-lane
SLP integer induction cond reduction vectorization.

PR tree-optimization/115493
* tree-vect-loop.cc (vect_create_epilog_for_reduction): Use
the first scalar result.

[gcc r15-1391] Enhance if-conversion for automatic arrays

2024-06-17 Thread Richard Biener via Gcc-cvs
https://gcc.gnu.org/g:4b75ed33fa5fd604897e7a30e79bd28d46598373

commit r15-1391-g4b75ed33fa5fd604897e7a30e79bd28d46598373
Author: Richard Biener 
Date:   Fri Jun 14 14:46:08 2024 +0200

Enhance if-conversion for automatic arrays

Automatic arrays that are not address-taken should not be subject to
store data races.  This applies to OMP SIMD in-branch lowered
functions result array which for the testcase otherwise prevents
vectorization with SSE and for AVX and AVX512 ends up with spurious
.MASK_STORE to the stack surviving.

This inefficiency was noted in PR111793.

I've introduced ref_can_have_store_data_races, commonizing uses
of flag_store_data_races in if-conversion, cselim and store motion.

PR tree-optimization/111793
* tree-ssa-alias.h (ref_can_have_store_data_races): Declare.
* tree-ssa-alias.cc (ref_can_have_store_data_races): New
function.
* tree-if-conv.cc (ifcvt_memrefs_wont_trap): Use
ref_can_have_store_data_races to allow more unconditional
stores.
* tree-ssa-loop-im.cc (execute_sm): Likewise.
* tree-ssa-phiopt.cc (cond_store_replacement): Likewise.

* gcc.dg/vect/vect-simd-clone-21.c: New testcase.

Diff:
---
 gcc/testsuite/gcc.dg/vect/vect-simd-clone-21.c | 16 
 gcc/tree-if-conv.cc| 11 +--
 gcc/tree-ssa-alias.cc  | 19 +++
 gcc/tree-ssa-alias.h   |  2 ++
 gcc/tree-ssa-loop-im.cc|  2 +-
 gcc/tree-ssa-phiopt.cc |  4 +---
 6 files changed, 44 insertions(+), 10 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-21.c 
b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-21.c
new file mode 100644
index ..49c52fb59bd1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-21.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_simd_clones } */
+/* { dg-additional-options "-fopenmp-simd" } */
+
+#pragma omp declare simd simdlen(4) inbranch
+__attribute__((noinline)) int
+foo (int a, int b)
+{
+  return a + b;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 4 "vect" { target 
i?86-*-* x86_64-*-* } } } */
+/* if-conversion shouldn't need to resort to masked stores for the result
+   array created by OMP lowering since that's automatic and does not have
+   its address taken.  */
+/* { dg-final { scan-tree-dump-not "MASK_STORE" "vect" } } */
diff --git a/gcc/tree-if-conv.cc b/gcc/tree-if-conv.cc
index c4c3ed41a447..57992b6decaf 100644
--- a/gcc/tree-if-conv.cc
+++ b/gcc/tree-if-conv.cc
@@ -936,12 +936,11 @@ ifcvt_memrefs_wont_trap (gimple *stmt, 
vec drs)
 
   /* an unconditionaly write won't trap if the base is written
  to unconditionally.  */
-  if (base_master_dr
- && DR_BASE_W_UNCONDITIONALLY (*base_master_dr))
-   return flag_store_data_races;
-  /* or the base is known to be not readonly.  */
-  else if (base_object_writable (DR_REF (a)))
-   return flag_store_data_races;
+  if ((base_master_dr
+  && DR_BASE_W_UNCONDITIONALLY (*base_master_dr))
+ /* or the base is known to be not readonly.  */
+ || base_object_writable (DR_REF (a)))
+   return !ref_can_have_store_data_races (base);
 }
 
   return false;
diff --git a/gcc/tree-ssa-alias.cc b/gcc/tree-ssa-alias.cc
index 1a91d63a31ec..fab048b0b594 100644
--- a/gcc/tree-ssa-alias.cc
+++ b/gcc/tree-ssa-alias.cc
@@ -3704,6 +3704,25 @@ stmt_kills_ref_p (gimple *stmt, tree ref)
   return stmt_kills_ref_p (stmt, );
 }
 
+/* Return whether REF can be subject to store data races.  */
+
+bool
+ref_can_have_store_data_races (tree ref)
+{
+  /* With -fallow-store-data-races do not care about them.  */
+  if (flag_store_data_races)
+return false;
+
+  tree base = get_base_address (ref);
+  if (auto_var_p (base)
+  && ! may_be_aliased (base))
+/* Automatic variables not aliased are not subject to
+   data races.  */
+return false;
+
+  return true;
+}
+
 
 /* Walk the virtual use-def chain of VUSE until hitting the virtual operand
TARGET or a statement clobbering the memory reference REF in which
diff --git a/gcc/tree-ssa-alias.h b/gcc/tree-ssa-alias.h
index 5cd64e722955..5834533ae9cd 100644
--- a/gcc/tree-ssa-alias.h
+++ b/gcc/tree-ssa-alias.h
@@ -144,6 +144,8 @@ extern bool call_may_clobber_ref_p (gcall *, tree, bool = 
true);
 extern bool call_may_clobber_ref_p_1 (gcall *, ao_ref *, bool = true);
 extern bool stmt_kills_ref_p (gimple *, tree);
 extern bool stmt_kills_ref_p (gimple *, ao_ref *);
+extern bool ref_can_have_store_data_races (tree);
+
 enum translate_flags
   { TR_TRANSLATE, TR_VALUEIZE_AND_DISAMBIGUATE, TR_DISAMBIGUATE };
 extern tree get_continuation_for_phi (gimple *, ao_ref *, bool,
diff --git a/gcc/tree-ssa-loop-im.cc 

[Bug tree-optimization/111793] OpenMP SIMD inbranch clones for AVX512 are highly sub-optimal

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

--- Comment #7 from GCC Commits  ---
The master branch has been updated by Richard Biener :

https://gcc.gnu.org/g:4b75ed33fa5fd604897e7a30e79bd28d46598373

commit r15-1391-g4b75ed33fa5fd604897e7a30e79bd28d46598373
Author: Richard Biener 
Date:   Fri Jun 14 14:46:08 2024 +0200

Enhance if-conversion for automatic arrays

Automatic arrays that are not address-taken should not be subject to
store data races.  This applies to OMP SIMD in-branch lowered
functions result array which for the testcase otherwise prevents
vectorization with SSE and for AVX and AVX512 ends up with spurious
.MASK_STORE to the stack surviving.

This inefficiency was noted in PR111793.

I've introduced ref_can_have_store_data_races, commonizing uses
of flag_store_data_races in if-conversion, cselim and store motion.

PR tree-optimization/111793
* tree-ssa-alias.h (ref_can_have_store_data_races): Declare.
* tree-ssa-alias.cc (ref_can_have_store_data_races): New
function.
* tree-if-conv.cc (ifcvt_memrefs_wont_trap): Use
ref_can_have_store_data_races to allow more unconditional
stores.
* tree-ssa-loop-im.cc (execute_sm): Likewise.
* tree-ssa-phiopt.cc (cond_store_replacement): Likewise.

* gcc.dg/vect/vect-simd-clone-21.c: New testcase.

Re: [RFC v3] RISC-V: Promote Zaamo/Zalrsc to a when using an old binutils

2024-06-17 Thread Kito Cheng
When 'a' is put into riscv_combine_info, 'a' will only be added into
arch string only if zaamo *AND* zalrsc is there, so zalrsc only won't
trigger that.

On Tue, Jun 18, 2024 at 1:35 PM Patrick O'Neill  wrote:
>
>
>
> On Mon, Jun 17, 2024 at 5:51 PM Kito Cheng  wrote:
>>
>> Maybe just add 'a' to riscv_combine_info and other logic to keep the
>> same (e.g. keep the logic for skip_zaamo_zalrsc)?
>
>
> I did consider unconditionally upgrading zaamo/zalrsc to ‘a’ (I think that’s 
> what you’re suggesting w/ riscv_combine_info).
> That could cause issues if users are trying to compile for a zalrsc-only chip 
> with an old version of binutils. If we upgrade zalrsc -> ‘a’ for both cc1 and 
> binutils then cc1 will emit amo ops instead of their lr/sc equivalent.
> GCC would end up emitting insns that are illegal for the user-provided -march 
> string.
>
> Patrick
>
>>
>> On Tue, Jun 18, 2024 at 8:03 AM Patrick O'Neill  wrote:
>> >
>> > Binutils 2.42 and before don't support Zaamo/Zalrsc. Promote Zaamo/Zalrsc 
>> > to
>> > 'a' in the -march string when assembling.
>> >
>> > This change respects Zaamo/Zalrsc when generating code.
>> >
>> > Testcases that check for the default isa string will fail with the old 
>> > binutils
>> > since zaamo/zalrsc aren't emitted anymore. All other Zaamo/Zalrsc testcases
>> > pass.
>> >
>> > gcc/ChangeLog:
>> >
>> > * common/config/riscv/riscv-common.cc
>> > (riscv_subset_list::to_string): Add toggle to promote Zaamo/Zalrsc
>> > extensions to 'a'.
>> > (riscv_arch_str): Ditto.
>> > (riscv_expand_arch): Ditto.
>> > (riscv_expand_arch_from_cpu): Ditto.
>> > (riscv_expand_arch_upgrade_exts): New function. Wrapper around
>> > riscv_expand_arch to preserve the function signature.
>> > (riscv_expand_arch_no_upgrade_exts): Ditto
>> > (riscv_expand_arch_from_cpu_upgrade_exts): New function. Wrapper 
>> > around
>> > riscv_expand_arch_from_cpu to preserve the function signature.
>> > (riscv_expand_arch_from_cpu_no_upgrade_exts): Ditto.
>> > * config/riscv/riscv-protos.h (riscv_arch_str): Add toggle to 
>> > function
>> > prototype.
>> > * config/riscv/riscv-subset.h: Ditto.
>> > * config/riscv/riscv-target-attr.cc (riscv_process_target_attr):
>> > * config/riscv/riscv.cc (riscv_emit_attribute):
>> > (riscv_declare_function_name):
>> > * config/riscv/riscv.h (riscv_expand_arch): Remove.
>> > (riscv_expand_arch_from_cpu): Ditto.
>> > (riscv_expand_arch_upgrade_exts): Add toggle wrapper functions.
>> > (riscv_expand_arch_no_upgrade_exts): Ditto.
>> > (riscv_expand_arch_from_cpu_upgrade_exts): Ditto.
>> > (riscv_expand_arch_from_cpu_no_upgrade_exts): Ditto.
>> > (EXTRA_SPEC_FUNCTIONS): Ditto.
>> > (OPTION_DEFAULT_SPECS): Use non-upgraded march string when 
>> > invoking the
>> > compiler.
>> > (ASM_SPEC): Use upgraded march string when invoking the assembler.
>> >
>> > Signed-off-by: Patrick O'Neill 
>> > ---
>> > v3 ChangeLog:
>> > Rebased on non-promoting patch.
>> > Wrap all Zaamo/Zalrsc upgrade code in #ifndef to prevent compiler
>> > warnings about unused/potentially undefined variables.
>> > Silence unused parameter warning with a voidcast.
>> > ---
>> > RFC since I'm not sure if this upgrade behavior is more trouble than
>> > it's worth - this is a pretty invasive change. Happy to iterate further
>> > or just drop these changes.
>> > ---
>> >  gcc/common/config/riscv/riscv-common.cc | 111 +---
>> >  gcc/config/riscv/riscv-protos.h |   3 +-
>> >  gcc/config/riscv/riscv-subset.h |   2 +-
>> >  gcc/config/riscv/riscv-target-attr.cc   |   4 +-
>> >  gcc/config/riscv/riscv.cc   |   7 +-
>> >  gcc/config/riscv/riscv.h|  46 ++
>> >  6 files changed, 137 insertions(+), 36 deletions(-)
>> >
>> > diff --git a/gcc/common/config/riscv/riscv-common.cc 
>> > b/gcc/common/config/riscv/riscv-common.cc
>> > index 1dc1d9904c7..05c26f73b73 100644
>> > --- a/gcc/common/config/riscv/riscv-common.cc
>> > +++ b/gcc/common/config/riscv/riscv-common.cc
>> > @@ -907,7 +907,7 @@ riscv_subset_list::add (const char *subset, bool 
>> > implied_p)
>> > VERSION_P to determine append version info or not.  */
>> >
>> >  std::string
>> > -riscv_subset_list::to_string (bool version_p) const
>> > +riscv_subset_list::to_string (bool version_p, bool upgrade_exts) const
>> >  {
>> >std::ostringstream oss;
>> >oss << "rv" << m_xlen;
>> > @@ -916,10 +916,17 @@ riscv_subset_list::to_string (bool version_p) const
>> >riscv_subset_t *subset;
>> >
>> >bool skip_zifencei = false;
>> > -  bool skip_zaamo_zalrsc = false;
>> >bool skip_zicsr = false;
>> >bool i2p0 = false;
>> >
>> > +#ifndef HAVE_AS_MARCH_ZAAMO_ZALRSC
>> > +  bool upgrade_zaamo_zalrsc = false;
>> > +  bool has_a_ext = false;
>> > +  bool insert_a_ext = 

Re: [RFC v3] RISC-V: Promote Zaamo/Zalrsc to a when using an old binutils

2024-06-17 Thread Patrick O'Neill
On Mon, Jun 17, 2024 at 5:51 PM Kito Cheng  wrote:

> Maybe just add 'a' to riscv_combine_info and other logic to keep the
> same (e.g. keep the logic for skip_zaamo_zalrsc)?


I did consider unconditionally upgrading zaamo/zalrsc to ‘a’ (I think
that’s what you’re suggesting w/ riscv_combine_info).
That could cause issues if users are trying to compile for a zalrsc-only
chip with an old version of binutils. If we upgrade zalrsc -> ‘a’ for both
cc1 and binutils then cc1 will emit amo ops instead of their lr/sc
equivalent.
GCC would end up emitting insns that are illegal for the user-provided
-march string.

Patrick


> On Tue, Jun 18, 2024 at 8:03 AM Patrick O'Neill 
> wrote:
> >
> > Binutils 2.42 and before don't support Zaamo/Zalrsc. Promote
> Zaamo/Zalrsc to
> > 'a' in the -march string when assembling.
> >
> > This change respects Zaamo/Zalrsc when generating code.
> >
> > Testcases that check for the default isa string will fail with the old
> binutils
> > since zaamo/zalrsc aren't emitted anymore. All other Zaamo/Zalrsc
> testcases
> > pass.
> >
> > gcc/ChangeLog:
> >
> > * common/config/riscv/riscv-common.cc
> > (riscv_subset_list::to_string): Add toggle to promote
> Zaamo/Zalrsc
> > extensions to 'a'.
> > (riscv_arch_str): Ditto.
> > (riscv_expand_arch): Ditto.
> > (riscv_expand_arch_from_cpu): Ditto.
> > (riscv_expand_arch_upgrade_exts): New function. Wrapper around
> > riscv_expand_arch to preserve the function signature.
> > (riscv_expand_arch_no_upgrade_exts): Ditto
> > (riscv_expand_arch_from_cpu_upgrade_exts): New function. Wrapper
> around
> > riscv_expand_arch_from_cpu to preserve the function signature.
> > (riscv_expand_arch_from_cpu_no_upgrade_exts): Ditto.
> > * config/riscv/riscv-protos.h (riscv_arch_str): Add toggle to
> function
> > prototype.
> > * config/riscv/riscv-subset.h: Ditto.
> > * config/riscv/riscv-target-attr.cc (riscv_process_target_attr):
> > * config/riscv/riscv.cc (riscv_emit_attribute):
> > (riscv_declare_function_name):
> > * config/riscv/riscv.h (riscv_expand_arch): Remove.
> > (riscv_expand_arch_from_cpu): Ditto.
> > (riscv_expand_arch_upgrade_exts): Add toggle wrapper functions.
> > (riscv_expand_arch_no_upgrade_exts): Ditto.
> > (riscv_expand_arch_from_cpu_upgrade_exts): Ditto.
> > (riscv_expand_arch_from_cpu_no_upgrade_exts): Ditto.
> > (EXTRA_SPEC_FUNCTIONS): Ditto.
> > (OPTION_DEFAULT_SPECS): Use non-upgraded march string when
> invoking the
> > compiler.
> > (ASM_SPEC): Use upgraded march string when invoking the
> assembler.
> >
> > Signed-off-by: Patrick O'Neill 
> > ---
> > v3 ChangeLog:
> > Rebased on non-promoting patch.
> > Wrap all Zaamo/Zalrsc upgrade code in #ifndef to prevent compiler
> > warnings about unused/potentially undefined variables.
> > Silence unused parameter warning with a voidcast.
> > ---
> > RFC since I'm not sure if this upgrade behavior is more trouble than
> > it's worth - this is a pretty invasive change. Happy to iterate further
> > or just drop these changes.
> > ---
> >  gcc/common/config/riscv/riscv-common.cc | 111 +---
> >  gcc/config/riscv/riscv-protos.h |   3 +-
> >  gcc/config/riscv/riscv-subset.h |   2 +-
> >  gcc/config/riscv/riscv-target-attr.cc   |   4 +-
> >  gcc/config/riscv/riscv.cc   |   7 +-
> >  gcc/config/riscv/riscv.h|  46 ++
> >  6 files changed, 137 insertions(+), 36 deletions(-)
> >
> > diff --git a/gcc/common/config/riscv/riscv-common.cc
> b/gcc/common/config/riscv/riscv-common.cc
> > index 1dc1d9904c7..05c26f73b73 100644
> > --- a/gcc/common/config/riscv/riscv-common.cc
> > +++ b/gcc/common/config/riscv/riscv-common.cc
> > @@ -907,7 +907,7 @@ riscv_subset_list::add (const char *subset, bool
> implied_p)
> > VERSION_P to determine append version info or not.  */
> >
> >  std::string
> > -riscv_subset_list::to_string (bool version_p) const
> > +riscv_subset_list::to_string (bool version_p, bool upgrade_exts) const
> >  {
> >std::ostringstream oss;
> >oss << "rv" << m_xlen;
> > @@ -916,10 +916,17 @@ riscv_subset_list::to_string (bool version_p) const
> >riscv_subset_t *subset;
> >
> >bool skip_zifencei = false;
> > -  bool skip_zaamo_zalrsc = false;
> >bool skip_zicsr = false;
> >bool i2p0 = false;
> >
> > +#ifndef HAVE_AS_MARCH_ZAAMO_ZALRSC
> > +  bool upgrade_zaamo_zalrsc = false;
> > +  bool has_a_ext = false;
> > +  bool insert_a_ext = false;
> > +  bool inserted_a_ext = false;
> > +  riscv_subset_t *a_subset;
> > +#endif
> > +
> >/* For RISC-V ISA version 2.2 or earlier version, zicsr and zifencei
> is
> >   included in the base ISA.  */
> >if (riscv_isa_spec == ISA_SPEC_CLASS_2P2)
> > @@ -945,8 +952,33 @@ riscv_subset_list::to_string (bool version_p) const
> >

[gcc(refs/users/meissner/heads/work169-bugs)] Update ChangeLog.*

2024-06-17 Thread Michael Meissner via Gcc-cvs
https://gcc.gnu.org/g:265d476e2940759ea23733e5eb57aecc05af495d

commit 265d476e2940759ea23733e5eb57aecc05af495d
Author: Michael Meissner 
Date:   Tue Jun 18 01:27:43 2024 -0400

Update ChangeLog.*

Diff:
---
 gcc/ChangeLog.bugs | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/gcc/ChangeLog.bugs b/gcc/ChangeLog.bugs
index 9a2af6e5eaf0..4bd3e28874b9 100644
--- a/gcc/ChangeLog.bugs
+++ b/gcc/ChangeLog.bugs
@@ -1,8 +1,8 @@
- Branch work169-bugs, patch #400 
+ Branch work169-bugs, patch #401 
 
 Do not build IEEE 128-bit support for little endian power5.
 
-2024-06-17  Michael Meissner  
+2024-06-18  Michael Meissner  
 
 gcc/
 
@@ -11,9 +11,10 @@ gcc/
 
 libgcc/
 
-   * config.host (powerpc*-linux*): Do not build the IEEE 128-bit support
-   libraries unless GCC is configured for at least power8 by default.
-   * configure.ac (powerpc*-linux*): Likewise.
+   * config.host (powerpc*-linux*): Do not enable ieee 128-bit hardware
+   support unless ieee 128-bit basic support is provided.
+   * configure.ac (powerpc*-linux*): Disable building libgcc on legacy
+   32-bit little endian systems which will never support VSX.
* configure: Regenerate.
 
 libgfortran/
@@ -24,6 +25,8 @@ libgfortran/
* kinds-override.h: Do not enable IEEE 128-bit floating point support on
little endian PowerPC that does not have VSX support.
 
+ Branch work169-bugs, patch #400 was reverted 

+
  Branch work169-bugs, patch #11 (work169 branch) 

 
 Add -mcpu=future tuning support.


[gcc(refs/users/meissner/heads/work169-bugs)] Do not build IEEE 128-bit support for little endian power5.

2024-06-17 Thread Michael Meissner via Gcc-cvs
https://gcc.gnu.org/g:92c13724e59b55c9b1c18082064a6889ac5fc06f

commit 92c13724e59b55c9b1c18082064a6889ac5fc06f
Author: Michael Meissner 
Date:   Tue Jun 18 01:26:07 2024 -0400

Do not build IEEE 128-bit support for little endian power5.

2024-06-18  Michael Meissner  

gcc/

* config/rs6000/rs6000.cc (rs6000_option_override_internal): Do not
allow IEEE 128-bit on little endian 32-bit systems.

libgcc/

* config.host (powerpc*-linux*): Do not enable ieee 128-bit hardware
support unless ieee 128-bit basic support is provided.
* configure.ac (powerpc*-linux*): Disable building libgcc on legacy
32-bit little endian systems which will never support VSX.
* configure: Regenerate.

libgfortran/

* configure.ac (powerpc64le*-linux*): Check to see that the compiler
uses VSX before enabling IEEE 128-bit support.
* configure: Regenerate.
* kinds-override.h: Do not enable IEEE 128-bit floating point 
support on
little endian PowerPC that does not have VSX support.

Diff:
---
 gcc/config/rs6000/rs6000.cc  | 13 -
 libgcc/config.host   | 14 --
 libgcc/configure | 19 +--
 libgcc/configure.ac  | 19 +--
 libgfortran/configure|  7 +--
 libgfortran/configure.ac |  3 +++
 libgfortran/kinds-override.h |  2 +-
 7 files changed, 55 insertions(+), 22 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index c5c4191127e4..ea36e651b446 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -4146,7 +4146,8 @@ rs6000_option_override_internal (bool global_init_p)
  the keyword as well as the type.  */
   TARGET_FLOAT128_TYPE = TARGET_FLOAT128_ENABLE_TYPE && TARGET_VSX;
 
-  /* IEEE 128-bit floating point requires VSX support.  */
+  /* IEEE 128-bit floating point requires VSX support.  Disable IEEE 128-bit on
+ legacy 32-bit LE systems.  */
   if (TARGET_FLOAT128_KEYWORD)
 {
   if (!TARGET_VSX)
@@ -4154,6 +4155,16 @@ rs6000_option_override_internal (bool global_init_p)
  if ((rs6000_isa_flags_explicit & OPTION_MASK_FLOAT128_KEYWORD) != 0)
error ("%qs requires VSX support", "-mfloat128");
 
+ TARGET_FLOAT128_TYPE = 0;
+ rs6000_isa_flags &= ~(OPTION_MASK_FLOAT128_KEYWORD
+   | OPTION_MASK_FLOAT128_HW);
+   }
+  else if (!TARGET_POWERPC64 && !BYTES_BIG_ENDIAN)
+   {
+ if ((rs6000_isa_flags_explicit & OPTION_MASK_FLOAT128_KEYWORD) != 0)
+   error ("%qs requires 64-bit support on little endian systems",
+  "-mfloat128");
+
  TARGET_FLOAT128_TYPE = 0;
  rs6000_isa_flags &= ~(OPTION_MASK_FLOAT128_KEYWORD
| OPTION_MASK_FLOAT128_HW);
diff --git a/libgcc/config.host b/libgcc/config.host
index 9fae51d4ce7d..9e3b21e98fdd 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -1290,16 +1290,18 @@ powerpc*-*-linux*)
;;
esac
 
+   # If the compiler is not configured for IEEE 128-bit, do not include the
+   # power9 and power10 hardware support libraries
if test $libgcc_cv_powerpc_float128 = yes; then
tmake_file="${tmake_file} rs6000/t-float128"
-   fi
 
-   if test $libgcc_cv_powerpc_float128_hw = yes; then
-   tmake_file="${tmake_file} rs6000/t-float128-hw"
-   fi
+   if test $libgcc_cv_powerpc_float128_hw = yes; then
+   tmake_file="${tmake_file} rs6000/t-float128-hw"
 
-   if test $libgcc_cv_powerpc_3_1_float128_hw = yes; then
-   tmake_file="${tmake_file} rs6000/t-float128-p10-hw"
+   if test $libgcc_cv_powerpc_3_1_float128_hw = yes; then
+   tmake_file="${tmake_file} 
rs6000/t-float128-p10-hw"
+   fi
+   fi
fi
 
extra_parts="$extra_parts ecrti.o ecrtn.o ncrti.o ncrtn.o"
diff --git a/libgcc/configure b/libgcc/configure
index a69d314374a3..7ac132b71693 100755
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -5180,13 +5180,14 @@ esac
 esac
 
 case ${host} in
-# At present, we cannot turn -mfloat128 on via #pragma GCC target, so just
-# check if we have VSX (ISA 2.06) support to build the software libraries, and
-# whether the assembler can handle xsaddqp for hardware support.  Also check if
-# a new glibc is being used so that __builtin_cpu_supports can be used.
+# Determine if the system can support VSX, which is needed to support
+# __float128.  Little endian 32-bit cannot be supported, since those systems do
+# not support VSX.  All of the little endian 64-bit systems require VSX support
+# (power8 and above).  With big endian, the default might not include VSX, but
+# we can build the libgcc __float128 

Results for 12.3.1 20240618 [remotes/origin/releases/gcc-12 r12-10563-gb87418f64b] (GCC) testsuite on powerpc64le-unknown-linux-gnu

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


git commit g:b87418f64ba0877bd90281a9142c280ccc08cbef
gcc-descr r12-10563-gb87418f64ba087

power9
Linux 5.15.0-112-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: Tue Jun 18 03:53:11 UTC 2024 (revision r12-10563-gb87418f64b)

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(refs/users/meissner/heads/work169-bugs)] Revert changes

2024-06-17 Thread Michael Meissner via Gcc-cvs
https://gcc.gnu.org/g:20308918164fce2de9c974514d2797cd4652cd12

commit 20308918164fce2de9c974514d2797cd4652cd12
Author: Michael Meissner 
Date:   Tue Jun 18 00:55:58 2024 -0400

Revert changes

Diff:
---
 gcc/config/rs6000/rs6000.cc  | 13 +
 libgcc/config.host   | 14 ++
 libgcc/configure |  9 +
 libgcc/configure.ac  |  9 +
 libgfortran/configure|  7 ++-
 libgfortran/configure.ac |  3 ---
 libgfortran/kinds-override.h |  2 +-
 7 files changed, 12 insertions(+), 45 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index ea36e651b446..c5c4191127e4 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -4146,8 +4146,7 @@ rs6000_option_override_internal (bool global_init_p)
  the keyword as well as the type.  */
   TARGET_FLOAT128_TYPE = TARGET_FLOAT128_ENABLE_TYPE && TARGET_VSX;
 
-  /* IEEE 128-bit floating point requires VSX support.  Disable IEEE 128-bit on
- legacy 32-bit LE systems.  */
+  /* IEEE 128-bit floating point requires VSX support.  */
   if (TARGET_FLOAT128_KEYWORD)
 {
   if (!TARGET_VSX)
@@ -4155,16 +4154,6 @@ rs6000_option_override_internal (bool global_init_p)
  if ((rs6000_isa_flags_explicit & OPTION_MASK_FLOAT128_KEYWORD) != 0)
error ("%qs requires VSX support", "-mfloat128");
 
- TARGET_FLOAT128_TYPE = 0;
- rs6000_isa_flags &= ~(OPTION_MASK_FLOAT128_KEYWORD
-   | OPTION_MASK_FLOAT128_HW);
-   }
-  else if (!TARGET_POWERPC64 && !BYTES_BIG_ENDIAN)
-   {
- if ((rs6000_isa_flags_explicit & OPTION_MASK_FLOAT128_KEYWORD) != 0)
-   error ("%qs requires 64-bit support on little endian systems",
-  "-mfloat128");
-
  TARGET_FLOAT128_TYPE = 0;
  rs6000_isa_flags &= ~(OPTION_MASK_FLOAT128_KEYWORD
| OPTION_MASK_FLOAT128_HW);
diff --git a/libgcc/config.host b/libgcc/config.host
index 9e3b21e98fdd..9fae51d4ce7d 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -1290,18 +1290,16 @@ powerpc*-*-linux*)
;;
esac
 
-   # If the compiler is not configured for IEEE 128-bit, do not include the
-   # power9 and power10 hardware support libraries
if test $libgcc_cv_powerpc_float128 = yes; then
tmake_file="${tmake_file} rs6000/t-float128"
+   fi
 
-   if test $libgcc_cv_powerpc_float128_hw = yes; then
-   tmake_file="${tmake_file} rs6000/t-float128-hw"
+   if test $libgcc_cv_powerpc_float128_hw = yes; then
+   tmake_file="${tmake_file} rs6000/t-float128-hw"
+   fi
 
-   if test $libgcc_cv_powerpc_3_1_float128_hw = yes; then
-   tmake_file="${tmake_file} 
rs6000/t-float128-p10-hw"
-   fi
-   fi
+   if test $libgcc_cv_powerpc_3_1_float128_hw = yes; then
+   tmake_file="${tmake_file} rs6000/t-float128-p10-hw"
fi
 
extra_parts="$extra_parts ecrti.o ecrtn.o ncrti.o ncrtn.o"
diff --git a/libgcc/configure b/libgcc/configure
index f61c9c9b3937..a69d314374a3 100755
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -5184,16 +5184,9 @@ case ${host} in
 # check if we have VSX (ISA 2.06) support to build the software libraries, and
 # whether the assembler can handle xsaddqp for hardware support.  Also check if
 # a new glibc is being used so that __builtin_cpu_supports can be used.
-#
-# Originally we added -mabi=altivec -mvsx to the tests to see if we could
-# support IEEE 128-bit.  This would mean that even if the compiler was
-# configured for power5, it would build the IEEE 128-bit libraries by adding
-# -mvsx.  Instead if you want IEEE 128-bit support, you have to configure the
-# compiler to build ISA 2.06 (power8) by default.  We do add -mfloat128 to
-# cater to systems where IEEE 128-bit might not be enabled by default.
 powerpc*-*-linux*)
   saved_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mfloat128"
+  CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128"
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PowerPC ISA 2.06 to 
build __float128 libraries" >&5
 $as_echo_n "checking for PowerPC ISA 2.06 to build __float128 libraries... " 
>&6; }
 if ${libgcc_cv_powerpc_float128+:} false; then :
diff --git a/libgcc/configure.ac b/libgcc/configure.ac
index d9941c0b1a6a..c2749fe09584 100644
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -407,16 +407,9 @@ case ${host} in
 # check if we have VSX (ISA 2.06) support to build the software libraries, and
 # whether the assembler can handle xsaddqp for hardware support.  Also check if
 # a new glibc is being used so that __builtin_cpu_supports can be used.
-#
-# Originally we added -mabi=altivec -mvsx to the tests to see if we could
-# support IEEE 128-bit.  This would mean that even if the compiler was
-# configured for power5, it 

Results for 15.0.0 20240618 (experimental) [master r15-1390-g792ebb0732] (GCC) testsuite on powerpc64-unknown-linux-gnu

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


git commit g:792ebb073252d2a4cecb0df23b6b702a8c55eec5
gcc-descr r15-1390-g792ebb073252d2

power9 BE
Linux 6.8.12-powerpc64 ppc64
GNU Make 4.3

DejaGnu:
DejaGnu version 1.6.3
Expect version  5.45.4
Tcl version 8.6

64-bit

LAST_UPDATED: Tue Jun 18 03:14:35 UTC 2024 (revision r15-1390-g792ebb0732)

Native configuration is powerpc64-unknown-linux-gnu

=== g++ tests ===


Running target unix/-m32
FAIL: c-c++-common/torture/strub-run3.c   -O0  execution test

=== g++ Summary for unix/-m32 ===

# of expected passes253304
# of unexpected failures1
# of expected failures  2617
# of unsupported tests  11611

Running target unix/-m64

=== g++ Summary for unix/-m64 ===

# of expected passes262326
# of expected failures  2622
# of unsupported tests  11784

=== g++ Summary ===

# of expected passes515630
# of unexpected failures1
# of expected failures  5239
# of unsupported tests  23395
/home/gccbuild/build/nightly/build-gcc-trunk/gcc/xg++  version 15.0.0 20240618 
(experimental) [master r15-1390-g792ebb0732] (GCC) 

=== gcc tests ===


Running target unix/-m32
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
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 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 

Results for 15.0.0 20240618 (experimental) [remotes/origin/HEAD r15-1389-g7c6f79eea9] (GCC) testsuite on powerpc64le-unknown-linux-gnu

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


git commit g:7c6f79eea9febce3b21c5783bac9b0a36e08f003
gcc-descr r15-1389-g7c6f79eea9febc

power8
Linux 5.4.0-182-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: Tue Jun 18 02:40:16 UTC 2024 (revision r15-1389-g7c6f79eea9)

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   -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   -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/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 -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 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 23 z == 8
FAIL: gcc.dg/guality/pr54519-2.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 17 y == 25
FAIL: 

Results for 15.0.0 20240618 (experimental) [remotes/origin/HEAD r15-1389-g7c6f79eea9f] (GCC) testsuite on powerpc64le-unknown-linux-gnu

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


git commit g:7c6f79eea9febce3b21c5783bac9b0a36e08f003
gcc-descr r15-1389-g7c6f79eea9febc

power9
Linux 5.15.0-112-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: Tue Jun 18 02:24:47 UTC 2024 (revision r15-1389-g7c6f79eea9f)

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   -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
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/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 -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 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 23 z == 8
FAIL: gcc.dg/guality/pr54519-2.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 17 y == 25
FAIL: gcc.dg/guality/pr54519-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 17 y == 25
FAIL: gcc.dg/guality/pr54519-3.c   -O1  -DPREVENT_OPTIMIZATION  line 20 x == 36
FAIL: 

[PATCH 1/2] aarch64: make thunderxt88p1 an alias of thunderxt88

2024-06-17 Thread Andrew Pinski
Since r7-6575-g71aba51d6460ff, thunderxt88 has been the same as thunderxt88p1 
so let's make
them a true alias and remove the odd variant handling and moves it below 
thunderxt88.

Bootstrapped and tested on aarch64-linux-gnu with no regressions.

gcc/ChangeLog:

* config/aarch64/aarch64-cores.def (thunderxt88p1): Make an alias of 
thunderxt88 and
move below thunderxt88.
* config/aarch64/aarch64-tune.md: Regenerate.

Signed-off-by: Andrew Pinski 
---
 gcc/config/aarch64/aarch64-cores.def | 5 ++---
 gcc/config/aarch64/aarch64-tune.md   | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/gcc/config/aarch64/aarch64-cores.def 
b/gcc/config/aarch64/aarch64-cores.def
index be60929e400..06a8213811c 100644
--- a/gcc/config/aarch64/aarch64-cores.def
+++ b/gcc/config/aarch64/aarch64-cores.def
@@ -58,10 +58,9 @@ AARCH64_CORE("cortex-a73",  cortexa73, cortexa57, V8A,  
(CRC), cortexa73, 0x41,
 
 /* Cavium ('C') cores. */
 AARCH64_CORE("thunderx",  thunderx,  thunderx,  V8A,  (CRC, CRYPTO), 
thunderx,  0x43, 0x0a0, -1)
-/* Do not swap around "thunderxt88p1" and "thunderxt88",
-   this order is required to handle variant correctly. */
-AARCH64_CORE("thunderxt88p1", thunderxt88p1, thunderx,  V8A,  (CRC, CRYPTO),   
thunderxt88,  0x43, 0x0a1, 0)
 AARCH64_CORE("thunderxt88",   thunderxt88,   thunderx,  V8A,  (CRC, CRYPTO), 
thunderxt88,  0x43, 0x0a1, -1)
+/* "thunderxt88p1 is just an alias for thunderxt88 now. */
+AARCH64_CORE("thunderxt88p1", thunderxt88p1, thunderx,  V8A,  (CRC, CRYPTO), 
thunderxt88,  0x43, 0x0a1, -1)
 
 /* OcteonTX is the official name for T81/T83. */
 AARCH64_CORE("octeontx",  octeontx,  thunderx,  V8A,  (CRC, CRYPTO), 
thunderx,  0x43, 0x0a0, -1)
diff --git a/gcc/config/aarch64/aarch64-tune.md 
b/gcc/config/aarch64/aarch64-tune.md
index ba940f1c890..9b1f32a0330 100644
--- a/gcc/config/aarch64/aarch64-tune.md
+++ b/gcc/config/aarch64/aarch64-tune.md
@@ -1,5 +1,5 @@
 ;; -*- buffer-read-only: t -*-
 ;; Generated automatically by gentune.sh from aarch64-cores.def
 (define_attr "tune"
-   
"cortexa34,cortexa35,cortexa53,cortexa57,cortexa72,cortexa73,thunderx,thunderxt88p1,thunderxt88,octeontx,octeontxt81,octeontxt83,thunderxt81,thunderxt83,ampere1,ampere1a,ampere1b,emag,xgene1,falkor,qdf24xx,exynosm1,phecda,thunderx2t99p1,vulcan,thunderx2t99,cortexa55,cortexa75,cortexa76,cortexa76ae,cortexa77,cortexa78,cortexa78ae,cortexa78c,cortexa65,cortexa65ae,cortexx1,cortexx1c,neoversen1,ares,neoversee1,octeontx2,octeontx2t98,octeontx2t96,octeontx2t93,octeontx2f95,octeontx2f95n,octeontx2f95mm,a64fx,tsv110,thunderx3t110,neoversev1,zeus,neoverse512tvb,saphira,oryon1,cortexa57cortexa53,cortexa72cortexa53,cortexa73cortexa35,cortexa73cortexa53,cortexa75cortexa55,cortexa76cortexa55,cortexr82,cortexa510,cortexa520,cortexa710,cortexa715,cortexa720,cortexx2,cortexx3,cortexx4,neoversen2,cobalt100,neoversev2,demeter,generic,generic_armv8_a,generic_armv9_a"
+   
"cortexa34,cortexa35,cortexa53,cortexa57,cortexa72,cortexa73,thunderx,thunderxt88,thunderxt88p1,octeontx,octeontxt81,octeontxt83,thunderxt81,thunderxt83,ampere1,ampere1a,ampere1b,emag,xgene1,falkor,qdf24xx,exynosm1,phecda,thunderx2t99p1,vulcan,thunderx2t99,cortexa55,cortexa75,cortexa76,cortexa76ae,cortexa77,cortexa78,cortexa78ae,cortexa78c,cortexa65,cortexa65ae,cortexx1,cortexx1c,neoversen1,ares,neoversee1,octeontx2,octeontx2t98,octeontx2t96,octeontx2t93,octeontx2f95,octeontx2f95n,octeontx2f95mm,a64fx,tsv110,thunderx3t110,neoversev1,zeus,neoverse512tvb,saphira,oryon1,cortexa57cortexa53,cortexa72cortexa53,cortexa73cortexa35,cortexa73cortexa53,cortexa75cortexa55,cortexa76cortexa55,cortexr82,cortexa510,cortexa520,cortexa710,cortexa715,cortexa720,cortexx2,cortexx3,cortexx4,neoversen2,cobalt100,neoversev2,demeter,generic,generic_armv8_a,generic_armv9_a"
(const (symbol_ref "((enum attr_tune) aarch64_tune)")))
-- 
2.43.0



[PATCH 2/2] aarch64: Add comment about thunderxt81/t83 being aliases

2024-06-17 Thread Andrew Pinski
Since these were already aliases just make it clear on that.

gcc/ChangeLog:

* config/aarch64/aarch64-cores.def: Add comment
saying thunderxt81/t83 are aliases of octeontx81/83.

Signed-off-by: Andrew Pinski 
---
 gcc/config/aarch64/aarch64-cores.def | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/config/aarch64/aarch64-cores.def 
b/gcc/config/aarch64/aarch64-cores.def
index 06a8213811c..0e05e81761c 100644
--- a/gcc/config/aarch64/aarch64-cores.def
+++ b/gcc/config/aarch64/aarch64-cores.def
@@ -67,6 +67,7 @@ AARCH64_CORE("octeontx",  octeontx,  thunderx,  V8A,  
(CRC, CRYPTO), thu
 AARCH64_CORE("octeontx81",octeontxt81,   thunderx,  V8A,  (CRC, CRYPTO), 
thunderx,  0x43, 0x0a2, -1)
 AARCH64_CORE("octeontx83",octeontxt83,   thunderx,  V8A,  (CRC, CRYPTO), 
thunderx,  0x43, 0x0a3, -1)
 
+/* thunderxt81/83 are aliases for octeontxt81/83. */
 AARCH64_CORE("thunderxt81",   thunderxt81,   thunderx,  V8A,  (CRC, CRYPTO), 
thunderx,  0x43, 0x0a2, -1)
 AARCH64_CORE("thunderxt83",   thunderxt83,   thunderx,  V8A,  (CRC, CRYPTO), 
thunderx,  0x43, 0x0a3, -1)
 
-- 
2.43.0



[PATCH 0/2] aarch64: Small cleanups of the cavium cores

2024-06-17 Thread Andrew Pinski
While thinking the variant patch I had posted, I went back to
look at the original cores which used the variant and saw there
was small cleanup for them since thunderx was no longer considered
a V8.1-a core but rather just a V8-a one; when I did that change
I didn't do the cleanups like is done in this patch set.
Note there is a core which uses the variant selection so we can't
remove the code there.

Andrew Pinski (2):
  aarch64: make thunderxt88p1 an alias of thunderxt88
  aarch64: Add comment about thunderxt81/t83 being aliases

 gcc/config/aarch64/aarch64-cores.def | 6 +++---
 gcc/config/aarch64/aarch64-tune.md   | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

-- 
2.43.0



[Bug tree-optimization/115531] vectorizer generates inefficient code for masked conditional update loops

2024-06-17 Thread tnfchris at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115531

--- Comment #3 from Tamar Christina  ---
(In reply to Andrew Pinski from comment #1)
> I suspect PR 20999 would fix this ...
> but we have to be careful since without masked stores, you could still
> vectorize this unlike the transformed version.
> 
> Maybe ifcvt can produce a masked store version if this pattern ...

doing so during ifcvt forces you to commit to a masked operation. So you loose
the ability to not vectorize for non-fully masked architectures.

So it's too early.  A vector pattern doesn't have this problem. This question
was mostly to what degree the vectorizer has support for MASK_STORE as an
input. vect_get_vector_types_for_stmt seems to have support for it so it looks
like it may work.

[Bug tree-optimization/115531] vectorizer generates inefficient code for masked conditional update loops

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

--- Comment #2 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #1)
> Maybe ifcvt can produce a masked store version if this pattern ...

Maybe add another argument to .MASK_STORE to say it was originally
unconditional store? Or something like that.

[Bug tree-optimization/115531] vectorizer generates inefficient code for masked conditional update loops

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

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug tree-optimization/115531] vectorizer generates inefficient code for masked conditional update loops

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

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2024-06-18
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=20999
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

--- Comment #1 from Andrew Pinski  ---
I suspect PR 20999 would fix this ...
but we have to be careful since without masked stores, you could still
vectorize this unlike the transformed version.

Maybe ifcvt can produce a masked store version if this pattern ...

[Bug tree-optimization/115531] New: vectorizer generates inefficient code for masked conditional update loops

2024-06-17 Thread tnfchris at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115531

Bug ID: 115531
   Summary: vectorizer generates inefficient code for masked
conditional update loops
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: tnfchris at gcc dot gnu.org
  Target Milestone: ---

The following code:

void __attribute__((noipa))
foo (char *restrict a, int *restrict b, int *restrict c, int n, int stride)
{
  if (stride <= 1)
return;

  for (int i = 0; i < n; i++)
{
  int res = c[i];
  int t = b[i+stride];
  if (a[i] != 0)
res = t;
  c[i] = res;
}
}

generates at -O3 -g0 -mcpu=generic+sve:

.L3:
ld1bz29.s, p7/z, [x0, x5]
ld1wz31.s, p7/z, [x2, x5, lsl 2]
ld1wz30.s, p7/z, [x1, x5, lsl 2]
cmpne   p15.b, p6/z, z29.b, #0
sel z30.s, p15, z30.s, z31.s
st1wz30.s, p7, [x2, x5, lsl 2]
add x5, x5, x4
whilelo p7.s, w5, w3
b.any   .L3
.L1:

and makes vectorization unprofitable until very high iterations of n.
This is because the vector code has more instructions than needed.

Since it's a masked store, whenever a value is being conditionally set we don't
need the intermediate VEC_COND_EXPR.  This loop can be vectorized as:

.L3:
ld1bz29.s, p7/z, [x0, x5]
ld1wz31.s, p7/z, [x2, x5, lsl 2]
cmpne   p4.b, p6/z, z29.b, #0
st1wz31.s, p4, [x2, x5, lsl 2]
add x5, x5, x4
whilelo p7.s, w5, w3
b.any   .L3
.L1:

I currently prototyped a load-to-store forward optimization in forwprop but
looking to move it into the vectorizer to cost it properly, however I'm not
entirely sure what the best way to do so is.

I can certainly fix it up during codegen but to cost it I need to do so during
analysis. I could detect it during vectorizable_condition but then the dead
load is still costed. Or I could maybe use a pattern, but unsure how to
represent the mask into the load.

Is it valid to produce a pattern with .IFN_MASK_STORE?

Re: [PATCH] rs6000: ROP - Do not disable shrink-wrapping for leaf functions [PR114759]

2024-06-17 Thread Peter Bergner
On 6/17/24 7:57 PM, Segher Boessenkool wrote:
> On Mon, Jun 17, 2024 at 06:49:18PM -0500, Peter Bergner wrote:
>> On 6/17/24 6:11 PM, Segher Boessenkool wrote:
>> Yeah, I didn't write that, I only moved it, but I can try to come up with
>> an explanation of why we need to disable it now.  That said, my hope is to
>> not have to disable shrink-wrapping even when we emit the ROP protect hash
>> insns in the future, but that will take some extra work.  If I can manage
>> that, then this should all just go away. :-)  Until then, we can stick
>> with this patch's micro-optimization.
> 
> If you inline one function into another, there is no ROP protection on
> their boundary anymore (since there is no such boundary anymore!)  This
> is not necessarily a problem, but you do want some noipa or similar
> markup where without ROP protection you have no incentive to do that.
> 
> Shrink-wrapping allows more inlining, and more inlining allows more
> shrink-wrapping, but there is no direct relation between shrink-wrapping
> and our ROP protect stuff?  We just need to make sure the hashst and
> hashchk things are done at the very start and the very end of the
> functions, but we need to make sure of that anyway!
> 
> So yeah, please investigate a bit more :-)

So we should be able to shrink-wrap in the presence of the ROP protection.
The ROP attacks work by buffer overrun type issues, clobbering the return
address that was saved on the stack causing us to return to somewhere else.
If we don't need to save the return address on the stack like for leaf
functions, or shrink-wrapped sections that are call free, those codes
are not really susceptible to ROP attacks.  It's the call paths where we
save the return address on the stack that we have to protect.  If inlining
or shrink wrapping increases the amount of code that is call free (ie, we
don't need to save the return address), then that code is not less safe
than before but as safe or safer than before.  It seems the reason we
disabled shrink-wrapping now, was that we were emitting the hashst in the
wrong location (PR101324) causing us to store a bad hash value.  I think
that was just a "bug" that probably should have been fixed rather than
worked around by disabling shrink-wrapping.  It's on my TODO to take a
look at fixing that correctly.





>> At the moment, yes, since the rop_ok test not only checks for the -mcpu= 
>> level,
>> it also verifies that the ABI is ok.
> 
> Ah right!  Add a short comment?

Can do.


>> Currently, rop_ok makes sure we have
>> Power10 and ELFv2 ABI being used.  So currently, if we were to run this test
>> on BE, we'd get an UNSUPPORTED using the rop_ok check, but if we removed it,
>> we'd see a FAIL.  
> 
> Yup.


Peter




Results for 15.0.0 20240618 (experimental) [master r15-1389-g7c6f79eea9f] (GCC) testsuite on i686-pc-linux-gnu

2024-06-17 Thread haochenj via Gcc-testresults
LAST_UPDATED: Tue Jun 18 01:25:08 UTC 2024 (revision r15-1389-g7c6f79eea9f)

Native configuration is i686-pc-linux-gnu

=== gcc tests ===


Running target unix
UNRESOLVED: gcc.c-torture/compile/2009-1.c   -O0 
UNRESOLVED: gcc.c-torture/compile/2009-1.c   -O1 
UNRESOLVED: gcc.c-torture/compile/2009-1.c   -O2 
UNRESOLVED: gcc.c-torture/compile/2009-1.c   -O2 -flto 
-fno-use-linker-plugin -flto-partition=none 
UNRESOLVED: gcc.c-torture/compile/2009-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects 
UNRESOLVED: gcc.c-torture/compile/2009-1.c   -O3 -g 
UNRESOLVED: gcc.c-torture/compile/2009-1.c   -Os 
UNRESOLVED: gcc.c-torture/compile/2009-2.c   -O0 
UNRESOLVED: gcc.c-torture/compile/2009-2.c   -O1 
UNRESOLVED: gcc.c-torture/compile/2009-2.c   -O2 
UNRESOLVED: gcc.c-torture/compile/2009-2.c   -O2 -flto 
-fno-use-linker-plugin -flto-partition=none 
UNRESOLVED: gcc.c-torture/compile/2009-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects 
UNRESOLVED: gcc.c-torture/compile/2009-2.c   -O3 -g 
UNRESOLVED: gcc.c-torture/compile/2009-2.c   -Os 
UNRESOLVED: gcc.c-torture/compile/981001-2.c   -O0 
UNRESOLVED: gcc.c-torture/compile/981001-2.c   -O1 
UNRESOLVED: gcc.c-torture/compile/981001-2.c   -O2 
UNRESOLVED: gcc.c-torture/compile/981001-2.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none 
UNRESOLVED: gcc.c-torture/compile/981001-2.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects 
UNRESOLVED: gcc.c-torture/compile/981001-2.c   -O3 -g 
UNRESOLVED: gcc.c-torture/compile/981001-2.c   -Os 
UNRESOLVED: gcc.c-torture/compile/pr61159.c   -O0 
UNRESOLVED: gcc.c-torture/compile/pr61159.c   -O1 
UNRESOLVED: gcc.c-torture/compile/pr61159.c   -O2 
UNRESOLVED: gcc.c-torture/compile/pr61159.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none 
UNRESOLVED: gcc.c-torture/compile/pr61159.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects 
UNRESOLVED: gcc.c-torture/compile/pr61159.c   -O3 -g 
UNRESOLVED: gcc.c-torture/compile/pr61159.c   -Os 
UNRESOLVED: gcc.c-torture/execute/20030125-1.c   -O0 
UNRESOLVED: gcc.c-torture/execute/20030125-1.c   -O1 
UNRESOLVED: gcc.c-torture/execute/20030125-1.c   -O2 
UNRESOLVED: gcc.c-torture/execute/20030125-1.c   -O2 -flto 
-fno-use-linker-plugin -flto-partition=none 
UNRESOLVED: gcc.c-torture/execute/20030125-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects 
UNRESOLVED: gcc.c-torture/execute/20030125-1.c   -O3 -g 
UNRESOLVED: gcc.c-torture/execute/20030125-1.c   -Os 
FAIL: gcc.dg/debug/dwarf2/asm-line1.c scan-assembler is_stmt 1
FAIL: gcc.dg/debug/dwarf2/discriminator.c scan-assembler loc [0-9] 11 [0-9]( 
is_stmt [0-9])? discriminator 1\\n
FAIL: gcc.dg/debug/dwarf2/discriminator.c scan-assembler loc [0-9] 11 [0-9]( 
is_stmt [0-9])? discriminator 2\\n
FAIL: gcc.dg/debug/dwarf2/discriminator.c scan-assembler loc [0-9] 11 [0-9]( 
is_stmt [0-9])?\\n
UNRESOLVED: c-c++-common/Waddress-5.c  -Wc++-compat 
UNRESOLVED: gcc.dg/Walways-true-2.c
FAIL: gcc.dg/Wstringop-overflow-14.c (test for excess errors)
FAIL: gcc.dg/Wstringop-overflow-14.c pr102706 (test for warnings, line 40)
UNRESOLVED: gcc.dg/attr-copy-6.c
UNRESOLVED: gcc.dg/attr-weak-hidden-1.c
UNRESOLVED: gcc.dg/attr-weak-hidden-1a.c
UNRESOLVED: gcc.dg/attr-weakref-1-darwin.c
UNRESOLVED: gcc.dg/attr-weakref-1.c
UNRESOLVED: gcc.dg/attr-weakref-2.c
UNRESOLVED: gcc.dg/attr-weakref-3.c
UNRESOLVED: gcc.dg/attr-weakref-4.c
UNRESOLVED: gcc.dg/darwin-weakimport-1.c
UNRESOLVED: gcc.dg/darwin-weakimport-2.c
UNRESOLVED: gcc.dg/darwin-weakimport-3.c
UNRESOLVED: gcc.dg/darwin-weakref-1.c
UNRESOLVED: gcc.dg/pr77587.c
UNRESOLVED: gcc.dg/pr77587a.c
UNRESOLVED: gcc.dg/pr84739.c
FAIL: gcc.dg/pr90263.c scan-assembler mempcpy
FAIL: gcc.dg/pr96573.c scan-tree-dump optimized 
"__builtin_bswap|VEC_PERM_EXPR[^\\n\\r]*7, 6, 5, 4, 3, 2, 1, 0"
UNRESOLVED: gcc.dg/visibility-21.c
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: gcc.dg/visibility-d.c scan-not-hidden 
FAIL: 

Results for 11.4.1 20240618 [releases/gcc-11 revision 594a2bf348:81c11ece82:7cd2198f58fbe8d1da81a79d4dfe10e1b7173aee] (GCC) testsuite on powerpc64le-unknown-linux-gnu

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


git commit g:7cd2198f58fbe8d1da81a79d4dfe10e1b7173aee
gcc-descr r11-11485-g7cd2198f58fbe8

power8
Linux 5.4.0-182-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: Tue Jun 18 01:15:30 UTC 2024 (revision 
594a2bf348:81c11ece82:7cd2198f58fbe8d1da81a79d4dfe10e1b7173aee)

Native configuration is powerpc64le-unknown-linux-gnu

=== gcc tests ===


Running target unix
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"
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   -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 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
XPASS: gcc.dg/guality/pr41353-1.c   -O0  line 28 j == 28 + 37
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: 

Results for 15.0.0 20240617 (experimental) [remotes/origin/HEAD r15-1384-g96db57948b] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-06-17 Thread Bill Seurer (POWER8) via Gcc-testresults
-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  -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  -DPREVENT_OPTIMIZATION  line 17 sizeof (a) 
== 6
FAIL: gcc.dg/guality/vla-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 17 sizeof (a) == 6
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-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 sizeof 
(a) == 6
FAIL: gcc.dg/guality/vla-1.c   -Os  -DPREVENT_OPTIMIZATION  line 17 sizeof (a) 
== 6
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
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/costmodel/ppc/costmodel-slp-12.c scan-tree-dump-times vect 
"vectorizing stmts using SLP" 3
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 passes179378
# of unexpected failures126
# of unexpected successes   13
# of expected failures  1600
# of unsupported tests  5065
/home/gccbuild/build/nightly/build-gcc-trunk/gcc/xgcc  version 15.0.0 20240617 
(experimental) [remotes/origin/HEAD r15-1384-g96db57948b] (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-loop

Results for 13.3.1 20240618 [releases/gcc-13 r13-8855-g3ff23396e8] (GCC) testsuite on powerpc64-unknown-linux-gnu

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


git commit g:3ff23396e864175e011fa3578346d2dda0b1572e
gcc-descr r13-8855-g3ff23396e86417

power9 BE
Linux 6.8.12-powerpc64 ppc64
GNU Make 4.3

DejaGnu:
DejaGnu version 1.6.3
Expect version  5.45.4
Tcl version 8.6

64-bit

LAST_UPDATED: Tue Jun 18 01:44:53 UTC 2024 (revision r13-8855-g3ff23396e8)

Native configuration is powerpc64-unknown-linux-gnu

=== g++ tests ===


Running target unix/-m32
FAIL: g++.dg/modules/xtreme-header-5_c.C -std=c++2a (test for excess errors)
FAIL: g++.dg/modules/xtreme-header-5_c.C -std=c++2b (test for excess errors)

=== g++ Summary for unix/-m32 ===

# of expected passes226136
# of unexpected failures2
# of expected failures  1929
# of unsupported tests  10899

Running target unix/-m64
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array + 3, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array - 1, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array, NULL, 36) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array + 3, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array - 1, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array, NULL, 36) execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O0  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O1  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O2  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O2 -flto 
-fno-use-linker-plugin -flto-partition=none  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O3 -g  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -Os  execution test

=== g++ Summary for unix/-m64 ===

# of expected passes235054
# of unexpected failures21
# of expected failures  1937
# of unsupported tests  11087

=== g++ Summary ===

# of expected passes461190
# of unexpected failures23
# of expected failures  3866
# of unsupported tests  21986
/home/gccbuild/build/nightly/build-gcc-13/gcc/xg++  version 13.3.1 20240618 
[releases/gcc-13 r13-8855-g3ff23396e8] (GCC) 

=== gcc tests ===


Running target unix/-m32
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/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: 

Re: [PATCH] rs6000, altivec-2-runnable.c update the require-effective-target

2024-06-17 Thread Kewen.Lin
Hi,

on 2024/6/18 00:08, Peter Bergner wrote:
> On 6/14/24 1:37 PM, Carl Love wrote:
>> Per the additional feedback after patch: 
>>
>>   commit c892525813c94b018464d5a4edc17f79186606b7
>>   Author: Carl Love 
>>   Date:   Tue Jun 11 14:01:16 2024 -0400
>>
>>   rs6000, altivec-2-runnable.c should be a runnable test
>> 
>>   The test case has "dg-do compile" set not "dg-do run" for a runnable
>>   test.  This patch changes the dg-do command argument to run.
>> 
>>   gcc/testsuite/ChangeLog:gcc/testsuite/ChangeLog:
>>   * gcc.target/powerpc/altivec-2-runnable.c: Change dg-do
>>   argument to run.
> 
> Test case altivec-1-runnable.c seems to have the same issue, in that it
> is currently a dg-do compile test case rather than the intended dg-do run.

Good catch!

> Can you have a look at changing that to dg-do run too?  My guess it that
> this one will want something similar to some other altivec test cases, ala:
> 
> /* { dg-do run { target vmx_hw } } */
> /* { dg-do compile { target { ! vmx_hw } } } */
> /* { dg-require-effective-target powerpc_altivec_ok } */
> /* { dg-options "-O2 -maltivec -mabi=altivec" } */

I'd expect the "-runnable" test case focuses on testing for run.  Normally,
the one without "-runnable" would focus on testing for compiling (scan some
desired insn), but this altivec-1.c and altivec-1-runnable.c seems to test
for different things, maybe we should separate them into different names
if they don't test for a same test point.

> 
> That said, I don't like not having a -mdejagnu-cpu=... here.
> I think for our server cpus, this is fine, but on an embedded system
> with a old ISA default for -mcpu=... (so we be doing a dg-do compile),
> just adding -maltivec to that default may not make much sense for that
> default and probably should be an error.  Maybe something like:

Yes, for some embedded cpus, there will be some error messages, but since
we have powerpc_altivec_ok effective target, the error would make that
effective target checking fail so I'd expect it'll stop it being tested
(unsupported).

> 
> /* { dg-do run { target vmx_hw } } */
> /* { dg-do compile { target { ! vmx_hw } } } */
> /* { dg-require-effective-target powerpc_altivec_ok } */
> /* { dg-options "-O2 -mdejagnu=power7" } */
> 
> ...makes more sense?   Ke Wen & Segher, thoughts on that?
> Ke Wen, should powerpc_altivec_ok be powerpc_altivec here???

Yes, I just pushed r15-1390 for this change.

BR,
Kewen



Re: [Patch-2v3, rs6000] Eliminate unnecessary byte swaps for duplicated constant vector store [PR113325]

2024-06-17 Thread Kewen.Lin
Hi Haochen,

on 2024/6/17 16:59, HAO CHEN GUI wrote:
> Hi,
>   This patch creates an insn_and_split pattern which helps the duplicated
> constant vector replace the source pseudo of store insn in fwprop pass.
> Thus the store can be implemented by a single stxvd2x and it eliminates the
> unnecessary byte swap insn on P8 LE. The test case shows the optimization.
> 
>   The patch depends on the first generic patch which uses insn cost in fwprop.
> 
>   Compared to previous version, the main change is to move
> "can_create_pseudo_p ()" to insn condition.
> 
>   Bootstrapped and tested on x86 and powerpc64-linux BE and LE with no
> regressions. Is it OK for trunk?

OK, thanks!

BR,
Kewen

> 
> Thanks
> Gui Haochen
> 
> 
> ChangeLog
> rs6000: Eliminate unnecessary byte swaps for duplicated constant vector store
> 
> gcc/
>   PR target/113325
>   * config/rs6000/vsx.md (vsx_stxvd2x4_le_const_): New.
> 
> gcc/testsuite/
>   PR target/113325
>   * gcc.target/powerpc/pr113325.c: New.
> 
> 
> patch.diff
> diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
> index f135fa079bd..d350c92141c 100644
> --- a/gcc/config/rs6000/vsx.md
> +++ b/gcc/config/rs6000/vsx.md
> @@ -3368,6 +3368,31 @@ (define_insn "*vsx_stxvd2x4_le_"
>"stxvd2x %x1,%y0"
>[(set_attr "type" "vecstore")])
> 
> +(define_insn_and_split "vsx_stxvd2x4_le_const_"
> +  [(set (match_operand:VSX_W 0 "memory_operand" "=Z")
> + (match_operand:VSX_W 1 "immediate_operand" "W"))]
> +  "!BYTES_BIG_ENDIAN
> +   && VECTOR_MEM_VSX_P (mode)
> +   && !TARGET_P9_VECTOR
> +   && const_vec_duplicate_p (operands[1])
> +   && can_create_pseudo_p ()"
> +  "#"
> +  "&& 1"
> +  [(set (match_dup 2)
> + (match_dup 1))
> +   (set (match_dup 0)
> + (vec_select:VSX_W
> +   (match_dup 2)
> +   (parallel [(const_int 2) (const_int 3)
> +  (const_int 0) (const_int 1)])))]
> +{
> +  /* Here all the constants must be loaded without memory.  */
> +  gcc_assert (easy_altivec_constant (operands[1], mode));
> +  operands[2] = gen_reg_rtx (mode);
> +}
> +  [(set_attr "type" "vecstore")
> +   (set_attr "length" "8")])
> +
>  (define_insn "*vsx_stxvd2x8_le_V8HI"
>[(set (match_operand:V8HI 0 "memory_operand" "=Z")
>  (vec_select:V8HI
> diff --git a/gcc/testsuite/gcc.target/powerpc/pr113325.c 
> b/gcc/testsuite/gcc.target/powerpc/pr113325.c
> new file mode 100644
> index 000..3ca1fcbc9ba
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/powerpc/pr113325.c
> @@ -0,0 +1,9 @@
> +/* { dg-do compile } */
> +/* { dg-options "-O2 -mdejagnu-cpu=power8 -mvsx" } */
> +/* { dg-require-effective-target powerpc_vsx } */
> +/* { dg-final { scan-assembler-not {\mxxpermdi\M} } } */
> +
> +void* foo (void* s1)
> +{
> +  return __builtin_memset (s1, 0, 32);
> +}



Re: [PATCH] rs6000: Compute rop_hash_save_offset for non-Altivec compiles [PR115389]

2024-06-17 Thread Kewen.Lin
on 2024/6/17 20:57, Peter Bergner wrote:
> On 6/16/24 9:40 PM, Kewen.Lin wrote:
>> on 2024/6/17 10:31, Peter Bergner wrote:
>>> On 6/16/24 9:10 PM, Kewen.Lin wrote:
 on 2024/6/15 01:05, Peter Bergner wrote:
> That said, the --with-cpu=power5 build without fortran did bootstrap and
> regtest with no regressions, so the build did test that code path and
> exposed no problems.

 OK, nice!  Thanks!
>>>
>>> I assume this means you're "OK" with the updated patch, correct?
>>
>> Yes, OK for trunk, thanks!
> 
> Thanks.  We will need backports to GCC 11, as it is broken back to when
> ROP was first added then.  I'll let things burn-in on trunk for a couple
> of days so Bill's CI builders have a chance to test it on all of our
> configs.  

OK for backporting too (if you still need an explicit OK).  Thanks!

BR,
Kewen



Results for 13.3.1 20240618 [releases/gcc-13 r13-8855-g3ff23396e8] (GCC) testsuite on powerpc64le-unknown-linux-gnu

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


git commit g:3ff23396e864175e011fa3578346d2dda0b1572e
gcc-descr r13-8855-g3ff23396e86417

power9
Linux 5.15.0-112-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: Tue Jun 18 01:07:08 UTC 2024 (revision r13-8855-g3ff23396e8)

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   -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   -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/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 -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 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 23 z == 8
FAIL: gcc.dg/guality/pr54519-2.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 17 y == 25
FAIL: 

Results for 15.0.0 20240618 (experimental) [master r15-1389-g7c6f79eea9f] (GCC) testsuite on x86_64-pc-linux-gnu

2024-06-17 Thread haochenj--- via Gcc-testresults
LAST_UPDATED: Tue Jun 18 01:25:11 UTC 2024 (revision r15-1389-g7c6f79eea9f)

Native configuration is x86_64-pc-linux-gnu

=== gcc tests ===


Running target unix
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
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  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-4.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 14 y == 2
FAIL: gcc.dg/guality/pr36728-4.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  

Results for 15.0.0 20240617 (experimental) [remotes/origin/HEAD r15-1385-gd78694c238] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-06-17 Thread Bill Seurer (POWER8) via Gcc-testresults
-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  -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  -DPREVENT_OPTIMIZATION  line 17 sizeof (a) 
== 6
FAIL: gcc.dg/guality/vla-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 17 sizeof (a) == 6
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-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 sizeof 
(a) == 6
FAIL: gcc.dg/guality/vla-1.c   -Os  -DPREVENT_OPTIMIZATION  line 17 sizeof (a) 
== 6
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
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/costmodel/ppc/costmodel-slp-12.c scan-tree-dump-times vect 
"vectorizing stmts using SLP" 3
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 passes179378
# of unexpected failures126
# of unexpected successes   13
# of expected failures  1600
# of unsupported tests  5065
/home/gccbuild/build/nightly/build-gcc-trunk/gcc/xgcc  version 15.0.0 20240617 
(experimental) [remotes/origin/HEAD r15-1385-gd78694c238] (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-loop

[Bug testsuite/114842] rs6000: Adjust some test cases with powerpc_vsx_ok

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

--- Comment #5 from GCC Commits  ---
The master branch has been updated by Kewen Lin :

https://gcc.gnu.org/g:792ebb073252d2a4cecb0df23b6b702a8c55eec5

commit r15-1390-g792ebb073252d2a4cecb0df23b6b702a8c55eec5
Author: Kewen Lin 
Date:   Mon Jun 17 21:46:53 2024 -0500

testsuite, rs6000: Replace powerpc_altivec_ok with powerpc_altivec
[PR114842]

As noted in PR114842, most of the test cases which require
effective target check powerpc_altivec_ok actually care about
if ALTIVEC feature is enabled, and they should adopt effective
target powerpc_altivec instead.  Otherwise, when users are
specifying extra option -mno-altivec in RUNTESTFLAGS, the check
powerpc_altivec_ok returns true then the test case would be
tested without ALTIVEC so it would fail.  With commit r15-716,
dg-options and dg-additional-options can be taken into account
when evaluating powerpc_altivec, so this patch also moves
dg-{additional,}-options lines before dg-require-effective-target
to make it effective.

PR testsuite/114842

gcc/testsuite/ChangeLog:

* c-c++-common/pr72747-1.c: Replace powerpc_altivec_ok with
powerpc_altivec, move dg-options and dg-additional-options lines
before dg-require-effective-target lines when it doesn't cause
any side effect like note message.
* c-c++-common/pr72747-2.c: Likewise.
* g++.dg/torture/pr79905.C: Likewise.
* g++.target/powerpc/altivec-1.C: Likewise.
* g++.target/powerpc/altivec-10.C: Likewise.
* g++.target/powerpc/altivec-11.C: Likewise.
* g++.target/powerpc/altivec-12.C: Likewise.
* g++.target/powerpc/altivec-13.C: Likewise.
* g++.target/powerpc/altivec-14.C: Likewise.
* g++.target/powerpc/altivec-15.C: Likewise.
* g++.target/powerpc/altivec-16.C: Likewise.
* g++.target/powerpc/altivec-17.C: Likewise.
* g++.target/powerpc/altivec-18.C: Likewise.
* g++.target/powerpc/altivec-2.C: Likewise.
* g++.target/powerpc/altivec-4.C: Likewise.
* g++.target/powerpc/altivec-5.C: Likewise.
* g++.target/powerpc/altivec-6.C: Likewise.
* g++.target/powerpc/altivec-7.C: Likewise.
* g++.target/powerpc/altivec-8.C: Likewise.
* g++.target/powerpc/altivec-9.C: Likewise.
* g++.target/powerpc/altivec-cell-1.C: Likewise.
* g++.target/powerpc/altivec-cell-5.C: Likewise.
* g++.target/powerpc/altivec-types-1.C: Likewise.
* g++.target/powerpc/altivec-types-2.C: Likewise.
* g++.target/powerpc/altivec-types-3.C: Likewise.
* g++.target/powerpc/altivec-types-4.C: Likewise.
* gcc.target/powerpc/altivec-1-runnable.c: Likewise.
* gcc.target/powerpc/altivec-11.c: Likewise.
* gcc.target/powerpc/altivec-13.c: Likewise.
* gcc.target/powerpc/altivec-14.c: Likewise.
* gcc.target/powerpc/altivec-15.c: Likewise.
* gcc.target/powerpc/altivec-16.c: Likewise.
* gcc.target/powerpc/altivec-17.c: Likewise.
* gcc.target/powerpc/altivec-18.c: Likewise.
* gcc.target/powerpc/altivec-19.c: Likewise.
* gcc.target/powerpc/altivec-2.c: Likewise.
* gcc.target/powerpc/altivec-21.c: Likewise.
* gcc.target/powerpc/altivec-22.c: Likewise.
* gcc.target/powerpc/altivec-23.c: Likewise.
* gcc.target/powerpc/altivec-25.c: Likewise.
* gcc.target/powerpc/altivec-26.c: Likewise.
* gcc.target/powerpc/altivec-27.c: Likewise.
* gcc.target/powerpc/altivec-28.c: Likewise.
* gcc.target/powerpc/altivec-29.c: Likewise.
* gcc.target/powerpc/altivec-30.c: Likewise.
* gcc.target/powerpc/altivec-31.c: Likewise.
* gcc.target/powerpc/altivec-32.c: Likewise.
* gcc.target/powerpc/altivec-33.c: Likewise.
* gcc.target/powerpc/altivec-34.c: Likewise.
* gcc.target/powerpc/altivec-35.c: Likewise.
* gcc.target/powerpc/altivec-36.c: Likewise.
* gcc.target/powerpc/altivec-4.c: Likewise.
* gcc.target/powerpc/altivec-5.c: Likewise.
* gcc.target/powerpc/altivec-6.c: Likewise.
* gcc.target/powerpc/altivec-7.c: Likewise.
* gcc.target/powerpc/altivec-8.c: Likewise.
* gcc.target/powerpc/altivec-9.c: Likewise.
* gcc.target/powerpc/altivec-cell-1.c: Likewise.
* gcc.target/powerpc/altivec-cell-5.c: Likewise.
* gcc.target/powerpc/altivec-cell-6.c: Likewise.
* gcc.target/powerpc/altivec-cell-7.c: Likewise.
* gcc.target/powerpc/altivec-perm-1.c: Likewise.
* gcc.target/powerpc/altivec-perm-2.c: Likewise.
   

Results for 15.0.0 20240617 (experimental) [master r15-1382-gedf514f83fa] (GCC) testsuite on x86_64-pc-linux-gnu

2024-06-17 Thread haochenj--- via Gcc-testresults
-assembler-times and|test 20
FAIL: gcc.dg/tree-ssa/slsr-31.c scan-tree-dump-times optimized " * 2" 1
FAIL: gcc.dg/vect/slp-perm-9.c -flto -ffat-lto-objects  scan-tree-dump-times 
vect "vectorizing stmts using SLP" 1
FAIL: gcc.dg/vect/slp-perm-9.c scan-tree-dump-times vect "vectorizing stmts 
using SLP" 1
XPASS: gcc.dg/vect/vect-reduc-in-order-1.c -flto -ffat-lto-objects execution 
test
XPASS: gcc.dg/vect/vect-reduc-in-order-1.c execution test
XPASS: gcc.dg/vect/vect-reduc-in-order-2.c -flto -ffat-lto-objects execution 
test
XPASS: gcc.dg/vect/vect-reduc-in-order-2.c execution test
XPASS: gcc.dg/vect/vect-reduc-in-order-3.c -flto -ffat-lto-objects execution 
test
XPASS: gcc.dg/vect/vect-reduc-in-order-3.c 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.target/i386/avx512bw-vmovdqu16-1.c scan-assembler-times 
(?:vmovdqu16|vextracti128)[ t]+[^{\\n]*%ymm[0-9]+[^\\n]*)(?:\\n|[ 
t]+#) 1
FAIL: gcc.target/i386/avx512bw-vmovdqu16-1.c scan-assembler-times 
(?:vmovdqu16|vinserti128)[ t]+[^{\\n]*)[^\\n]*%ymm[0-9]+(?:\\n|[ 
t]+#) 1
FAIL: gcc.target/i386/avx512dq-pr88465.c scan-assembler-times kxnorb[ \\t] 1
FAIL: gcc.target/i386/avx512f-pr88465.c scan-assembler-times kxnorw[ \\t] 1
FAIL: gcc.target/i386/avx512fp16-13.c scan-assembler-times vmovdqu16[ 
t]*[^,]*,[^{\\n]*%xmm[0-9] 1
FAIL: gcc.target/i386/avx512fp16-13.c scan-assembler-times vmovdqu16[ 
t]*[^,]*,[^{\\n]*%ymm[0-9] 1
FAIL: gcc.target/i386/avx512fp16-13.c scan-assembler-times vmovdqu16[ 
t]*[^{\\n]*%xmm[0-9], *[^,]* 1
FAIL: gcc.target/i386/avx512fp16-13.c scan-assembler-times vmovdqu16[ 
t]*[^{\\n]*%ymm[0-9], *[^,]* 1
XPASS: gcc.target/i386/bitwise_mask_op-3.c scan-assembler-times kmovb[\\t ] 4
XPASS: gcc.target/i386/bitwise_mask_op-3.c scan-assembler-times korb[\\t ] 1
XPASS: gcc.target/i386/bitwise_mask_op-3.c scan-assembler-times kxorb[\\t ] 1
FAIL: gcc.target/i386/minmax-10.c scan-assembler-not cmp
FAIL: gcc.target/i386/minmax-10.c scan-assembler-times test 6
FAIL: gcc.target/i386/pieces-memset-11.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 2
FAIL: gcc.target/i386/pieces-memset-14.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 1
FAIL: gcc.target/i386/pieces-memset-2.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 2
FAIL: gcc.target/i386/pieces-memset-20.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 2
FAIL: gcc.target/i386/pieces-memset-23.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 1
FAIL: gcc.target/i386/pieces-memset-29.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 2
FAIL: gcc.target/i386/pieces-memset-30.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 2
FAIL: gcc.target/i386/pieces-memset-33.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 1
FAIL: gcc.target/i386/pieces-memset-34.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 1
FAIL: gcc.target/i386/pieces-memset-37.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 2
FAIL: gcc.target/i386/pieces-memset-44.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 1
FAIL: gcc.target/i386/pieces-memset-5.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 1
FAIL: gcc.target/i386/pr31985.c scan-assembler-times movl 4
FAIL: gcc.target/i386/pr95483-5.c scan-assembler-times 
(?:vmovdqu8|vextracti128)[ t]+[^{\\n]*%ymm[0-9]+[^\\n]*)(?:\\n|[ 
t]+#) 1
FAIL: gcc.target/i386/pr95483-5.c scan-assembler-times 
(?:vmovdqu8|vinserti128)[ t]+[^{\\n]*)[^\\n]*%ymm[0-9]+(?:\\n|[ 
t]+#) 1
FAIL: gcc.target/i386/pr95483-6.c scan-assembler-times (?:vinserti128|vmovdqu)[ 
t]+[^{\\n]*)[^\\n]*%ymm[0-9]+(?:\\n|[ t]+#) 2
FAIL: gcc.target/i386/pr97873-1.c scan-assembler pabsq
FAIL: gcc.target/i386/vect-double-2.c scan-tree-dump-times vect "Vectorized 
loops: 1" 1
FAIL: gcc.target/i386/vect-shiftv4qi.c scan-assembler-times psrlw 5
FAIL: gcc.target/i386/vect-strided-3.c scan-assembler-times movq 4
FAIL: gcc.target/i386/xorsign.c scan-tree-dump-times vect "vectorized 2 loops" 1

=== gcc Summary for unix/-m32 ===

# of expected passes198451
# of unexpected failures159
# of unexpected successes   30
# of expected failures  1551
# of unsupported tests  4098

=== gcc Summary ===

# of expected passes403273
# of unexpected failures319
# of unexpected successes   50
# of expected failures  3096
# of unsupported tests  7408
/export/home/haochenj/src/gcc-regression/bld/gcc/xgcc  version 15.0.0 20240617 
(experimental) [master r15-1382-gedf514f83fa] (GCC) 

=== gfortran tests ===


Running target unix

=== gfortran Summary for unix ===

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

Running target unix/-m32

=== gfortran Summary for unix

Results for 15.0.0 20240617 (experimental) [master r15-1387-g17979deb15] (GCC) testsuite on powerpc64-unknown-linux-gnu

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


git commit g:17979deb15d34dd4f036ca93d2977d0fc4d556a7
gcc-descr r15-1387-g17979deb15d34d

power9 BE
Linux 6.8.12-powerpc64 ppc64
GNU Make 4.3

DejaGnu:
DejaGnu version 1.6.3
Expect version  5.45.4
Tcl version 8.6

64-bit

LAST_UPDATED: Mon Jun 17 23:58:08 UTC 2024 (revision r15-1387-g17979deb15)

Native configuration is powerpc64-unknown-linux-gnu

=== g++ tests ===


Running target unix/-m32
FAIL: c-c++-common/torture/strub-run3.c   -O0  execution test

=== g++ Summary for unix/-m32 ===

# of expected passes253304
# of unexpected failures1
# of expected failures  2617
# of unsupported tests  11611

Running target unix/-m64

=== g++ Summary for unix/-m64 ===

# of expected passes262326
# of expected failures  2622
# of unsupported tests  11784

=== g++ Summary ===

# of expected passes515630
# of unexpected failures1
# of expected failures  5239
# of unsupported tests  23395
/home/gccbuild/build/nightly/build-gcc-trunk/gcc/xg++  version 15.0.0 20240617 
(experimental) [master r15-1387-g17979deb15] (GCC) 

=== gcc tests ===


Running target unix/-m32
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
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 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

[Bug middle-end/115530] ICE: in verify_loop_structure, at cfgloop.cc:1741 with simd attribute and tm

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code

--- Comment #1 from Andrew Pinski  ---
-fgnu-tm is not well maintained but thanks for finding this bug.

Results for 15.0.0 20240617 (experimental) [master r15-1385-gd78694c238] (GCC) testsuite on powerpc64-unknown-linux-gnu

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


git commit g:d78694c238ccb0b530afe3fe5a7afbe7cda8ad4b
gcc-descr r15-1385-gd78694c238ccb0

power9 BE
Linux 6.8.12-powerpc64 ppc64
GNU Make 4.3

DejaGnu:
DejaGnu version 1.6.3
Expect version  5.45.4
Tcl version 8.6

64-bit

LAST_UPDATED: Mon Jun 17 22:30:04 UTC 2024 (revision r15-1385-gd78694c238)

Native configuration is powerpc64-unknown-linux-gnu

=== g++ tests ===


Running target unix/-m32
FAIL: c-c++-common/torture/strub-run3.c   -O0  execution test

=== g++ Summary for unix/-m32 ===

# of expected passes253304
# of unexpected failures1
# of expected failures  2617
# of unsupported tests  11611

Running target unix/-m64

=== g++ Summary for unix/-m64 ===

# of expected passes262326
# of expected failures  2622
# of unsupported tests  11784

=== g++ Summary ===

# of expected passes515630
# of unexpected failures1
# of expected failures  5239
# of unsupported tests  23395
/home/gccbuild/build/nightly/build-gcc-trunk/gcc/xg++  version 15.0.0 20240617 
(experimental) [master r15-1385-gd78694c238] (GCC) 

=== gcc tests ===


Running target unix/-m32
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
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 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

[Bug c/115530] New: ICE: in verify_loop_structure, at cfgloop.cc:1741 with simd attribute

2024-06-17 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115530

Bug ID: 115530
   Summary: ICE: in verify_loop_structure, at cfgloop.cc:1741 with
simd attribute
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/c4qPbxcr6

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
Using built-in specs.
COLLECT_GCC=/root/gcc_set/trunk-48a320a/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/trunk-48a320a/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/trunk-48a320a
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak --enable-coverage
--disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240426 (experimental) (GCC) 

***
Program:
$ cat mutant.c
void *malloc();
__attribute__((simd)) int a() {
  int *b = malloc();
  __transaction_atomic { b[5] = 3; }
  return b[5];
}

***
Command Lines:
$ gcc -fgnu-tm -O mutant.c
mutant.c: In function ‘a’:
mutant.c:3:12: warning: too few arguments to built-in function ‘malloc’
expecting 1 [-Wbuiltin-declaration-mismatch]
3 |   int *b = malloc();
  |^~
mutant.c:1:7: note: declared here
1 | void *malloc();
  |   ^~
mutant.c: In function ‘a.simdclone.0’:
mutant.c:2:27: error: size of loop 1 should be 8, not 9
2 | __attribute__((simd)) int a() {
  |   ^
during GIMPLE pass: tmmark
mutant.c:2:27: internal compiler error: in verify_loop_structure, at
cfgloop.cc:1741
0x118afec verify_loop_structure()
../../gcc/gcc/cfgloop.cc:1741
0x1b99d62 execute_function_todo
../../gcc/gcc/passes.cc:2105
0x1b97b22 do_per_function
../../gcc/gcc/passes.cc:1688
0x1b9a04c execute_todo
../../gcc/gcc/passes.cc:2143
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

Results for 15.0.0 20240617 (experimental) [remotes/origin/HEAD r15-1386-g67bc21af7ba] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-06-17 Thread Bill Seurer (POWER9) via Gcc-testresults
-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/guality/vla-1.c   -O2  -DPREVENT_OPTIMIZATION  line 17 sizeof (a) 
== 6
FAIL: gcc.dg/guality/vla-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 17 sizeof (a) == 6
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-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 sizeof 
(a) == 6
FAIL: gcc.dg/guality/vla-1.c   -Os  -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
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/costmodel/ppc/costmodel-slp-12.c scan-tree-dump-times vect 
"vectorizing stmts using SLP" 3
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 passes180409
# of unexpected failures107
# of unexpected successes   20
# of expected failures  1617
# of unsupported tests  4277
/home/gccbuild/build/nightly/build-gcc-trunk/gcc/xgcc  version 15.0.0 20240617 
(experimental) [remotes/origin/HEAD r15-1386-g67bc21af7ba] (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 passes70275
# of unexpected failures12
# of unexpected successes   6
# of expected failures  285
# of unsupported tests  17

[PING][PATCH] [tree-optimization/110279] fix testcase pr110279-1.c

2024-06-17 Thread Di Zhao OS
This is OK for trunk?

Thanks,
Di Zhao

> -Original Message-
> From: Di Zhao OS 
> Sent: Thursday, May 23, 2024 5:55 PM
> To: Jeff Law 
> Cc: gcc-patches@gcc.gnu.org
> Subject: RE: [PATCH] [tree-optimization/110279] fix testcase pr110279-1.c
> 
> > -Original Message-
> > From: Jeff Law 
> > Sent: Wednesday, May 22, 2024 11:14 PM
> > To: Di Zhao OS ; gcc-patches@gcc.gnu.org
> > Subject: Re: [PATCH] [tree-optimization/110279] fix testcase pr110279-1.c
> >
> >
> >
> > On 5/22/24 5:46 AM, Di Zhao OS wrote:
> > > The test case is for targets that support FMA. Previously
> > > the "target" selector is missed in dg-final command.
> > >
> > > Tested on x86_64-pc-linux-gnu.
> > >
> > > Thanks
> > > Di Zhao
> > >
> > > gcc/testsuite/ChangeLog:
> > >
> > >  * gcc.dg/pr110279-1.c: add target selector.
> > Rather than list targets explicitly in the test, wouldn't it be better
> > to have a common routine that could be used in other cases where we have
> > a test that requires FMA?
> >
> > So something similar to check_effective_target_scalar_all_fma?
> >
> >
> > Jeff
> 
> Here is an updated version of the patch. Sorry I'm not very familiar
> with the testsuite commands.
> 
> gcc/testsuite/ChangeLog:
> 
> * gcc.dg/pr110279-1.c: add target selector.
> 
> ---
> gcc/testsuite/gcc.dg/pr110279-1.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gcc/testsuite/gcc.dg/pr110279-1.c
> b/gcc/testsuite/gcc.dg/pr110279-1.c
> index a8c7257b28d..c4f94ea5810 100644
> --- a/gcc/testsuite/gcc.dg/pr110279-1.c
> +++ b/gcc/testsuite/gcc.dg/pr110279-1.c
> @@ -1,4 +1,4 @@
> -/* { dg-do compile } */
> +/* { dg-do compile { target { scalar_all_fma || { i?86-*-* x86_64-*-* } } } }
> */
>  /* { dg-options "-Ofast --param avoid-fma-max-bits=512 --param tree-reassoc-
> width=4 -fdump-tree-widening_mul-details" } */
>  /* { dg-additional-options "-mcpu=generic" { target aarch64*-*-* } } */
>  /* { dg-additional-options "-mfma" { target i?86-*-* x86_64-*-* } } */
> @@ -64,4 +64,4 @@ foo3 (data_e a, data_e b, data_e c, data_e d)
>return result;
>  }
> 
> -/* { dg-final { scan-tree-dump-times "Generated FMA" 3 "widening_mul"} } */
> \ No newline at end of file
> +/* { dg-final { scan-tree-dump-times "Generated FMA" 3 "widening_mul" } } */
> --
> 2.25.1
> 



[Bug tree-optimization/115529] Optimization with "bit mask and compare equality" ((x & C1) == C2), ((x | C3) == C4)

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

--- Comment #1 from Andrew Pinski  ---
>((x | C3) == C4)
shows up in PR 86975, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86975#c2
.

Results for 12.3.1 20240617 [remotes/origin/releases/gcc-12 r12-10562-gea0aa9765d] (GCC) testsuite on powerpc64-unknown-linux-gnu

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


git commit g:ea0aa9765d44baccce398ec92c30cb5f2e3e2e9d
gcc-descr r12-10562-gea0aa9765d44ba

power9 BE
Linux 6.8.12-powerpc64 ppc64
GNU Make 4.3

DejaGnu:
DejaGnu version 1.6.3
Expect version  5.45.4
Tcl version 8.6

64-bit

LAST_UPDATED: Mon Jun 17 16:15:12 UTC 2024 (revision r12-10562-gea0aa9765d)

Native configuration is powerpc64-unknown-linux-gnu

=== g++ tests ===


Running target unix/-m32

=== g++ Summary for unix/-m32 ===

# of expected passes219552
# of expected failures  1922
# of unsupported tests  10367

Running target unix/-m64
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array + 3, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array - 1, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array, NULL, 36) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array + 3, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array - 1, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array, NULL, 36) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O0  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O1  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O2  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O3 -g  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -Os  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O2 -flto 
-fno-use-linker-plugin -flto-partition=none  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test

=== g++ Summary for unix/-m64 ===

# of expected passes228255
# of unexpected failures21
# of expected failures  1930
# of unsupported tests  10551

=== g++ Summary ===

# of expected passes447807
# of unexpected failures21
# of expected failures  3852
# of unsupported tests  20918
/home/gccbuild/build/nightly/build-gcc-12/gcc/xg++  version 12.3.1 20240617 
[remotes/origin/releases/gcc-12 r12-10562-gea0aa9765d] (GCC) 

=== gcc tests ===


Running target unix/-m32
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   -O3 -g  (test for excess errors)
FAIL: gcc.dg/analyzer/torture/conftest-1.c   -Os  (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)
XPASS: gcc.dg/uninit-pred-7_a.c bogus warning (test for bogus messages, line 26)
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/vect/slp-24-big-array.c -flto -ffat-lto-objects  
scan

[Bug tree-optimization/115529] New: Optimization with "bit mask and compare equality" ((x & C1) == C2), ((x | C3) == C4)

2024-06-17 Thread Explorer09 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115529

Bug ID: 115529
   Summary: Optimization with "bit mask and compare equality" ((x
& C1) == C2), ((x | C3) == C4)
   Product: gcc
   Version: 14.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: Explorer09 at gmail dot com
  Target Milestone: ---

I thought this pattern is commonly seen, but I didn't find any issue report in
GCC mentioning this.

```c
#include 

bool pred_bitor(unsigned int x) {
return (x | 0x1F) == 0x381F;
}
bool pred_bitand(unsigned int x) {
return (x & ~(uint32_t)0x1F) == 0x3800;
}
bool pred_shift(unsigned int x) {
return (x >> 5) == (0x3800 >> 5);
}
```

The three predicates are equivalent, but GCC doesn't seem to recognize one can
be converted to another. Clang does recognize that, however.

My optimization request is this:
For the patterns ((x & C1) == C2) and ((x | C3) == C4), where C1 to C4 are all
compile time constants, try converting one code pattern to another, and figure
out which can generate faster or smaller code (or maybe both).

* If any constant happens to be already loaded into one register, then reusing
that constant can save code size by not needing to load the constant into
register for compare op. In other words, which pattern is the best depends a
lot on the surrounding code, as well is CPU instruction sets.

* My personal testing says that pred_bitand() can win in more cases than the
other two:
** In 32-bit ARM, the constant 0x3800 can fit into an immediate operand but
0x381F cannot, which means there would be an additional "mov" instruction for
0x381F.
** In RISC-V, the "andi" has a 16-bit encoding (with the "C"/Compressed
instruction extension) that works here, but there is no 16-bit encoding for
"ori" instruction.

* The pred_shift() case can work only if the mask constant is in the `((1 << N)
- 1)` form, or `((unsigned)-1 << M)` form. It doesn't work with all mask
constants but I think you knew that already.

Re: [PATCH] LoongArch: NFC: Dedup and sort the comment in loongarch_print_operand_reloc

2024-06-17 Thread Lulu Cheng

I think that's fine.

Thanks!

在 2024/6/16 下午5:11, Xi Ruoyao 写道:

gcc/ChangeLog:

* config/loongarch/loongarch.cc (loongarch_print_operand_reloc):
Dedup and sort the comment describing modifiers.
---

It's a non-functional change thus I've not tested it.  Ok for trunk?

  gcc/config/loongarch/loongarch.cc | 10 +-
  1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/gcc/config/loongarch/loongarch.cc 
b/gcc/config/loongarch/loongarch.cc
index 256b76d044b..dcb32a96577 100644
--- a/gcc/config/loongarch/loongarch.cc
+++ b/gcc/config/loongarch/loongarch.cc
@@ -6132,21 +6132,13 @@ loongarch_print_operand_reloc (FILE *file, rtx op, bool 
hi64_part,
 'T'Print 'f' for (eq:CC ...), 't' for (ne:CC ...),
  'z' for (eq:?I ...), 'n' for (ne:?I ...).
 't'Like 'T', but with the EQ/NE cases reversed
-   'F' Print the FPU branch condition for comparison OP.
-   'W' Print the inverse of the FPU branch condition for comparison OP.
-   'w' Print a LSX register.
 'u'Print a LASX register.
-   'T' Print 'f' for (eq:CC ...), 't' for (ne:CC ...),
- 'z' for (eq:?I ...), 'n' for (ne:?I ...).
-   't' Like 'T', but with the EQ/NE cases reversed
-   'Y' Print loongarch_fp_conditions[INTVAL (OP)]
-   'Z' Print OP and a comma for 8CC, otherwise print nothing.
-   'z' Print $0 if OP is zero, otherwise print OP normally.
 'v'Print the insn size suffix b, h, w or d for vector modes V16QI, 
V8HI,
  V4SI, V2SI, and w, d for vector modes V4SF, V2DF respectively.
 'V'Print exact log2 of CONST_INT OP element 0 of a replicated
  CONST_VECTOR in decimal.
 'W'Print the inverse of the FPU branch condition for comparison OP.
+   'w' Print a LSX register.
 'X'Print CONST_INT OP in hexadecimal format.
 'x'Print the low 16 bits of CONST_INT OP in hexadecimal format.
 'Y'Print loongarch_fp_conditions[INTVAL (OP)]




[gcc r15-1389] i386: Handle target of __builtin_ia32_cmp[p|s][s|d] from avx into sse/sse2/avx

2024-06-17 Thread Hu via Gcc-cvs
https://gcc.gnu.org/g:7c6f79eea9febce3b21c5783bac9b0a36e08f003

commit r15-1389-g7c6f79eea9febce3b21c5783bac9b0a36e08f003
Author: Hu, Lin1 
Date:   Wed Mar 20 16:01:45 2024 +0800

i386: Handle target of __builtin_ia32_cmp[p|s][s|d] from avx into 
sse/sse2/avx

gcc/ChangeLog:

* config/i386/avxintrin.h: Move cmp[p|s][s|d] to [e|x]mmintrin.h,
and move macros to xmmintrin.h
* config/i386/emmintrin.h: Add cmp[p|s]s intrins.
* config/i386/i386-builtin.def: Modify __builtin_ia32_cmp[p|s][s|d].
* config/i386/i386-expand.cc
(ix86_expand_args_builtin): Raise error when imm is in range of
[8, 32] without avx.
* config/i386/predicates.md (cmpps_imm_operand): New predicate.
* config/i386/sse.md (avx_cmp3): Modefy define_insn.
(avx_vmcmp3): Ditto.
* config/i386/xmmintrin.h (_CMP_EQ_OQ): New macro for sse/sse2.
(_CMP_LT_OS): Ditto
(_CMP_LE_OS): Ditto
(_CMP_UNORD_Q): Ditto
(_CMP_NEQ_UQ): Ditto
(_CMP_NLT_US): Ditto
(_CMP_NLE_US): Ditto
(_CMP_ORD_Q): Ditto
(_mm_cmp_ps): Move intrin from avxintrin.h to xmmintrin.h
(_mm_cmp_ss): Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/i386/sse-cmp-1.c: New test.
* gcc.target/i386/sse-cmp-2.c: Ditto.
* gcc.target/i386/sse-cmp-error.c: Ditto.

Diff:
---
 gcc/config/i386/avxintrin.h   | 56 
 gcc/config/i386/emmintrin.h   | 22 ++
 gcc/config/i386/i386-builtin.def  | 10 +--
 gcc/config/i386/i386-expand.cc|  6 ++
 gcc/config/i386/predicates.md |  5 ++
 gcc/config/i386/sse.md| 42 +++-
 gcc/config/i386/xmmintrin.h   | 41 
 gcc/testsuite/gcc.target/i386/sse-cmp-1.c | 20 ++
 gcc/testsuite/gcc.target/i386/sse-cmp-2.c | 96 +++
 gcc/testsuite/gcc.target/i386/sse-cmp-error.c | 16 +
 10 files changed, 236 insertions(+), 78 deletions(-)

diff --git a/gcc/config/i386/avxintrin.h b/gcc/config/i386/avxintrin.h
index 802145408881..ec9b9905b5f6 100644
--- a/gcc/config/i386/avxintrin.h
+++ b/gcc/config/i386/avxintrin.h
@@ -72,22 +72,6 @@ typedef double __m256d_u __attribute__ ((__vector_size__ 
(32),
 
 /* Compare predicates for scalar and packed compare intrinsics.  */
 
-/* Equal (ordered, non-signaling)  */
-#define _CMP_EQ_OQ 0x00
-/* Less-than (ordered, signaling)  */
-#define _CMP_LT_OS 0x01
-/* Less-than-or-equal (ordered, signaling)  */
-#define _CMP_LE_OS 0x02
-/* Unordered (non-signaling)  */
-#define _CMP_UNORD_Q   0x03
-/* Not-equal (unordered, non-signaling)  */
-#define _CMP_NEQ_UQ0x04
-/* Not-less-than (unordered, signaling)  */
-#define _CMP_NLT_US0x05
-/* Not-less-than-or-equal (unordered, signaling)  */
-#define _CMP_NLE_US0x06
-/* Ordered (nonsignaling)   */
-#define _CMP_ORD_Q 0x07
 /* Equal (unordered, non-signaling)  */
 #define _CMP_EQ_UQ 0x08
 /* Not-greater-than-or-equal (unordered, signaling)  */
@@ -381,18 +365,6 @@ _mm256_xor_ps (__m256 __A, __m256 __B)
 }
 
 #ifdef __OPTIMIZE__
-extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, 
__artificial__))
-_mm_cmp_pd (__m128d __X, __m128d __Y, const int __P)
-{
-  return (__m128d) __builtin_ia32_cmppd ((__v2df)__X, (__v2df)__Y, __P);
-}
-
-extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, 
__artificial__))
-_mm_cmp_ps (__m128 __X, __m128 __Y, const int __P)
-{
-  return (__m128) __builtin_ia32_cmpps ((__v4sf)__X, (__v4sf)__Y, __P);
-}
-
 extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, 
__artificial__))
 _mm256_cmp_pd (__m256d __X, __m256d __Y, const int __P)
 {
@@ -406,27 +378,7 @@ _mm256_cmp_ps (__m256 __X, __m256 __Y, const int __P)
   return (__m256) __builtin_ia32_cmpps256 ((__v8sf)__X, (__v8sf)__Y,
   __P);
 }
-
-extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, 
__artificial__))
-_mm_cmp_sd (__m128d __X, __m128d __Y, const int __P)
-{
-  return (__m128d) __builtin_ia32_cmpsd ((__v2df)__X, (__v2df)__Y, __P);
-}
-
-extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, 
__artificial__))
-_mm_cmp_ss (__m128 __X, __m128 __Y, const int __P)
-{
-  return (__m128) __builtin_ia32_cmpss ((__v4sf)__X, (__v4sf)__Y, __P);
-}
 #else
-#define _mm_cmp_pd(X, Y, P)\
-  ((__m128d) __builtin_ia32_cmppd ((__v2df)(__m128d)(X),   \
-  (__v2df)(__m128d)(Y), (int)(P)))
-
-#define _mm_cmp_ps(X, Y, P)\
-  ((__m128) __builtin_ia32_cmpps ((__v4sf)(__m128)(X), \
- (__v4sf)(__m128)(Y), (int)(P)))
-
 #define 

Results of testsuite (branch: releases/gcc-14; revision: r14-10322; build config: lto,O3,checking=release; languages: all; tasks: 16) on x86_64-linux-gnu.

2024-06-17 Thread Toon Moene
LAST_UPDATED: Mon Jun 17 22:53:58 UTC 2024 (revision r14-10322-g922648759b0)

Native configuration is x86_64-pc-linux-gnu

=== gcc tests ===


Running target unix

=== gcc Summary ===

# of expected passes199173
# of expected failures  1470
# of unsupported tests  3153
/home/toon/scratch/bld1200303/gcc/xgcc  version 14.1.1 20240617 
[releases/gcc-14 r14-10322-g922648759b0] (GCC) 

=== gdc tests ===


Running target unix

=== gdc Summary ===

# of expected passes13864
# of unsupported tests  1
/home/toon/scratch/bld1200303/gcc/gdc  version 14.1.1 20240617 [releases/gcc-14 
r14-10322-g922648759b0] (GCC) 

=== gfortran tests ===


Running target unix

=== gfortran Summary ===

# of expected passes70133
# of expected failures  273
# of unsupported tests  79
/home/toon/scratch/bld1200303/gcc/gfortran  version 14.1.1 20240617 
[releases/gcc-14 r14-10322-g922648759b0] (GCC) 

=== g++ tests ===


Running target unix

=== g++ Summary ===

# of expected passes263724
# of expected failures  2764
# of unsupported tests  11411
/home/toon/scratch/bld1200303/gcc/xg++  version 14.1.1 20240617 
[releases/gcc-14 r14-10322-g922648759b0] (GCC) 

=== gm2 tests ===


Running target unix

=== gm2 Summary ===

# of expected passes13874
=== go tests ===


Running target unix
FAIL: ./index0-out.go execution,  -O0 -g -fno-var-tracking-assignments 

=== go Summary ===

# of expected passes8897
# of unexpected failures1
# of untested testcases 6
# of unsupported tests  27
/home/toon/scratch/bld1200303/gcc/gccgo  version 14.1.1 20240617 
[releases/gcc-14 r14-10322-g922648759b0] (GCC) 

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


Running target unix

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

# of expected passes1503
# of expected failures  10
# of unsupported tests  79
/home/toon/scratch/bld1200303/gcc/xg++  version 14.1.1 20240617 
[releases/gcc-14 r14-10322-g922648759b0] (GCC) 

=== objc tests ===


Running target unix

=== objc Summary ===

# of expected passes2840
# of expected failures  6
# of unsupported tests  70
/home/toon/scratch/bld1200303/gcc/xgcc  version 14.1.1 20240617 
[releases/gcc-14 r14-10322-g922648759b0] (GCC) 

=== rust tests ===


Running target unix

=== rust Summary ===

# of expected passes8402
# of expected failures  69
# of unsupported tests  1
=== gotools tests ===


=== gotools Summary ===
# of expected passes416
# of untested testcases 130
/home/toon/scratch/bld1200303/./gcc/gccgo version 14.1.1 20240617 
[releases/gcc-14 r14-10322-g922648759b0] (GCC)

=== libatomic tests ===


Running target unix

=== libatomic Summary ===

# of expected passes54
=== libffi tests ===


Running target unix

=== libffi Summary ===

# of expected passes2304
=== libgo tests ===


Running target unix
FAIL: runtime/pprof

=== libgo Summary ===

# of expected passes195
# of unexpected failures1
/home/toon/scratch/bld1200303/./gcc/gccgo version 14.1.1 20240617 
[releases/gcc-14 r14-10322-g922648759b0] (GCC)

=== libgomp tests ===


Running target unix

=== libgomp Summary ===

# of expected passes16338
# of expected failures  285
# of unsupported tests  625
=== libitm tests ===


Running target unix

=== libitm Summary ===

# of expected passes44
# of expected failures  3
# of unsupported tests  1
=== libphobos tests ===


Running target unix

=== libphobos Summary ===

# of expected passes1067
=== libstdc++ tests ===


Running target unix

=== libstdc++ Summary ===

# of expected passes17601
# of expected failures  126
# of unsupported tests  737

Compiler version: 14.1.1 20240617 [releases/gcc-14 r14-10322-g922648759b0] 
(GCC) 
Platform: x86_64-pc-linux-gnu
configure flags: --prefix=/home/toon/compilers/install/gcc-14 --with-gnu-as 
--with-gnu-ld --enable-languages=all --disable-multilib --disable-nls 
--with-build-config=bootstrap-lto --with-build-config=bootstrap-O3 
--enable-checking=release


Re: [PATCH] rs6000: ROP - Do not disable shrink-wrapping for leaf functions [PR114759]

2024-06-17 Thread Segher Boessenkool
Hi!

On Mon, Jun 17, 2024 at 06:49:18PM -0500, Peter Bergner wrote:
> On 6/17/24 6:11 PM, Segher Boessenkool wrote:
> >> -  /* If we are inserting ROP-protect instructions, disable shrink wrap.  
> >> */
> >> -  if (rs6000_rop_protect)
> >> -flag_shrink_wrap = 0;
> >>  }
> > 
> > (Yes, I know the original code didn't say either, but let's try to make
> > things better :-) )
> 
> Yeah, I didn't write that, I only moved it, but I can try to come up with
> an explanation of why we need to disable it now.  That said, my hope is to
> not have to disable shrink-wrapping even when we emit the ROP protect hash
> insns in the future, but that will take some extra work.  If I can manage
> that, then this should all just go away. :-)  Until then, we can stick
> with this patch's micro-optimization.

If you inline one function into another, there is no ROP protection on
their boundary anymore (since there is no such boundary anymore!)  This
is not necessarily a problem, but you do want some noipa or similar
markup where without ROP protection you have no incentive to do that.

Shrink-wrapping allows more inlining, and more inlining allows more
shrink-wrapping, but there is no direct relation between shrink-wrapping
and our ROP protect stuff?  We just need to make sure the hashst and
hashchk things are done at the very start and the very end of the
functions, but we need to make sure of that anyway!

So yeah, please investigate a bit more :-)

> >> --- /dev/null
> >> +++ b/gcc/testsuite/gcc.target/powerpc/pr114759-1.c
> >> @@ -0,0 +1,16 @@
> >> +/* { dg-do compile } */
> >> +/* { dg-options "-O2 -mdejagnu-cpu=power10 -mrop-protect 
> >> -fdump-rtl-pro_and_epilogue" } */
> >> +/* { dg-require-effective-target rop_ok } */
> > 
> > Do you want rop_ok while you are *forcing* it to be okay anyway?  Why?
> 
> At the moment, yes, since the rop_ok test not only checks for the -mcpu= 
> level,
> it also verifies that the ABI is ok.

Ah right!  Add a short comment?

> Currently, rop_ok makes sure we have
> Power10 and ELFv2 ABI being used.  So currently, if we were to run this test
> on BE, we'd get an UNSUPPORTED using the rop_ok check, but if we removed it,
> we'd see a FAIL.  

Yup.

> As we discussed offline, the plan is to eventually enable emitting the ROP 
> protect
> hash insns on other ABIs, but until then, I think we want to keep the rop_ok 
> check
> so as to keep Bill's CI builder from flagging it as a FAIL.

:-)


Segher


Re: [RFC v3] RISC-V: Promote Zaamo/Zalrsc to a when using an old binutils

2024-06-17 Thread Kito Cheng
Maybe just add 'a' to riscv_combine_info and other logic to keep the
same (e.g. keep the logic for skip_zaamo_zalrsc)?

On Tue, Jun 18, 2024 at 8:03 AM Patrick O'Neill  wrote:
>
> Binutils 2.42 and before don't support Zaamo/Zalrsc. Promote Zaamo/Zalrsc to
> 'a' in the -march string when assembling.
>
> This change respects Zaamo/Zalrsc when generating code.
>
> Testcases that check for the default isa string will fail with the old 
> binutils
> since zaamo/zalrsc aren't emitted anymore. All other Zaamo/Zalrsc testcases
> pass.
>
> gcc/ChangeLog:
>
> * common/config/riscv/riscv-common.cc
> (riscv_subset_list::to_string): Add toggle to promote Zaamo/Zalrsc
> extensions to 'a'.
> (riscv_arch_str): Ditto.
> (riscv_expand_arch): Ditto.
> (riscv_expand_arch_from_cpu): Ditto.
> (riscv_expand_arch_upgrade_exts): New function. Wrapper around
> riscv_expand_arch to preserve the function signature.
> (riscv_expand_arch_no_upgrade_exts): Ditto
> (riscv_expand_arch_from_cpu_upgrade_exts): New function. Wrapper 
> around
> riscv_expand_arch_from_cpu to preserve the function signature.
> (riscv_expand_arch_from_cpu_no_upgrade_exts): Ditto.
> * config/riscv/riscv-protos.h (riscv_arch_str): Add toggle to function
> prototype.
> * config/riscv/riscv-subset.h: Ditto.
> * config/riscv/riscv-target-attr.cc (riscv_process_target_attr):
> * config/riscv/riscv.cc (riscv_emit_attribute):
> (riscv_declare_function_name):
> * config/riscv/riscv.h (riscv_expand_arch): Remove.
> (riscv_expand_arch_from_cpu): Ditto.
> (riscv_expand_arch_upgrade_exts): Add toggle wrapper functions.
> (riscv_expand_arch_no_upgrade_exts): Ditto.
> (riscv_expand_arch_from_cpu_upgrade_exts): Ditto.
> (riscv_expand_arch_from_cpu_no_upgrade_exts): Ditto.
> (EXTRA_SPEC_FUNCTIONS): Ditto.
> (OPTION_DEFAULT_SPECS): Use non-upgraded march string when invoking 
> the
> compiler.
> (ASM_SPEC): Use upgraded march string when invoking the assembler.
>
> Signed-off-by: Patrick O'Neill 
> ---
> v3 ChangeLog:
> Rebased on non-promoting patch.
> Wrap all Zaamo/Zalrsc upgrade code in #ifndef to prevent compiler
> warnings about unused/potentially undefined variables.
> Silence unused parameter warning with a voidcast.
> ---
> RFC since I'm not sure if this upgrade behavior is more trouble than
> it's worth - this is a pretty invasive change. Happy to iterate further
> or just drop these changes.
> ---
>  gcc/common/config/riscv/riscv-common.cc | 111 +---
>  gcc/config/riscv/riscv-protos.h |   3 +-
>  gcc/config/riscv/riscv-subset.h |   2 +-
>  gcc/config/riscv/riscv-target-attr.cc   |   4 +-
>  gcc/config/riscv/riscv.cc   |   7 +-
>  gcc/config/riscv/riscv.h|  46 ++
>  6 files changed, 137 insertions(+), 36 deletions(-)
>
> diff --git a/gcc/common/config/riscv/riscv-common.cc 
> b/gcc/common/config/riscv/riscv-common.cc
> index 1dc1d9904c7..05c26f73b73 100644
> --- a/gcc/common/config/riscv/riscv-common.cc
> +++ b/gcc/common/config/riscv/riscv-common.cc
> @@ -907,7 +907,7 @@ riscv_subset_list::add (const char *subset, bool 
> implied_p)
> VERSION_P to determine append version info or not.  */
>
>  std::string
> -riscv_subset_list::to_string (bool version_p) const
> +riscv_subset_list::to_string (bool version_p, bool upgrade_exts) const
>  {
>std::ostringstream oss;
>oss << "rv" << m_xlen;
> @@ -916,10 +916,17 @@ riscv_subset_list::to_string (bool version_p) const
>riscv_subset_t *subset;
>
>bool skip_zifencei = false;
> -  bool skip_zaamo_zalrsc = false;
>bool skip_zicsr = false;
>bool i2p0 = false;
>
> +#ifndef HAVE_AS_MARCH_ZAAMO_ZALRSC
> +  bool upgrade_zaamo_zalrsc = false;
> +  bool has_a_ext = false;
> +  bool insert_a_ext = false;
> +  bool inserted_a_ext = false;
> +  riscv_subset_t *a_subset;
> +#endif
> +
>/* For RISC-V ISA version 2.2 or earlier version, zicsr and zifencei is
>   included in the base ISA.  */
>if (riscv_isa_spec == ISA_SPEC_CLASS_2P2)
> @@ -945,8 +952,33 @@ riscv_subset_list::to_string (bool version_p) const
>skip_zifencei = true;
>  #endif
>  #ifndef HAVE_AS_MARCH_ZAAMO_ZALRSC
> -  /* Skip since binutils 2.42 and earlier don't recognize zaamo/zalrsc.  */
> -  skip_zaamo_zalrsc = true;
> +  /* Upgrade Zaamo/Zalrsc extensions to 'a' since binutils 2.42 and earlier
> + don't recognize zaamo/zalrsc.  */
> +  upgrade_zaamo_zalrsc = upgrade_exts;
> +  if (upgrade_zaamo_zalrsc)
> +{
> +  for (subset = m_head; subset != NULL; subset = subset->next)
> +   {
> + if (subset->name == "a")
> +   has_a_ext = true;
> + if (subset->name == "zaamo" || subset->name == "zalrsc")
> +   insert_a_ext = true;
> +   }
> +  if (insert_a_ext && !has_a_ext)
> +   {
> +

Results for 15.0.0 20240617 (experimental) [master r15-1385-gd78694c238c] (GCC) testsuite on i686-pc-linux-gnu

2024-06-17 Thread haochenj via Gcc-testresults
86/vect-strided-3.c scan-assembler-times movq 4
FAIL: gcc.target/i386/vect-strided-4.c scan-assembler-times movhps 2
FAIL: gcc.target/i386/vect-strided-4.c scan-assembler-times movq 2
FAIL: gcc.target/i386/xorsign.c scan-tree-dump-times vect "vectorized 2 loops" 1

=== gcc Summary ===

# of expected passes197063
# of unexpected failures236
# of unexpected successes   27
# of expected failures  1501
# of unresolved testcases   114
# of unsupported tests  4218
/home/haochenj/src/gcc-regression/bld/gcc/xgcc  version 15.0.0 20240617 
(experimental) [master r15-1385-gd78694c238c] (GCC) 

=== gfortran tests ===


Running target unix
UNRESOLVED: gfortran.dg/weak-1.f90   -O 
UNRESOLVED: gfortran.dg/weak-2.f90   -O 
UNRESOLVED: gfortran.dg/weak-3.f90   -O 

    === gfortran Summary ===

# of expected passes70180
# of expected failures  275
# of unresolved testcases   3
# of unsupported tests  233
/home/haochenj/src/gcc-regression/bld/gcc/gfortran  version 15.0.0 20240617 
(experimental) [master r15-1385-gd78694c238c] (GCC) 

=== g++ tests ===


Running target unix
UNRESOLVED: g++.dg/debug/dwarf2/inline-var-1.C  -std=gnu++14
UNRESOLVED: g++.dg/debug/dwarf2/inline-var-1.C  -std=gnu++17
UNRESOLVED: g++.dg/debug/dwarf2/inline-var-1.C  -std=gnu++20
UNRESOLVED: g++.dg/debug/dwarf2/inline-var-1.C  -std=gnu++98
UNRESOLVED: g++.dg/debug/dwarf2/inline-var-2.C  -std=gnu++14
UNRESOLVED: g++.dg/debug/dwarf2/inline-var-2.C  -std=gnu++17
UNRESOLVED: g++.dg/debug/dwarf2/inline-var-2.C  -std=gnu++20
UNRESOLVED: g++.dg/debug/dwarf2/inline-var-2.C  -std=gnu++98
UNRESOLVED: g++.dg/debug/dwarf2/inline-var-3.C  -std=gnu++14
UNRESOLVED: g++.dg/debug/dwarf2/inline-var-3.C  -std=gnu++17
UNRESOLVED: g++.dg/debug/dwarf2/inline-var-3.C  -std=gnu++20
UNRESOLVED: g++.dg/debug/dwarf2/inline-var-3.C  -std=gnu++98
UNRESOLVED: c-c++-common/Waddress-5.c  -std=gnu++14
UNRESOLVED: c-c++-common/Waddress-5.c  -std=gnu++17
UNRESOLVED: c-c++-common/Waddress-5.c  -std=gnu++20
UNRESOLVED: c-c++-common/Waddress-5.c  -std=gnu++98
UNRESOLVED: g++.dg/abi/anon2.C  -std=c++14
UNRESOLVED: g++.dg/abi/anon2.C  -std=c++17
UNRESOLVED: g++.dg/abi/anon2.C  -std=c++20
UNRESOLVED: g++.dg/abi/anon2.C  -std=c++98
UNRESOLVED: g++.dg/abi/anon3.C  -std=c++14
UNRESOLVED: g++.dg/abi/anon3.C  -std=c++17
UNRESOLVED: g++.dg/abi/anon3.C  -std=c++20
UNRESOLVED: g++.dg/abi/anon3.C  -std=c++98
UNRESOLVED: g++.dg/abi/mangle40.C  -std=gnu++14
UNRESOLVED: g++.dg/abi/mangle40.C  -std=gnu++17
UNRESOLVED: g++.dg/abi/mangle40.C  -std=gnu++20
UNRESOLVED: g++.dg/abi/mangle40.C  -std=gnu++98
UNRESOLVED: g++.dg/abi/rtti3.C  -std=c++14
UNRESOLVED: g++.dg/abi/rtti3.C  -std=c++17
UNRESOLVED: g++.dg/abi/rtti3.C  -std=c++20
UNRESOLVED: g++.dg/abi/rtti3.C  -std=c++98
UNRESOLVED: g++.dg/abi/thunk3.C  -std=c++14
UNRESOLVED: g++.dg/abi/thunk3.C  -std=c++17
UNRESOLVED: g++.dg/abi/thunk3.C  -std=c++20
UNRESOLVED: g++.dg/abi/thunk3.C  -std=c++98
UNRESOLVED: g++.dg/abi/thunk4.C  -std=c++14
UNRESOLVED: g++.dg/abi/thunk4.C  -std=c++17
UNRESOLVED: g++.dg/abi/thunk4.C  -std=c++20
UNRESOLVED: g++.dg/abi/thunk4.C  -std=c++98
UNRESOLVED: g++.dg/abi/thunk5.C  -std=c++14
UNRESOLVED: g++.dg/abi/thunk5.C  -std=c++17
UNRESOLVED: g++.dg/abi/thunk5.C  -std=c++20
UNRESOLVED: g++.dg/abi/thunk5.C  -std=c++98
UNRESOLVED: g++.dg/cpp0x/lambda/lambda-mangle.C  -std=gnu++14
UNRESOLVED: g++.dg/cpp0x/lambda/lambda-mangle.C  -std=gnu++17
UNRESOLVED: g++.dg/cpp0x/lambda/lambda-mangle.C  -std=gnu++20
UNRESOLVED: g++.dg/cpp0x/lambda/lambda-mangle.C  -std=gnu++98
UNRESOLVED: g++.dg/cpp0x/lambda/lambda-mangle6.C  -std=gnu++14
UNRESOLVED: g++.dg/cpp0x/lambda/lambda-mangle6.C  -std=gnu++17
UNRESOLVED: g++.dg/cpp0x/lambda/lambda-mangle6.C  -std=gnu++20
UNRESOLVED: g++.dg/cpp0x/lambda/lambda-mangle6.C  -std=gnu++98
UNRESOLVED: g++.dg/cpp0x/pr84497.C  -std=c++14
UNRESOLVED: g++.dg/cpp0x/pr84497.C  -std=c++17
UNRESOLVED: g++.dg/cpp0x/pr84497.C  -std=c++20
UNRESOLVED: g++.dg/cpp0x/pr84497.C  -std=c++98
UNRESOLVED: g++.dg/cpp1z/decomp41.C  -std=gnu++14
UNRESOLVED: g++.dg/cpp1z/decomp41.C  -std=gnu++17
UNRESOLVED: g++.dg/cpp1z/decomp41.C  -std=gnu++20
UNRESOLVED: g++.dg/cpp1z/decomp41.C  -std=gnu++98
UNRESOLVED: g++.dg/cpp1z/inline-var1.C  -std=gnu++14
UNRESOLVED: g++.dg/cpp1z/inline-var1.C  -std=gnu++17
UNRESOLVED: g++.dg/cpp1z/inline-var1.C  -std=gnu++20
UNRESOLVED: g++.dg/cpp1z/inline-var1.C  -std=gnu++98
UNRESOLVED: g++.dg/cpp2a/lambda-mangle.C  -std=gnu++14
UNRESOLVED: g++.dg/cpp2a/lambda-mangle.C  -std=gnu++17
UNRESOLVED: g++.dg/cpp2a/lambda-mangle.C  -std=gnu++20
UNRESOLVED: g++.dg/cpp2a/lambda-mangle.C  -std=gnu++98
UNRESOLVED: g++.dg/eh/ia64-2.C  -std=gnu++14
UNRESOLVED: g++.dg/eh/ia64-2.C  -std=gnu++17
UNRESOLVED: g++.dg/eh/ia64-2.C  -std=gnu++20
UNRESOLVED: g++.dg/eh/ia64-2.C  -std=gnu++98
UNRESOLVED: g++.dg/eh/weak1.C  -std=gnu++14
UNRESOLVED: g++.dg/eh/weak1.C  -std=gnu++17
UNRESOLVED: g++.d

Results for 13.3.1 20240617 [releases/gcc-13 r13-8854-gbe14e6cf7f] (GCC) testsuite on powerpc64-unknown-linux-gnu

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


git commit g:be14e6cf7f2dc23012dfced0a4aff0894fd6ff57
gcc-descr r13-8854-gbe14e6cf7f2dc2

power9 BE
Linux 6.8.12-powerpc64 ppc64
GNU Make 4.3

DejaGnu:
DejaGnu version 1.6.3
Expect version  5.45.4
Tcl version 8.6

64-bit

LAST_UPDATED: Mon Jun 17 19:09:07 UTC 2024 (revision r13-8854-gbe14e6cf7f)

Native configuration is powerpc64-unknown-linux-gnu

=== g++ tests ===


Running target unix/-m32
FAIL: g++.dg/modules/xtreme-header-5_c.C -std=c++2a (test for excess errors)
FAIL: g++.dg/modules/xtreme-header-5_c.C -std=c++2b (test for excess errors)

=== g++ Summary for unix/-m32 ===

# of expected passes226136
# of unexpected failures2
# of expected failures  1929
# of unsupported tests  10899

Running target unix/-m64
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array + 3, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array - 1, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtolOOBTest 
Strtol(array, NULL, 36) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array + 3, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array - 1, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array, NULL, 0) execution test
FAIL: g++.dg/asan/asan_test.C   -O2  AddressSanitizer_StrtollOOBTest 
Strtol(array, NULL, 36) execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O0  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O1  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O2  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O2 -flto 
-fno-use-linker-plugin -flto-partition=none  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -O3 -g  execution test
FAIL: g++.dg/asan/interception-malloc-test-1.C   -Os  execution test

=== g++ Summary for unix/-m64 ===

# of expected passes235054
# of unexpected failures21
# of expected failures  1937
# of unsupported tests  11087

=== g++ Summary ===

# of expected passes461190
# of unexpected failures23
# of expected failures  3866
# of unsupported tests  21986
/home/gccbuild/build/nightly/build-gcc-13/gcc/xg++  version 13.3.1 20240617 
[releases/gcc-13 r13-8854-gbe14e6cf7f] (GCC) 

=== gcc tests ===


Running target unix/-m32
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/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

Results for 15.0.0 20240617 (experimental) [remotes/origin/master r15-1387-g17979deb15d] (GCC) testsuite on pru-unknown-elf

2024-06-17 Thread The GnuPru BuildBot via Gcc-testresults
c.dg/tree-ssa/dump-6.c scan-tree-dump store-merging "MEM  [(char *)] = "
FAIL: gcc.dg/tree-ssa/if-to-switch-1.c scan-tree-dump iftoswitch "Condition 
chain with [^\\n\\r]* BBs transformed into a switch statement."
FAIL: gcc.dg/tree-ssa/if-to-switch-10.c scan-tree-dump iftoswitch "Condition 
chain with [^\\n\\r]* BBs transformed into a switch statement."
FAIL: gcc.dg/tree-ssa/if-to-switch-3.c scan-tree-dump iftoswitch "Condition 
chain with [^\\n\\r]* BBs transformed into a switch statement."
FAIL: gcc.dg/tree-ssa/if-to-switch-9.c scan-tree-dump iftoswitch "Condition 
chain with [^\\n\\r]* BBs transformed into a switch statement."
FAIL: gcc.dg/tree-ssa/pr103281-1.c scan-tree-dump-not optimized "foo "
FAIL: gcc.dg/tree-ssa/ssa-dom-thread-7.c scan-tree-dump thread2 "Jumps 
threaded: 9"
FAIL: gcc.dg/tree-ssa/update-threading.c scan-tree-dump-times optimized 
"Invalid sum" 0
FAIL: outputs-22 exe savetmp namedb-2: outputs.ld1_args
FAIL: outputs-23 exe savetmp named2-2: outputs.ld1_args
FAIL: outputs-24 exe savetmp named2-3: outputs.ld1_args
FAIL: outputs-25 exe savetmp named2-4: outputs.ld1_args
FAIL: outputs-294 lto sing unnamed-3: a.ld1_args
FAIL: outputs-294 lto sing unnamed-3: a.ld_args

=== gcc Summary ===

# of expected passes133569
# of unexpected failures62
# of unexpected successes   2
# of expected failures  871
# of unresolved testcases   1
# of unsupported tests  4694
/home/dinux/projects/pru/testbot-workspace/pru-gcc-build/gcc/xgcc  version 
15.0.0 20240617 (experimental) [remotes/origin/master r15-1387-g17979deb15d] 
(GCC) 

Host   is x86_64-pc-linux-gnu

=== g++ tests ===


Running target pru-sim
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-11.c  -std=c++14  2 blank 
line(s) in output
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-11.c  -std=c++14  expected 
multiline pattern lines 49-64
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-11.c  -std=c++14 (test for 
excess errors)
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-11.c  -std=c++17  2 blank 
line(s) in output
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-11.c  -std=c++17  expected 
multiline pattern lines 49-64
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-11.c  -std=c++17 (test for 
excess errors)
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-11.c  -std=c++20  2 blank 
line(s) in output
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-11.c  -std=c++20  expected 
multiline pattern lines 49-64
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-11.c  -std=c++20 (test for 
excess errors)
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-11.c  -std=c++98  2 blank 
line(s) in output
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-11.c  -std=c++98  expected 
multiline pattern lines 49-64
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-11.c  -std=c++98 (test for 
excess errors)
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-8.c  -std=c++14  2 blank 
line(s) in output
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-8.c  -std=c++14  expected 
multiline pattern lines 19-34
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-8.c  -std=c++14 (test for 
excess errors)
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-8.c  -std=c++17  2 blank 
line(s) in output
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-8.c  -std=c++17  expected 
multiline pattern lines 19-34
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-8.c  -std=c++17 (test for 
excess errors)
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-8.c  -std=c++20  2 blank 
line(s) in output
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-8.c  -std=c++20  expected 
multiline pattern lines 19-34
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-8.c  -std=c++20 (test for 
excess errors)
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-8.c  -std=c++98  2 blank 
line(s) in output
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-8.c  -std=c++98  expected 
multiline pattern lines 19-34
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-8.c  -std=c++98 (test for 
excess errors)
FAIL: c-c++-common/pr103798-2.c  -std=gnu++14  scan-assembler-not memchr
FAIL: c-c++-common/pr103798-2.c  -std=gnu++17  scan-assembler-not memchr
FAIL: c-c++-common/pr103798-2.c  -std=gnu++20  scan-assembler-not memchr
FAIL: c-c++-common/pr103798-2.c  -std=gnu++98  scan-assembler-not memchr
FAIL: c-c++-common/pr103798-3.c  -std=gnu++14  scan-assembler-not memchr
FAIL: c-c++-common/pr103798-3.c  -std=gnu++17  scan-assembler-not memchr
FAIL: c-c++-common/pr103798-3.c  -std=gnu++20  scan-assembler-not memchr
FAIL: c-c++-common/pr103798-3.c  -std=gnu++98  scan-assembler-not memchr
FAIL: c-c++-common/pr103798-4.c  -std=gnu++14  scan-assembler-not memchr
FAIL: c-c++-common/pr103798-4.c  -std=gnu++17  scan-assembler-not memchr
FAIL: c-c++-common/pr103798-4.c  -std=gnu++20  scan-assembler-not memchr
FAIL: c-c++-common/pr103798-4.c

[PATCH] rs6000: ROP - Do not disable shrink-wrapping for leaf functions [PR114759]

2024-06-17 Thread Peter Bergner
While auditing our ROP code generation for some test cases I wrote, I noticed
a few issues which I'm tracking in PR114759.  The first issue I noticed is we
disable shrink-wrapping when using -mrop-protect, even in the cases where we
never emit the ROP instructions because they're not needed.  The problem is
we disable shrink-wrapping too early, before we know whether we will need to
emit the ROP instructions or not.  The fix is to delay disabling shrink
wrapping until we've decided whether we will or won't be emitting the ROP
instructions.

This patch passed bootstrap and regtesting on powerpc64le-linux with no
regressions, with the unpatched build FAILing the new test case and the
patched build PASSing the new test case.
Ok for trunk?

Peter



rs6000: ROP - Do not disable shrink-wrapping for leaf functions [PR114759]

Only disable shrink-wrapping when using -mrop-protect when we know we
will be emitting the ROP instructions (ie, non-leaf functions).

2024-06-17  Peter Bergner  

gcc/
PR target/114759
* config/rs6000/rs6000.cc (rs6000_override_options_after_change): Move
the disabling of shrink-wrapping from here
* config/rs6000/rs6000-logue.cc (rs6000_stack_info): ...to here.

gcc/testsuite/
PR target/114759
* gcc.target/powerpc/pr114759-1.c: New test.
---
 gcc/config/rs6000/rs6000-logue.cc |  6 +-
 gcc/config/rs6000/rs6000.cc   |  4 
 gcc/testsuite/gcc.target/powerpc/pr114759-1.c | 16 
 3 files changed, 21 insertions(+), 5 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/powerpc/pr114759-1.c

diff --git a/gcc/config/rs6000/rs6000-logue.cc 
b/gcc/config/rs6000/rs6000-logue.cc
index 193e2122c0f..659da0bd53f 100644
--- a/gcc/config/rs6000/rs6000-logue.cc
+++ b/gcc/config/rs6000/rs6000-logue.cc
@@ -720,7 +720,11 @@ rs6000_stack_info (void)
   && info->calls_p
   && DEFAULT_ABI == ABI_ELFv2
   && rs6000_rop_protect)
-info->rop_hash_size = 8;
+{
+  /* If we are inserting ROP-protect instructions, disable shrink wrap.  */
+  flag_shrink_wrap = 0;
+  info->rop_hash_size = 8;
+}
   else if (rs6000_rop_protect && DEFAULT_ABI != ABI_ELFv2)
 {
   /* We can't check this in rs6000_option_override_internal since
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index e4dc629ddcc..fd6e013c346 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -3427,10 +3427,6 @@ rs6000_override_options_after_change (void)
 }
   else if (!OPTION_SET_P (flag_cunroll_grow_size))
 flag_cunroll_grow_size = flag_peel_loops || optimize >= 3;
-
-  /* If we are inserting ROP-protect instructions, disable shrink wrap.  */
-  if (rs6000_rop_protect)
-flag_shrink_wrap = 0;
 }
 
 #ifdef TARGET_USES_LINUX64_OPT
diff --git a/gcc/testsuite/gcc.target/powerpc/pr114759-1.c 
b/gcc/testsuite/gcc.target/powerpc/pr114759-1.c
new file mode 100644
index 000..b4ba366402f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr114759-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10 -mrop-protect 
-fdump-rtl-pro_and_epilogue" } */
+/* { dg-require-effective-target rop_ok } */
+
+/* Verify we still attempt shrink-wrapping when using -mrop-protect
+   and there are no function calls.  */
+
+long
+foo (long arg)
+{
+  if (arg)
+asm ("" ::: "r20");
+  return 0;
+}
+
+/* { dg-final { scan-rtl-dump-times "Performing shrink-wrapping" 1 
"pro_and_epilogue" } } */
-- 
2.43.0



Setting insn mnemonic partly automagically

2024-06-17 Thread Stefan Schulze Frielinghaus via Gcc
Hi all,

I'm trying to add an alternative to an existing insn foobar:

(define_insn "foobar"
  [(set (match_operand ...)
(match_operand ...))]
  ""
  "@
   foo
   bar
   #")

Since the asm output depends on the operands in a non-trivial way which isn't
easily solved via iterators, I went for a general C function and came up with:

(define_insn "foobar"
  [(set (match_operand ...)
(match_operand ...))]
  ""
  "@
   foo
   * return foobar_helper (operands[0], operands[1]);
   bar
   #"
  [(set_attr_alternative "mnemonic" [(const_string "foo")
 (const_string "specialcase")
 (const_string "bar")
 (const_string "unknown")])])

If there exist a lot of alternatives, then setting the mnemonic attribute like
this feels repetitive and is error prone.  Furthermore, if there exists no
other insn with an output template containing foo/bar, then I would have to
declare foo/bar via

(define_attr "mnemonic" "...,foo,bar,..." (const_string "unknown"))

which again is repetitive.  Thus, I'm wondering if there exists a more elegant
way to achieve this?  Ultimately, I would like to set the mnemonic
attribute only manually for the alternative which is implemented via C
code and let the mnemonic attribute for the remaining alternatives be
set automagically.  Not sure whether this is supported?

If all fails, I have another idea how to solve this by utilizing PRINT_OPERAND.
However, now I'm curious whether my current attempt is feasible or not.

Cheers,
Stefan


Results for 15.0.0 20240617 (experimental) [remotes/origin/HEAD r15-1372-g3dedfad5a1e] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-06-17 Thread Bill Seurer (POWER9) via Gcc-testresults
-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/guality/vla-1.c   -O2  -DPREVENT_OPTIMIZATION  line 17 sizeof (a) 
== 6
FAIL: gcc.dg/guality/vla-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 17 sizeof (a) == 6
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-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 sizeof 
(a) == 6
FAIL: gcc.dg/guality/vla-1.c   -Os  -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
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/costmodel/ppc/costmodel-slp-12.c scan-tree-dump-times vect 
"vectorizing stmts using SLP" 3
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 passes180382
# of unexpected failures107
# of unexpected successes   20
# of expected failures  1617
# of unsupported tests  4277
/home/gccbuild/build/nightly/build-gcc-trunk/gcc/xgcc  version 15.0.0 20240617 
(experimental) [remotes/origin/HEAD r15-1372-g3dedfad5a1e] (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 passes70275
# of unexpected failures12
# of unexpected successes   6
# of expected failures  285
# of unsupported tests  17

Results for 15.0.0 20240617 (experimental) [remotes/origin/HEAD r15-1385-gd78694c238c] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-06-17 Thread Bill Seurer (POWER9) via Gcc-testresults
-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/guality/vla-1.c   -O2  -DPREVENT_OPTIMIZATION  line 17 sizeof (a) 
== 6
FAIL: gcc.dg/guality/vla-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 17 sizeof (a) == 6
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-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 sizeof 
(a) == 6
FAIL: gcc.dg/guality/vla-1.c   -Os  -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
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/costmodel/ppc/costmodel-slp-12.c scan-tree-dump-times vect 
"vectorizing stmts using SLP" 3
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 passes180409
# of unexpected failures107
# of unexpected successes   20
# of expected failures  1617
# of unsupported tests  4277
/home/gccbuild/build/nightly/build-gcc-trunk/gcc/xgcc  version 15.0.0 20240617 
(experimental) [remotes/origin/HEAD r15-1385-gd78694c238c] (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 passes70275
# of unexpected failures12
# of unexpected successes   6
# of expected failures  285
# of unsupported tests  17

[PATCH-1v4] fwprop: Replace rtx_cost with insn_cost in try_fwprop_subst_pattern [PR113325]

2024-06-17 Thread HAO CHEN GUI
Hi,
  This patch replaces rtx_cost with insn_cost in forward propagation.
In the PR, one constant vector should be propagated and replace a
pseudo in a store insn if we know it's a duplicated constant vector.
It reduces the insn cost but not rtx cost. In this case, the cost is
determined by destination operand (memory or pseudo). Unfortunately,
rtx cost can't help.

  The test case is added in the second rs6000 specific patch.

  Compared to previous version, the main changes are:
1. Invalidate recog_data when the cached INSN is swapped out.
2. Pass strict_p according to prop.likely_profitable_p () to
change_is_worthwhile.

Previous version
https://gcc.gnu.org/pipermail/gcc-patches/2024-June/654276.html


  The patch causes a regression cases on i386 as the pattern cost
regulation has a bug. Please refer the patch and discussion here.
https://gcc.gnu.org/pipermail/gcc-patches/2024-May/651363.html

  Bootstrapped and tested on powerpc64-linux BE and LE with no
regressions. Is it OK for the trunk?

ChangeLog
fwprop: invoke change_is_worthwhile to judge if a replacement is worthwhile

gcc/
* fwprop.cc (try_fwprop_subst_pattern): Invoke change_is_worthwhile
to judge if a replacement is worthwhile.
* recog.cc (swap_change): Invalidate recog_data when the cached INSN
is swapped out.
* rtl-ssa/changes.cc (rtl_ssa::changes_are_worthwhile): Check if the
insn cost of new rtl is unknown and fail the replacement.

patch.diff
diff --git a/gcc/fwprop.cc b/gcc/fwprop.cc
index de543923b92..4a9f68b66b1 100644
--- a/gcc/fwprop.cc
+++ b/gcc/fwprop.cc
@@ -471,29 +471,18 @@ try_fwprop_subst_pattern (obstack_watermark , 
insn_change _change,
   redo_changes (0);
 }

-  /* ??? In theory, it should be better to use insn costs rather than
- set_src_costs here.  That would involve replacing this code with
- change_is_worthwhile.  */
   bool ok = recog (attempt, use_change);
-  if (ok && !prop.changed_mem_p () && !use_insn->is_asm ())
-if (rtx use_set = single_set (use_rtl))
-  {
-   bool speed = optimize_bb_for_speed_p (BLOCK_FOR_INSN (use_rtl));
-   temporarily_undo_changes (0);
-   auto old_cost = set_src_cost (SET_SRC (use_set),
- GET_MODE (SET_DEST (use_set)), speed);
-   redo_changes (0);
-   auto new_cost = set_src_cost (SET_SRC (use_set),
- GET_MODE (SET_DEST (use_set)), speed);
-   if (new_cost > old_cost
-   || (new_cost == old_cost && !prop.likely_profitable_p ()))
- {
-   if (dump_file)
- fprintf (dump_file, "change not profitable"
-  " (cost %d -> cost %d)\n", old_cost, new_cost);
-   ok = false;
- }
-  }
+  if (ok && !prop.changed_mem_p () && !use_insn->is_asm ()
+  && single_set (use_rtl))
+{
+  bool strict_p = !prop.likely_profitable_p ();
+  if (!change_is_worthwhile (use_change, strict_p))
+   {
+ if (dump_file)
+   fprintf (dump_file, "change not profitable");
+ ok = false;
+   }
+}

   if (!ok)
 {
diff --git a/gcc/recog.cc b/gcc/recog.cc
index a6799e3f5e6..56370e40e01 100644
--- a/gcc/recog.cc
+++ b/gcc/recog.cc
@@ -614,7 +614,11 @@ swap_change (int num)
   else
 std::swap (*changes[num].loc, changes[num].old);
   if (changes[num].object && !MEM_P (changes[num].object))
-std::swap (INSN_CODE (changes[num].object), changes[num].old_code);
+{
+  std::swap (INSN_CODE (changes[num].object), changes[num].old_code);
+  if (recog_data.insn == changes[num].object)
+   recog_data.insn = nullptr;
+}
 }

 /* Temporarily undo all the changes numbered NUM and up, with a view
diff --git a/gcc/rtl-ssa/changes.cc b/gcc/rtl-ssa/changes.cc
index 11639e81bb7..c5ac4956a19 100644
--- a/gcc/rtl-ssa/changes.cc
+++ b/gcc/rtl-ssa/changes.cc
@@ -186,6 +186,14 @@ rtl_ssa::changes_are_worthwhile (array_slice changes,
   if (!change->is_deletion ())
{
  change->new_cost = insn_cost (change->rtl (), for_speed);
+ /* If the cost is unknown, replacement is not worthwhile.  */
+ if (!change->new_cost)
+   {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+   fprintf (dump_file,
+"Reject replacement due to unknown insn cost.\n");
+ return false;
+   }
  new_cost += change->new_cost;
  if (for_speed)
weighted_new_cost += (cfg_bb->count.to_sreal_scale (entry_count)



Results for 15.0.0 20240617 (experimental) [master r15-1380-g8584c98f370] (GCC) testsuite on s390x-ibm-linux-gnu default

2024-06-17 Thread stefansf--- via Gcc-testresults
lugin/cpython-plugin-test-PyList_Append.c 
-fplugin=./analyzer_cpython_plugin.so  at line 43 (test for warnings, line 42)
FAIL: gcc.dg/plugin/cpython-plugin-test-PyList_Append.c 
-fplugin=./analyzer_cpython_plugin.so (internal compiler error: Segmentation 
fault)
FAIL: gcc.dg/plugin/cpython-plugin-test-PyList_Append.c 
-fplugin=./analyzer_cpython_plugin.so (test for excess errors)
FAIL: gcc.dg/plugin/cpython-plugin-test-PyList_New.c 
-fplugin=./analyzer_cpython_plugin.so  (test for warnings, line 17)
FAIL: gcc.dg/plugin/cpython-plugin-test-PyList_New.c 
-fplugin=./analyzer_cpython_plugin.so  (test for warnings, line 18)
FAIL: gcc.dg/plugin/cpython-plugin-test-PyList_New.c 
-fplugin=./analyzer_cpython_plugin.so  (test for warnings, line 21)
FAIL: gcc.dg/plugin/cpython-plugin-test-PyList_New.c 
-fplugin=./analyzer_cpython_plugin.so  (test for warnings, line 29)
FAIL: gcc.dg/plugin/cpython-plugin-test-PyList_New.c 
-fplugin=./analyzer_cpython_plugin.so  at line 37 (test for warnings, line 36)
FAIL: gcc.dg/plugin/cpython-plugin-test-PyList_New.c 
-fplugin=./analyzer_cpython_plugin.so (internal compiler error: Segmentation 
fault)
FAIL: gcc.dg/plugin/cpython-plugin-test-PyList_New.c 
-fplugin=./analyzer_cpython_plugin.so (test for excess errors)
FAIL: gcc.dg/plugin/cpython-plugin-test-PyLong_FromLong.c 
-fplugin=./analyzer_cpython_plugin.so  (test for warnings, line 17)
FAIL: gcc.dg/plugin/cpython-plugin-test-PyLong_FromLong.c 
-fplugin=./analyzer_cpython_plugin.so  (test for warnings, line 18)
FAIL: gcc.dg/plugin/cpython-plugin-test-PyLong_FromLong.c 
-fplugin=./analyzer_cpython_plugin.so  (test for warnings, line 21)
FAIL: gcc.dg/plugin/cpython-plugin-test-PyLong_FromLong.c 
-fplugin=./analyzer_cpython_plugin.so  (test for warnings, line 29)
FAIL: gcc.dg/plugin/cpython-plugin-test-PyLong_FromLong.c 
-fplugin=./analyzer_cpython_plugin.so  at line 37 (test for warnings, line 36)
FAIL: gcc.dg/plugin/cpython-plugin-test-PyLong_FromLong.c 
-fplugin=./analyzer_cpython_plugin.so (internal compiler error: Segmentation 
fault)
FAIL: gcc.dg/plugin/cpython-plugin-test-PyLong_FromLong.c 
-fplugin=./analyzer_cpython_plugin.so (test for excess errors)
FAIL: gcc.dg/torture/pr113026-1.c   -O3 -fomit-frame-pointer -funroll-loops 
-fpeel-loops -ftracer -finline-functions   (test for bogus messages, line 10)
FAIL: gcc.dg/torture/pr113026-1.c   -O3 -g   (test for bogus messages, line 10)
FAIL: gcc.dg/torture/pr113026-2.c   -O3 -fomit-frame-pointer -funroll-loops 
-fpeel-loops -ftracer -finline-functions   (test for bogus messages, line 17)
FAIL: gcc.dg/torture/pr113026-2.c   -O3 -fomit-frame-pointer -funroll-loops 
-fpeel-loops -ftracer -finline-functions   (test for bogus messages, line 9)
FAIL: gcc.dg/torture/pr113026-2.c   -O3 -g   (test for bogus messages, line 17)
FAIL: gcc.dg/torture/pr113026-2.c   -O3 -g   (test for bogus messages, line 9)
FAIL: gcc.dg/tree-ssa/abs-4.c scan-tree-dump-times optimized "= .COPYSIGN" 3
FAIL: gcc.dg/tree-ssa/backprop-6.c scan-tree-dump-times backprop 
"Deleting[^n]* = .COPYSIGN" 3
FAIL: gcc.dg/tree-ssa/copy-sign-2.c scan-tree-dump-times optimized ".COPYSIGN" 1
FAIL: gcc.dg/tree-ssa/copy-sign-2.c scan-tree-dump-times optimized "ABS" 1
FAIL: gcc.dg/tree-ssa/update-threading.c scan-tree-dump-times optimized 
"Invalid sum" 0
FAIL: c-c++-common/tsan/tls_race.c   -O0  output pattern test
FAIL: c-c++-common/tsan/tls_race.c   -O2  output pattern test
FAIL: gcc.dg/vect/pr112325.c -flto -ffat-lto-objects  scan-tree-dump-times vect 
"vectorized 1 loops" 1
FAIL: gcc.dg/vect/pr112325.c scan-tree-dump-times vect "vectorized 1 loops" 1
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/s390/risbg-ll-1.c scan-assembler 
f42:\\n\\tsllg\\t%r2,%r2,63\\n\\tsrag\\t%r2,%r2,63\\n\\tllgcr\\t%r2,%r2
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

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

# of expected passes181847
# of unexpected failures165
# of unexpected successes   17
# of expected failures  1466
# of unsupported tests  4339

=== gcc Summary ===

# of expected passes360609
# of unexpected failures334
# of unexpected successes   31
# of expected failures  2933
# of unsupported tests  9296
-default/gcc/xgcc  version 15.0.0 20240617 (experimental) [master 
r15-1380-g8584c98f370] (GCC) 

=== gdc tests ===


Running target unix/-m31
FAIL: gdc.dg/attr_module.d(test for warnings, line 12)
FAIL: gdc.dg/attr_module.d(test for warnings, line 18)
FAIL: gdc.dg/attr_module.d(test for warnings, line 24

[PATCH 11/11] Handle subroutine types in CodeView

2024-06-17 Thread Mark Harmstone
Translates DW_TAG_subroutine_type DIEs into LF_PROCEDURE symbols.

gcc/
* dwarf2codeview.cc
(struct codeview_custom_type): Add lf_procedure and lf_arglist
to union.
(write_lf_procedure, write_lf_arglist): New functions.
(write_custom_types): Call write_lf_procedure and
write_lf_arglist.
(get_type_num_subroutine_type): New function.
(get_type_num): Handle DW_TAG_subroutine_type DIEs.
* dwarf2codeview.h (LF_PROCEDURE, LF_ARGLIST): Define.
---
 gcc/dwarf2codeview.cc | 238 ++
 gcc/dwarf2codeview.h  |   2 +
 2 files changed, 240 insertions(+)

diff --git a/gcc/dwarf2codeview.cc b/gcc/dwarf2codeview.cc
index 06267639169..e8ed3713480 100644
--- a/gcc/dwarf2codeview.cc
+++ b/gcc/dwarf2codeview.cc
@@ -262,6 +262,19 @@ struct codeview_custom_type
   uint8_t length;
   uint8_t position;
 } lf_bitfield;
+struct
+{
+  uint32_t return_type;
+  uint8_t calling_convention;
+  uint8_t attributes;
+  uint16_t num_parameters;
+  uint32_t arglist;
+} lf_procedure;
+struct
+{
+  uint32_t num_entries;
+  uint32_t *args;
+} lf_arglist;
   };
 };
 
@@ -1623,6 +1636,102 @@ write_lf_bitfield (codeview_custom_type *t)
   asm_fprintf (asm_out_file, "%LLcv_type%x_end:\n", t->num);
 }
 
+/* Write an LF_PROCEDURE type.  Function pointers are implemented as pointers
+   to one of these.  */
+
+static void
+write_lf_procedure (codeview_custom_type *t)
+{
+  /* This is lf_procedure in binutils and lfProc in Microsoft's cvinfo.h:
+
+struct lf_procedure
+{
+  uint16_t size;
+  uint16_t kind;
+  uint32_t return_type;
+  uint8_t calling_convention;
+  uint8_t attributes;
+  uint16_t num_parameters;
+  uint32_t arglist;
+} ATTRIBUTE_PACKED;
+  */
+
+  fputs (integer_asm_op (2, false), asm_out_file);
+  asm_fprintf (asm_out_file, "%LLcv_type%x_end - %LLcv_type%x_start\n",
+  t->num, t->num);
+
+  asm_fprintf (asm_out_file, "%LLcv_type%x_start:\n", t->num);
+
+  fputs (integer_asm_op (2, false), asm_out_file);
+  fprint_whex (asm_out_file, t->kind);
+  putc ('\n', asm_out_file);
+
+  fputs (integer_asm_op (4, false), asm_out_file);
+  fprint_whex (asm_out_file, t->lf_procedure.return_type);
+  putc ('\n', asm_out_file);
+
+  fputs (integer_asm_op (1, false), asm_out_file);
+  fprint_whex (asm_out_file, t->lf_procedure.calling_convention);
+  putc ('\n', asm_out_file);
+
+  fputs (integer_asm_op (1, false), asm_out_file);
+  fprint_whex (asm_out_file, t->lf_procedure.attributes);
+  putc ('\n', asm_out_file);
+
+  fputs (integer_asm_op (2, false), asm_out_file);
+  fprint_whex (asm_out_file, t->lf_procedure.num_parameters);
+  putc ('\n', asm_out_file);
+
+  fputs (integer_asm_op (4, false), asm_out_file);
+  fprint_whex (asm_out_file, t->lf_procedure.arglist);
+  putc ('\n', asm_out_file);
+
+  asm_fprintf (asm_out_file, "%LLcv_type%x_end:\n", t->num);
+}
+
+/* Write an LF_ARGLIST type.  This is just a list of other types.  LF_PROCEDURE
+   entries point to one of these.  */
+
+static void
+write_lf_arglist (codeview_custom_type *t)
+{
+  /* This is lf_arglist in binutils and lfArgList in Microsoft's cvinfo.h:
+
+struct lf_arglist
+{
+  uint16_t size;
+  uint16_t kind;
+  uint32_t num_entries;
+  uint32_t args[];
+} ATTRIBUTE_PACKED;
+  */
+
+  fputs (integer_asm_op (2, false), asm_out_file);
+  asm_fprintf (asm_out_file, "%LLcv_type%x_end - %LLcv_type%x_start\n",
+  t->num, t->num);
+
+  asm_fprintf (asm_out_file, "%LLcv_type%x_start:\n", t->num);
+
+  fputs (integer_asm_op (2, false), asm_out_file);
+  fprint_whex (asm_out_file, t->kind);
+  putc ('\n', asm_out_file);
+
+  fputs (integer_asm_op (4, false), asm_out_file);
+  fprint_whex (asm_out_file, t->lf_arglist.num_entries);
+  putc ('\n', asm_out_file);
+
+  for (uint32_t i = 0; i < t->lf_arglist.num_entries; i++)
+{
+  fputs (integer_asm_op (4, false), asm_out_file);
+  fprint_whex (asm_out_file, t->lf_arglist.args[i]);
+  putc ('\n', asm_out_file);
+}
+
+  free (t->lf_arglist.args);
+
+  asm_fprintf (asm_out_file, "%LLcv_type%x_end:\n", t->num);
+}
+
 /* Write the .debug$T section, which contains all of our custom type
definitions.  */
 
@@ -1673,6 +1782,14 @@ write_custom_types (void)
case LF_BITFIELD:
  write_lf_bitfield (custom_types);
  break;
+
+   case LF_PROCEDURE:
+ write_lf_procedure (custom_types);
+ break;
+
+   case LF_ARGLIST:
+ write_lf_arglist (custom_types);
+ break;
}
 
   free (custom_types);
@@ -2488,6 +2605,123 @@ get_type_num_struct (dw_die_ref type, bool in_struct, 
bool *is_fwd_ref)
   return ct->num;
 }
 
+/* Process a DW_TAG_subroutine_type DIE, adding an LF_ARGLIST and an
+   LF_PROCEDURE type, and returning the number of the latter.  */
+
+static 

[PATCH 09/11] Handle arrays for CodeView

2024-06-17 Thread Mark Harmstone
Translates DW_TAG_array_type DIEs into LF_ARRAY symbols.

gcc/
* dwarf2codeview.cc
(struct codeview_custom_type): Add lf_array to union.
(write_lf_array): New function.
(write_custom_types): Call write_lf_array.
(get_type_num_array_type): New function.
(get_type_num): Handle DW_TAG_array_type DIEs.
* dwarf2codeview.h (LF_ARRAY): Define.
---
 gcc/dwarf2codeview.cc | 179 ++
 gcc/dwarf2codeview.h  |   1 +
 2 files changed, 180 insertions(+)

diff --git a/gcc/dwarf2codeview.cc b/gcc/dwarf2codeview.cc
index 9e3b64522b2..3f1ce5577fc 100644
--- a/gcc/dwarf2codeview.cc
+++ b/gcc/dwarf2codeview.cc
@@ -250,6 +250,12 @@ struct codeview_custom_type
   codeview_integer length;
   char *name;
 } lf_structure;
+struct
+{
+  uint32_t element_type;
+  uint32_t index_type;
+  codeview_integer length_in_bytes;
+} lf_array;
   };
 };
 
@@ -1520,6 +1526,53 @@ write_lf_union (codeview_custom_type *t)
   asm_fprintf (asm_out_file, "%LLcv_type%x_end:\n", t->num);
 }
 
+/* Write an LF_ARRAY type.  */
+
+static void
+write_lf_array (codeview_custom_type *t)
+{
+  size_t leaf_len;
+
+  /* This is lf_array in binutils and lfArray in Microsoft's cvinfo.h:
+
+struct lf_array
+{
+  uint16_t size;
+  uint16_t kind;
+  uint32_t element_type;
+  uint32_t index_type;
+  uint16_t length_in_bytes;
+  char name[];
+} ATTRIBUTE_PACKED;
+  */
+
+  fputs (integer_asm_op (2, false), asm_out_file);
+  asm_fprintf (asm_out_file, "%LLcv_type%x_end - %LLcv_type%x_start\n",
+  t->num, t->num);
+
+  asm_fprintf (asm_out_file, "%LLcv_type%x_start:\n", t->num);
+
+  fputs (integer_asm_op (2, false), asm_out_file);
+  fprint_whex (asm_out_file, t->kind);
+  putc ('\n', asm_out_file);
+
+  fputs (integer_asm_op (4, false), asm_out_file);
+  fprint_whex (asm_out_file, t->lf_array.element_type);
+  putc ('\n', asm_out_file);
+
+  fputs (integer_asm_op (4, false), asm_out_file);
+  fprint_whex (asm_out_file, t->lf_array.index_type);
+  putc ('\n', asm_out_file);
+
+  leaf_len = 13 + write_cv_integer (>lf_array.length_in_bytes);
+
+  ASM_OUTPUT_ASCII (asm_out_file, "", 1);
+
+  write_cv_padding (4 - (leaf_len % 4));
+
+  asm_fprintf (asm_out_file, "%LLcv_type%x_end:\n", t->num);
+}
+
 /* Write the .debug$T section, which contains all of our custom type
definitions.  */
 
@@ -1562,6 +1615,10 @@ write_custom_types (void)
case LF_UNION:
  write_lf_union (custom_types);
  break;
+
+   case LF_ARRAY:
+ write_lf_array (custom_types);
+ break;
}
 
   free (custom_types);
@@ -2346,6 +2403,124 @@ get_type_num_struct (dw_die_ref type, bool in_struct, 
bool *is_fwd_ref)
   return ct->num;
 }
 
+/* Process a DW_TAG_array_type DIE, adding an LF_ARRAY type and returning its
+   number.  */
+
+static uint32_t
+get_type_num_array_type (dw_die_ref type, bool in_struct)
+{
+  dw_die_ref base_type, t, first_child, c, *dimension_arr;
+  uint64_t size = 0;
+  unsigned int dimensions, i;
+  uint32_t element_type;
+
+  base_type = get_AT_ref (type, DW_AT_type);
+  if (!base_type)
+return 0;
+
+  /* We need to know the size of our base type.  Loop through until we find
+ it.  */
+  t = base_type;
+  while (t && size == 0)
+{
+  switch (dw_get_die_tag (t))
+   {
+   case DW_TAG_const_type:
+   case DW_TAG_volatile_type:
+   case DW_TAG_typedef:
+   case DW_TAG_enumeration_type:
+ t = get_AT_ref (t, DW_AT_type);
+ break;
+
+   case DW_TAG_base_type:
+   case DW_TAG_structure_type:
+   case DW_TAG_class_type:
+   case DW_TAG_union_type:
+   case DW_TAG_pointer_type:
+ size = get_AT_unsigned (t, DW_AT_byte_size);
+ break;
+
+   default:
+ return 0;
+   }
+}
+
+  if (size == 0)
+return 0;
+
+  first_child = dw_get_die_child (type);
+  if (!first_child)
+return 0;
+
+  element_type = get_type_num (base_type, in_struct, false);
+  if (element_type == 0)
+return 0;
+
+  /* Create an array of our DW_TAG_subrange_type children, in reverse order.
+ We have to do this because unlike DWARF CodeView doesn't have
+ multidimensional arrays, so instead we do arrays of arrays.  */
+
+  dimensions = 0;
+  c = first_child;
+  do
+{
+  c = dw_get_die_sib (c);
+  if (dw_get_die_tag (c) != DW_TAG_subrange_type)
+   continue;
+
+  dimensions++;
+}
+  while (c != first_child);
+
+  if (dimensions == 0)
+return 0;
+
+  dimension_arr = (dw_die_ref *) xmalloc (sizeof (dw_die_ref) * dimensions);
+
+  c = first_child;
+  i = 0;
+  do
+{
+  c = dw_get_die_sib (c);
+  if (dw_get_die_tag (c) != DW_TAG_subrange_type)
+   continue;
+
+  dimension_arr[dimensions - i - 1] = c;
+  i++;
+}
+  while (c != first_child);
+
+  /* Record an LF_ARRAY entry for each array 

Results for 15.0.0 20240617 (experimental) [remotes/origin/HEAD r15-1381-gb63c7d92012] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-06-17 Thread Bill Seurer (POWER9) via Gcc-testresults
-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/guality/vla-1.c   -O2  -DPREVENT_OPTIMIZATION  line 17 sizeof (a) 
== 6
FAIL: gcc.dg/guality/vla-1.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  -DPREVENT_OPTIMIZATION line 17 sizeof (a) == 6
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-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 sizeof 
(a) == 6
FAIL: gcc.dg/guality/vla-1.c   -Os  -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
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/costmodel/ppc/costmodel-slp-12.c scan-tree-dump-times vect 
"vectorizing stmts using SLP" 3
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 passes180402
# of unexpected failures107
# of unexpected successes   20
# of expected failures  1617
# of unsupported tests  4277
/home/gccbuild/build/nightly/build-gcc-trunk/gcc/xgcc  version 15.0.0 20240617 
(experimental) [remotes/origin/HEAD r15-1381-gb63c7d92012] (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 passes70275
# of unexpected failures12
# of unexpected successes   6
# of expected failures  285
# of unsupported tests  17

[PATCH 08/11] Handle unions for CodeView.

2024-06-17 Thread Mark Harmstone
Translates DW_TAG_union_type DIEs into LF_UNION symbols.

gcc/
* dwarf2codeview.cc (write_lf_union): New function.
(write_custom_types): Call write_lf_union.
(add_struct_forward_def): Handle DW_TAG_union_type DIEs.
(get_type_num_struct): Handle unions.
(get_type_num): Handle DW_TAG_union_type DIEs.
* dwarf2codeview.h (LF_UNION): Define.
---
 gcc/dwarf2codeview.cc | 91 ---
 gcc/dwarf2codeview.h  |  1 +
 2 files changed, 86 insertions(+), 6 deletions(-)

diff --git a/gcc/dwarf2codeview.cc b/gcc/dwarf2codeview.cc
index 9c6614f6297..9e3b64522b2 100644
--- a/gcc/dwarf2codeview.cc
+++ b/gcc/dwarf2codeview.cc
@@ -1454,6 +1454,72 @@ write_lf_structure (codeview_custom_type *t)
   asm_fprintf (asm_out_file, "%LLcv_type%x_end:\n", t->num);
 }
 
+/* Write an LF_UNION type.  */
+
+static void
+write_lf_union (codeview_custom_type *t)
+{
+  size_t name_len, leaf_len;
+
+  /* This is lf_union in binutils and lfUnion in Microsoft's cvinfo.h:
+
+struct lf_union
+{
+  uint16_t size;
+  uint16_t kind;
+  uint16_t num_members;
+  uint16_t properties;
+  uint32_t field_list;
+  uint16_t length;
+  char name[];
+} ATTRIBUTE_PACKED;
+  */
+
+  fputs (integer_asm_op (2, false), asm_out_file);
+  asm_fprintf (asm_out_file, "%LLcv_type%x_end - %LLcv_type%x_start\n",
+  t->num, t->num);
+
+  asm_fprintf (asm_out_file, "%LLcv_type%x_start:\n", t->num);
+
+  fputs (integer_asm_op (2, false), asm_out_file);
+  fprint_whex (asm_out_file, t->kind);
+  putc ('\n', asm_out_file);
+
+  fputs (integer_asm_op (2, false), asm_out_file);
+  fprint_whex (asm_out_file, t->lf_structure.num_members);
+  putc ('\n', asm_out_file);
+
+  fputs (integer_asm_op (2, false), asm_out_file);
+  fprint_whex (asm_out_file, t->lf_structure.properties);
+  putc ('\n', asm_out_file);
+
+  fputs (integer_asm_op (4, false), asm_out_file);
+  fprint_whex (asm_out_file, t->lf_structure.field_list);
+  putc ('\n', asm_out_file);
+
+  leaf_len = 12 + write_cv_integer (>lf_structure.length);
+
+  if (t->lf_structure.name)
+{
+  name_len = strlen (t->lf_structure.name) + 1;
+  ASM_OUTPUT_ASCII (asm_out_file, t->lf_structure.name, name_len);
+}
+  else
+{
+  static const char unnamed_struct[] = "";
+
+  name_len = sizeof (unnamed_struct);
+  ASM_OUTPUT_ASCII (asm_out_file, unnamed_struct, name_len);
+}
+
+  leaf_len += name_len;
+  write_cv_padding (4 - (leaf_len % 4));
+
+  free (t->lf_structure.name);
+
+  asm_fprintf (asm_out_file, "%LLcv_type%x_end:\n", t->num);
+}
+
 /* Write the .debug$T section, which contains all of our custom type
definitions.  */
 
@@ -1492,6 +1558,10 @@ write_custom_types (void)
case LF_CLASS:
  write_lf_structure (custom_types);
  break;
+
+   case LF_UNION:
+ write_lf_union (custom_types);
+ break;
}
 
   free (custom_types);
@@ -2026,7 +2096,7 @@ flush_deferred_types (void)
   last_deferred_type = NULL;
 }
 
-/* Add a forward definition for a struct or class.  */
+/* Add a forward definition for a struct, class, or union.  */
 
 static uint32_t
 add_struct_forward_def (dw_die_ref type)
@@ -2047,6 +2117,10 @@ add_struct_forward_def (dw_die_ref type)
   ct->kind = LF_STRUCTURE;
   break;
 
+case DW_TAG_union_type:
+  ct->kind = LF_UNION;
+  break;
+
 default:
   break;
 }
@@ -2068,9 +2142,9 @@ add_struct_forward_def (dw_die_ref type)
   return ct->num;
 }
 
-/* Process a DW_TAG_structure_type or DW_TAG_class_type DIE, add an
-   LF_FIELDLIST and an LF_STRUCTURE / LF_CLASS type, and return the number of
-   the latter.  */
+/* Process a DW_TAG_structure_type, DW_TAG_class_type, or DW_TAG_union_type
+   DIE, add an LF_FIELDLIST and an LF_STRUCTURE / LF_CLASS / LF_UNION type,
+   and return the number of the latter.  */
 
 static uint32_t
 get_type_num_struct (dw_die_ref type, bool in_struct, bool *is_fwd_ref)
@@ -2227,8 +2301,8 @@ get_type_num_struct (dw_die_ref type, bool in_struct, 
bool *is_fwd_ref)
   ct = ct2;
 }
 
-  /* Now add an LF_STRUCTURE / LF_CLASS, pointing to the LF_FIELDLIST we just
- added.  */
+  /* Now add an LF_STRUCTURE / LF_CLASS / LF_UNION, pointing to the
+ LF_FIELDLIST we just added.  */
 
   ct = (codeview_custom_type *) xmalloc (sizeof (codeview_custom_type));
 
@@ -2244,6 +2318,10 @@ get_type_num_struct (dw_die_ref type, bool in_struct, 
bool *is_fwd_ref)
   ct->kind = LF_STRUCTURE;
   break;
 
+case DW_TAG_union_type:
+  ct->kind = LF_UNION;
+  break;
+
 default:
   break;
 }
@@ -2325,6 +2403,7 @@ get_type_num (dw_die_ref type, bool in_struct, bool 
no_fwd_ref)
 
 case DW_TAG_structure_type:
 case DW_TAG_class_type:
+case DW_TAG_union_type:
   num = get_type_num_struct (type, in_struct, _fwd_ref);
   break;
 
diff --git a/gcc/dwarf2codeview.h 

[PATCH 06/11] Handle enums for CodeView

2024-06-17 Thread Mark Harmstone
Translates DW_TAG_enumeration_type DIEs into LF_ENUM symbols.

gcc/
* dwarf2codeview.cc (MAX_FIELDLIST_SIZE): Define.
(struct codeview_integer): New structure.
(struct codeview_subtype): Likewise
(struct codeview_custom_type): Add lf_fieldlist and lf_enum
to union.
(write_cv_integer, cv_integer_len): New functions.
(write_lf_fieldlist, write_lf_enum): Likewise.
(write_custom_types): Call write_lf_fieldlist and write_lf_enum.
(add_enum_forward_def): New function.
(get_type_num_enumeration_type): Likewise.
(get_type_num): Handle DW_TAG_enumeration_type DIEs.
* dwarf2codeview.h (LF_FIELDLIST, LF_INDEX, LF_ENUMERATE): Define.
(LF_ENUM, LF_CHAR, LF_SHORT, LF_USHORT, LF_LONG): Likewise.
(LF_ULONG, LF_QUADWORD, LF_UQUADWORD): Likewise.
(CV_ACCESS_PRIVATE, CV_ACCESS_PROTECTED): Likewise.
(CV_ACCESS_PUBLIC, CV_PROP_FWDREF): Likewise.
---
 gcc/dwarf2codeview.cc | 524 ++
 gcc/dwarf2codeview.h  |  17 ++
 2 files changed, 541 insertions(+)

diff --git a/gcc/dwarf2codeview.cc b/gcc/dwarf2codeview.cc
index 05f5f60997e..475a53573e9 100644
--- a/gcc/dwarf2codeview.cc
+++ b/gcc/dwarf2codeview.cc
@@ -63,6 +63,11 @@ along with GCC; see the file COPYING3.  If not see
 #define SYMBOL_START_LABEL "Lcvsymstart"
 #define SYMBOL_END_LABEL   "Lcvsymend"
 
+/* There's two bytes available for each type's size, but follow MSVC's lead in
+   capping the LF_FIELDLIST size at fb00 (minus 8 bytes for the LF_INDEX
+   pointing to the overflow entry).  */
+#define MAX_FIELDLIST_SIZE 0xfaf8
+
 #define HASH_SIZE 16
 
 struct codeview_string
@@ -170,6 +175,31 @@ struct die_hasher : free_ptr_hash 
   }
 };
 
+struct codeview_integer
+{
+  bool neg;
+  uint64_t num;
+};
+
+struct codeview_subtype
+{
+  struct codeview_subtype *next;
+  uint16_t kind;
+
+  union
+  {
+struct
+{
+  char *name;
+  struct codeview_integer value;
+} lf_enumerate;
+struct
+{
+  uint32_t type_num;
+} lf_index;
+  };
+};
+
 struct codeview_custom_type
 {
   struct codeview_custom_type *next;
@@ -188,6 +218,20 @@ struct codeview_custom_type
   uint32_t base_type;
   uint16_t modifier;
 } lf_modifier;
+struct
+{
+  size_t length;
+  codeview_subtype *subtypes;
+  codeview_subtype *last_subtype;
+} lf_fieldlist;
+struct
+{
+  uint16_t count;
+  uint16_t properties;
+  uint32_t underlying_type;
+  uint32_t fieldlist;
+  char *name;
+} lf_enum;
   };
 };
 
@@ -978,6 +1022,292 @@ write_lf_modifier (codeview_custom_type *t)
   asm_fprintf (asm_out_file, "%LLcv_type%x_end:\n", t->num);
 }
 
+/* Write a CodeView extensible integer.  If the value is non-negative and
+   < 0x8000, the value gets written directly as an uint16_t.  Otherwise, we
+   output two bytes for the integer type (LF_CHAR, LF_SHORT, ...), and the
+   actual value follows.  */
+
+static size_t
+write_cv_integer (codeview_integer *i)
+{
+  if (i->neg)
+{
+  if (i->num <= 0x80)
+   {
+ fputs (integer_asm_op (2, false), asm_out_file);
+ fprint_whex (asm_out_file, LF_CHAR);
+ putc ('\n', asm_out_file);
+
+ fputs (integer_asm_op (1, false), asm_out_file);
+ fprint_whex (asm_out_file, -i->num);
+ putc ('\n', asm_out_file);
+
+ return 3;
+   }
+  else if (i->num <= 0x8000)
+   {
+ fputs (integer_asm_op (2, false), asm_out_file);
+ fprint_whex (asm_out_file, LF_SHORT);
+ putc ('\n', asm_out_file);
+
+ fputs (integer_asm_op (2, false), asm_out_file);
+ fprint_whex (asm_out_file, -i->num);
+ putc ('\n', asm_out_file);
+
+ return 4;
+   }
+  else if (i->num <= 0x8000)
+   {
+ fputs (integer_asm_op (2, false), asm_out_file);
+ fprint_whex (asm_out_file, LF_LONG);
+ putc ('\n', asm_out_file);
+
+ fputs (integer_asm_op (4, false), asm_out_file);
+ fprint_whex (asm_out_file, -i->num);
+ putc ('\n', asm_out_file);
+
+ return 6;
+   }
+  else
+   {
+ fputs (integer_asm_op (2, false), asm_out_file);
+ fprint_whex (asm_out_file, LF_QUADWORD);
+ putc ('\n', asm_out_file);
+
+ fputs (integer_asm_op (8, false), asm_out_file);
+ fprint_whex (asm_out_file, -i->num);
+ putc ('\n', asm_out_file);
+
+ return 10;
+   }
+}
+  else
+{
+  if (i->num <= 0x7fff)
+   {
+ fputs (integer_asm_op (2, false), asm_out_file);
+ fprint_whex (asm_out_file, i->num);
+ putc ('\n', asm_out_file);
+
+ return 2;
+   }
+  else if (i->num <= 0x)
+   {
+ fputs (integer_asm_op (2, false), asm_out_file);
+ fprint_whex (asm_out_file, LF_USHORT);
+ putc 

Re: [PATCH] rs6000: ROP - Do not disable shrink-wrapping for leaf functions [PR114759]

2024-06-17 Thread Peter Bergner
On 6/17/24 6:11 PM, Segher Boessenkool wrote:
> "ROP insns" are the instructions used in such exploits, not what you
> mean here :-)
> 
> The instructions are called "hash*"C, so maybe call tbem "hash insns"
> or "ROP protect hash insns"?.

Ok, that bad verbiage was in the extra commentary not part of the git
log entry.  That said, I'll reword that to the following:

 Only disable shrink-wrapping when using -mrop-protect when we know we
-will be emitting the ROP instructions (ie, non-leaf functions).
+will be emitting the ROP protect hash instructions (ie, non-leaf functions).




>>  * config/rs6000/rs6000.cc (rs6000_override_options_after_change): Move
>>  the disabling of shrink-wrapping from here
>>  * config/rs6000/rs6000-logue.cc (rs6000_stack_info): ...to here.
> 
> Hrm.  Can you do it in some particular caller of rs6000_stack_info,
> instead?  The rs6000_stack_info function itself is not suppposed to
> change any state whatsoever.

Sure, I can look at maybe moving that to the caller or maybe somewhere
better.  I'll repost the patch once I find a better location.



> The comment should say *why*!  The fact that we do is clear from the
> code itself already.  But why do we want this?
> 
>> --- a/gcc/config/rs6000/rs6000.cc
>> +++ b/gcc/config/rs6000/rs6000.cc
>> @@ -3427,10 +3427,6 @@ rs6000_override_options_after_change (void)
>>  }
>>else if (!OPTION_SET_P (flag_cunroll_grow_size))
>>  flag_cunroll_grow_size = flag_peel_loops || optimize >= 3;
>> -
>> -  /* If we are inserting ROP-protect instructions, disable shrink wrap.  */
>> -  if (rs6000_rop_protect)
>> -flag_shrink_wrap = 0;
>>  }
> 
> (Yes, I know the original code didn't say either, but let's try to make
> things better :-) )

Yeah, I didn't write that, I only moved it, but I can try to come up with
an explanation of why we need to disable it now.  That said, my hope is to
not have to disable shrink-wrapping even when we emit the ROP protect hash
insns in the future, but that will take some extra work.  If I can manage
that, then this should all just go away. :-)  Until then, we can stick
with this patch's micro-optimization.




>> --- /dev/null
>> +++ b/gcc/testsuite/gcc.target/powerpc/pr114759-1.c
>> @@ -0,0 +1,16 @@
>> +/* { dg-do compile } */
>> +/* { dg-options "-O2 -mdejagnu-cpu=power10 -mrop-protect 
>> -fdump-rtl-pro_and_epilogue" } */
>> +/* { dg-require-effective-target rop_ok } */
> 
> Do you want rop_ok while you are *forcing* it to be okay anyway?  Why?

At the moment, yes, since the rop_ok test not only checks for the -mcpu= level,
it also verifies that the ABI is ok.  Currently, rop_ok makes sure we have
Power10 and ELFv2 ABI being used.  So currently, if we were to run this test
on BE, we'd get an UNSUPPORTED using the rop_ok check, but if we removed it,
we'd see a FAIL.  

As we discussed offline, the plan is to eventually enable emitting the ROP 
protect
hash insns on other ABIs, but until then, I think we want to keep the rop_ok 
check
so as to keep Bill's CI builder from flagging it as a FAIL.

Peter




[PATCH 02/11] Handle CodeView base types

2024-06-17 Thread Mark Harmstone
Adds a get_type_num function to translate type DIEs into CodeView
numbers, along with a hash table for this.  For now we just deal with
the base types (integers, Unicode chars, floats, and bools).

gcc/
* dwarf2codeview.cc (struct codeview_type): New structure.
(struct die_hasher): Likewise.
(types_htab): New variable.
(codeview_debug_finish): Free types_htab if allocated.
(get_type_num_base_type, get_type_num): New function.
(add_variable): Call get_type_num.
* dwarf2codeview.h (T_CHAR, T_SHORT, T_LONG, T_QUAD): Define.
(T_UCHAR, T_USHORT, T_ULONG, T_UQUAD, T_BOOL08): Likewise.
(T_REAL32, T_REAL64, T_REAL80, T_REAL128, T_RCHAR): Likewise.
(T_WCHAR, T_INT4, T_UINT4, T_CHAR16, T_CHAR32, T_CHAR8): Likewise.
---
 gcc/dwarf2codeview.cc | 196 +-
 gcc/dwarf2codeview.h  |  23 +
 2 files changed, 218 insertions(+), 1 deletion(-)

diff --git a/gcc/dwarf2codeview.cc b/gcc/dwarf2codeview.cc
index 60e84635971..eb7c1270e31 100644
--- a/gcc/dwarf2codeview.cc
+++ b/gcc/dwarf2codeview.cc
@@ -147,6 +147,27 @@ struct codeview_symbol
   };
 };
 
+struct codeview_type
+{
+  dw_die_ref die;
+  uint32_t num;
+};
+
+struct die_hasher : free_ptr_hash 
+{
+  typedef dw_die_ref compare_type;
+
+  static hashval_t hash (const codeview_type *x)
+  {
+return htab_hash_pointer (x->die);
+  }
+
+  static bool equal (const codeview_type *x, const dw_die_ref y)
+  {
+return x->die == y;
+  }
+};
+
 static unsigned int line_label_num;
 static unsigned int func_label_num;
 static unsigned int sym_label_num;
@@ -159,6 +180,7 @@ static codeview_function *funcs, *last_func;
 static const char* last_filename;
 static uint32_t last_file_id;
 static codeview_symbol *sym, *last_sym;
+static hash_table *types_htab;
 
 /* Record new line number against the current function.  */
 
@@ -838,6 +860,178 @@ codeview_debug_finish (void)
   write_source_files ();
   write_line_numbers ();
   write_codeview_symbols ();
+
+  if (types_htab)
+delete types_htab;
+}
+
+/* Translate a DWARF base type (DW_TAG_base_type) into its CodeView
+   equivalent.  */
+
+static uint32_t
+get_type_num_base_type (dw_die_ref type)
+{
+  unsigned int size = get_AT_unsigned (type, DW_AT_byte_size);
+
+  switch (get_AT_unsigned (type, DW_AT_encoding))
+{
+case DW_ATE_signed_char:
+  {
+   const char *name = get_AT_string (type, DW_AT_name);
+
+   if (size != 1)
+ return 0;
+
+   if (name && !strcmp (name, "signed char"))
+ return T_CHAR;
+   else
+ return T_RCHAR;
+  }
+
+case DW_ATE_unsigned_char:
+  if (size != 1)
+   return 0;
+
+  return T_UCHAR;
+
+case DW_ATE_signed:
+  switch (size)
+   {
+   case 2:
+ return T_SHORT;
+
+   case 4:
+ {
+   const char *name = get_AT_string (type, DW_AT_name);
+
+   if (name && !strcmp (name, "int"))
+ return T_INT4;
+   else
+ return T_LONG;
+ }
+
+   case 8:
+ return T_QUAD;
+
+   default:
+ return 0;
+   }
+
+case DW_ATE_unsigned:
+  switch (size)
+   {
+   case 2:
+ {
+   const char *name = get_AT_string (type, DW_AT_name);
+
+   if (name && !strcmp (name, "wchar_t"))
+ return T_WCHAR;
+   else
+ return T_USHORT;
+ }
+
+   case 4:
+ {
+   const char *name = get_AT_string (type, DW_AT_name);
+
+   if (name && !strcmp (name, "unsigned int"))
+ return T_UINT4;
+   else
+ return T_ULONG;
+ }
+
+   case 8:
+ return T_UQUAD;
+
+   default:
+ return 0;
+   }
+
+case DW_ATE_UTF:
+  switch (size)
+   {
+   case 1:
+ return T_CHAR8;
+
+   case 2:
+ return T_CHAR16;
+
+   case 4:
+ return T_CHAR32;
+
+   default:
+ return 0;
+   }
+
+case DW_ATE_float:
+  switch (size)
+   {
+   case 4:
+ return T_REAL32;
+
+   case 8:
+ return T_REAL64;
+
+   case 12:
+ return T_REAL80;
+
+   case 16:
+ return T_REAL128;
+
+   default:
+ return 0;
+   }
+
+case DW_ATE_boolean:
+  if (size == 1)
+   return T_BOOL08;
+  else
+   return 0;
+
+default:
+  return 0;
+}
+}
+
+/* Process a DIE representing a type definition and return its number.  If
+   it's something we can't handle, return 0.  We keep a hash table so that
+   we're not adding the same type multiple times - though if we do it's not
+   disastrous, as ld will deduplicate everything for us.  */
+
+static uint32_t
+get_type_num (dw_die_ref type)
+{
+  codeview_type **slot, *t;
+
+  if (!type)
+return 0;
+
+  if (!types_htab)
+types_htab = new hash_table (10);
+
+  slot = 

Re: [committed] testsuite: Add -Wno-psabi to vshuf-mem.C test

2024-06-17 Thread Andreas Krebbel

On 6/14/24 20:03, Jakub Jelinek wrote:

Also wonder about the
// { dg-additional-options "-march=z14" { target s390*-*-* } }
line, doesn't that mean the test will FAIL on all pre-z14 HW?
Shouldn't it use some z14_runtime or similar effective target, or
check in main (in that case copied over to g++.target/s390) whether
z14 instructions can be actually used at runtime?


Oh right. I'll remove that line and replicate the testcase in the arch 
specific test dir.


Andreas




[PATCH 03/11] Handle typedefs for CodeView

2024-06-17 Thread Mark Harmstone
gcc/
* dwarf2codeview.cc (get_type_num): Handle typedefs.
---
 gcc/dwarf2codeview.cc | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/gcc/dwarf2codeview.cc b/gcc/dwarf2codeview.cc
index eb7c1270e31..5006a176260 100644
--- a/gcc/dwarf2codeview.cc
+++ b/gcc/dwarf2codeview.cc
@@ -1024,6 +1024,12 @@ get_type_num (dw_die_ref type)
   t->num = get_type_num_base_type (type);
   break;
 
+case DW_TAG_typedef:
+  /* FIXME - signed longs typedef'd as "HRESULT" should get their
+own type (T_HRESULT) */
+  t->num = get_type_num (get_AT_ref (type, DW_AT_type));
+  break;
+
 default:
   t->num = 0;
   break;
-- 
2.44.2



[PATCH 10/11] Handle bitfields for CodeView

2024-06-17 Thread Mark Harmstone
Translates structure members with DW_AT_data_bit_offset set in DWARF
into LF_BITFIELD symbols.

gcc/
* dwarf2codeview.cc
(struct codeview_custom_type): Add lf_bitfield to union.
(write_lf_bitfield): New function.
(write_custom_types): Call write_lf_bitfield.
(create_bitfield): New function.
(get_type_num_struct): Handle bitfields.
* dwarf2codeview.h (LF_BITFIELD): Define.
---
 gcc/dwarf2codeview.cc | 89 ++-
 gcc/dwarf2codeview.h  |  1 +
 2 files changed, 88 insertions(+), 2 deletions(-)

diff --git a/gcc/dwarf2codeview.cc b/gcc/dwarf2codeview.cc
index 3f1ce5577fc..06267639169 100644
--- a/gcc/dwarf2codeview.cc
+++ b/gcc/dwarf2codeview.cc
@@ -256,6 +256,12 @@ struct codeview_custom_type
   uint32_t index_type;
   codeview_integer length_in_bytes;
 } lf_array;
+struct
+{
+  uint32_t base_type;
+  uint8_t length;
+  uint8_t position;
+} lf_bitfield;
   };
 };
 
@@ -1573,6 +1579,50 @@ write_lf_array (codeview_custom_type *t)
   asm_fprintf (asm_out_file, "%LLcv_type%x_end:\n", t->num);
 }
 
+/* Write an LF_BITFIELD type.  */
+
+static void
+write_lf_bitfield (codeview_custom_type *t)
+{
+  /* This is lf_bitfield in binutils and lfBitfield in Microsoft's cvinfo.h:
+
+struct lf_bitfield
+{
+  uint16_t size;
+  uint16_t kind;
+  uint32_t base_type;
+  uint8_t length;
+  uint8_t position;
+} ATTRIBUTE_PACKED;
+  */
+
+  fputs (integer_asm_op (2, false), asm_out_file);
+  asm_fprintf (asm_out_file, "%LLcv_type%x_end - %LLcv_type%x_start\n",
+  t->num, t->num);
+
+  asm_fprintf (asm_out_file, "%LLcv_type%x_start:\n", t->num);
+
+  fputs (integer_asm_op (2, false), asm_out_file);
+  fprint_whex (asm_out_file, t->kind);
+  putc ('\n', asm_out_file);
+
+  fputs (integer_asm_op (4, false), asm_out_file);
+  fprint_whex (asm_out_file, t->lf_bitfield.base_type);
+  putc ('\n', asm_out_file);
+
+  fputs (integer_asm_op (1, false), asm_out_file);
+  fprint_whex (asm_out_file, t->lf_bitfield.length);
+  putc ('\n', asm_out_file);
+
+  fputs (integer_asm_op (1, false), asm_out_file);
+  fprint_whex (asm_out_file, t->lf_bitfield.position);
+  putc ('\n', asm_out_file);
+
+  write_cv_padding (2);
+
+  asm_fprintf (asm_out_file, "%LLcv_type%x_end:\n", t->num);
+}
+
 /* Write the .debug$T section, which contains all of our custom type
definitions.  */
 
@@ -1619,6 +1669,10 @@ write_custom_types (void)
case LF_ARRAY:
  write_lf_array (custom_types);
  break;
+
+   case LF_BITFIELD:
+ write_lf_bitfield (custom_types);
+ break;
}
 
   free (custom_types);
@@ -2199,6 +2253,33 @@ add_struct_forward_def (dw_die_ref type)
   return ct->num;
 }
 
+/* Add an LF_BITFIELD type, returning its number.  DWARF represents bitfields
+   as members in a struct with a DW_AT_data_bit_offset attribute, whereas in
+   CodeView they're a distinct type.  */
+
+static uint32_t
+create_bitfield (dw_die_ref c)
+{
+  codeview_custom_type *ct;
+  uint32_t base_type;
+
+  base_type = get_type_num (get_AT_ref (c, DW_AT_type), true, false);
+  if (base_type == 0)
+return 0;
+
+  ct = (codeview_custom_type *) xmalloc (sizeof (codeview_custom_type));
+
+  ct->next = NULL;
+  ct->kind = LF_BITFIELD;
+  ct->lf_bitfield.base_type = base_type;
+  ct->lf_bitfield.length = get_AT_unsigned (c, DW_AT_bit_size);
+  ct->lf_bitfield.position = get_AT_unsigned (c, DW_AT_data_bit_offset);
+
+  add_custom_type (ct);
+
+  return ct->num;
+}
+
 /* Process a DW_TAG_structure_type, DW_TAG_class_type, or DW_TAG_union_type
DIE, add an LF_FIELDLIST and an LF_STRUCTURE / LF_CLASS / LF_UNION type,
and return the number of the latter.  */
@@ -2279,8 +2360,12 @@ get_type_num_struct (dw_die_ref type, bool in_struct, 
bool *is_fwd_ref)
  break;
}
 
- el->lf_member.type = get_type_num (get_AT_ref (c, DW_AT_type), true,
-   false);
+ if (get_AT (c, DW_AT_data_bit_offset))
+   el->lf_member.type = create_bitfield (c);
+ else
+   el->lf_member.type = get_type_num (get_AT_ref (c, DW_AT_type),
+  true, false);
+
  el->lf_member.offset.neg = false;
  el->lf_member.offset.num = get_AT_unsigned (c,
  
DW_AT_data_member_location);
diff --git a/gcc/dwarf2codeview.h b/gcc/dwarf2codeview.h
index 70eed6bf2aa..70eae554b80 100644
--- a/gcc/dwarf2codeview.h
+++ b/gcc/dwarf2codeview.h
@@ -64,6 +64,7 @@ along with GCC; see the file COPYING3.  If not see
 #define LF_MODIFIER0x1001
 #define LF_POINTER 0x1002
 #define LF_FIELDLIST   0x1203
+#define LF_BITFIELD0x1205
 #define LF_INDEX   0x1404
 #define LF_ENUMERATE   0x1502
 #define LF_ARRAY   0x1503

[PATCH 05/11] Handle const and varible modifiers for CodeView

2024-06-17 Thread Mark Harmstone
Translate DW_TAG_const_type and DW_TAG_volatile_type DIEs into
LF_MODIFIER symbols.

gcc/
* dwarf2codeview.cc
(struct codeview_custom_type): Add lf_modifier to union.
(write_cv_padding, write_lf_modifier): New functions.
(write_custom_types): Call write_lf_modifier.
(get_type_num_const_type): New function.
(get_type_num_volatile_type): Likewise.
(get_type_num): Handle DW_TAG_const_type and
DW_TAG_volatile_type DIEs.
* dwarf2codeview.h (MOD_const, MOD_volatile): Define.
(LF_MODIFIER): Likewise.
---
 gcc/dwarf2codeview.cc | 157 ++
 gcc/dwarf2codeview.h  |   5 ++
 2 files changed, 162 insertions(+)

diff --git a/gcc/dwarf2codeview.cc b/gcc/dwarf2codeview.cc
index 51401f2d5bc..05f5f60997e 100644
--- a/gcc/dwarf2codeview.cc
+++ b/gcc/dwarf2codeview.cc
@@ -183,6 +183,11 @@ struct codeview_custom_type
   uint32_t base_type;
   uint32_t attributes;
 } lf_pointer;
+struct
+{
+  uint32_t base_type;
+  uint16_t modifier;
+} lf_modifier;
   };
 };
 
@@ -903,6 +908,76 @@ write_lf_pointer (codeview_custom_type *t)
   asm_fprintf (asm_out_file, "%LLcv_type%x_end:\n", t->num);
 }
 
+/* All CodeView type definitions have to be aligned to a four-byte boundary,
+   so write some padding bytes if necessary.  These have to be specific values:
+   f3, f2, f1.  */
+
+static void
+write_cv_padding (size_t padding)
+{
+  if (padding == 4 || padding == 0)
+return;
+
+  if (padding == 3)
+{
+  fputs (integer_asm_op (1, false), asm_out_file);
+  fprint_whex (asm_out_file, 0xf3);
+  putc ('\n', asm_out_file);
+}
+
+  if (padding >= 2)
+{
+  fputs (integer_asm_op (1, false), asm_out_file);
+  fprint_whex (asm_out_file, 0xf2);
+  putc ('\n', asm_out_file);
+}
+
+  fputs (integer_asm_op (1, false), asm_out_file);
+  fprint_whex (asm_out_file, 0xf1);
+  putc ('\n', asm_out_file);
+}
+
+/* Write an LF_MODIFIER type, representing a const and/or volatile modification
+   of another type.  */
+
+static void
+write_lf_modifier (codeview_custom_type *t)
+{
+  /* This is lf_modifier in binutils and lfModifier in Microsoft's cvinfo.h:
+
+struct lf_modifier
+{
+  uint16_t size;
+  uint16_t kind;
+  uint32_t base_type;
+  uint16_t modifier;
+  uint16_t padding;
+} ATTRIBUTE_PACKED;
+  */
+
+  fputs (integer_asm_op (2, false), asm_out_file);
+  asm_fprintf (asm_out_file, "%LLcv_type%x_end - %LLcv_type%x_start\n",
+  t->num, t->num);
+
+  asm_fprintf (asm_out_file, "%LLcv_type%x_start:\n", t->num);
+
+  fputs (integer_asm_op (2, false), asm_out_file);
+  fprint_whex (asm_out_file, t->kind);
+  putc ('\n', asm_out_file);
+
+  fputs (integer_asm_op (4, false), asm_out_file);
+  fprint_whex (asm_out_file, t->lf_modifier.base_type);
+  putc ('\n', asm_out_file);
+
+  fputs (integer_asm_op (2, false), asm_out_file);
+  fprint_whex (asm_out_file, t->lf_modifier.modifier);
+  putc ('\n', asm_out_file);
+
+  write_cv_padding (2);
+
+  asm_fprintf (asm_out_file, "%LLcv_type%x_end:\n", t->num);
+}
+
 /* Write the .debug$T section, which contains all of our custom type
definitions.  */
 
@@ -924,6 +999,10 @@ write_custom_types (void)
case LF_POINTER:
  write_lf_pointer (custom_types);
  break;
+
+   case LF_MODIFIER:
+ write_lf_modifier (custom_types);
+ break;
}
 
   free (custom_types);
@@ -1159,6 +1238,76 @@ get_type_num_pointer_type (dw_die_ref type)
   return ct->num;
 }
 
+/* Process a DW_TAG_const_type DIE, adding an LF_MODIFIER type and returning
+   its number.  */
+
+static uint32_t
+get_type_num_const_type (dw_die_ref type)
+{
+  dw_die_ref base_type;
+  uint32_t base_type_num;
+  codeview_custom_type *ct;
+  bool is_volatile = false;
+
+  base_type = get_AT_ref (type, DW_AT_type);
+  if (!base_type)
+return 0;
+
+  /* Handle case when this is a const volatile type - we only need one
+ LF_MODIFIER for this.  */
+  if (dw_get_die_tag (base_type) == DW_TAG_volatile_type)
+{
+  is_volatile = true;
+
+  base_type = get_AT_ref (base_type, DW_AT_type);
+  if (!base_type)
+   return 0;
+}
+
+  base_type_num = get_type_num (base_type);
+  if (base_type_num == 0)
+return 0;
+
+  ct = (codeview_custom_type *) xmalloc (sizeof (codeview_custom_type));
+
+  ct->next = NULL;
+  ct->kind = LF_MODIFIER;
+  ct->lf_modifier.base_type = base_type_num;
+  ct->lf_modifier.modifier = MOD_const;
+
+  if (is_volatile)
+ct->lf_modifier.modifier |= MOD_volatile;
+
+  add_custom_type (ct);
+
+  return ct->num;
+}
+
+/* Process a DW_TAG_volatile_type DIE, adding an LF_MODIFIER type and
+   returning its number.  */
+
+static uint32_t
+get_type_num_volatile_type (dw_die_ref type)
+{
+  uint32_t base_type_num;
+  codeview_custom_type *ct;
+
+  base_type_num = get_type_num (get_AT_ref (type, 

[PATCH 07/11] Handle structs and classes for CodeView

2024-06-17 Thread Mark Harmstone
Translates DW_TAG_structure_type DIEs into LF_STRUCTURE symbols, and
DW_TAG_class_type DIEs into LF_CLASS symbols.

gcc/
* dwarf2codeview.cc
(struct codeview_type): Add is_fwd_ref member.
(struct codeview_subtype): Add lf_member to union.
(struct codeview_custom_type): Add lf_structure to union.
(struct codeview_deferred_type): New structure.
(deferred_types, last_deferred_type): New variables.
(get_type_num): Add new args to prototype.
(write_lf_fieldlist): Handle LF_MEMBER subtypes.
(write_lf_structure): New function.
(write_custom_types): Call write_lf_structure.
(get_type_num_pointer_type): Add in_struct argument.
(get_type_num_const_type): Likewise.
(get_type_num_volatile_type): Likewise.
(add_enum_forward_def): Fix get_type_num call.
(get_type_num_enumeration_type): Add in-struct argument.
(add_deferred_type, flush_deferred_types): New functions.
(add_struct_forward_def, get_type_num_struct): Likewise.
(get_type_num): Handle self-referential structs.
(add_variable): Fix get_type_num call.
(codeview_debug_early_finish): Call flush_deferred_types.
* dwarf2codeview.h (LF_CLASS, LF_STRUCTURE, LF_MEMBER): Define.
---
 gcc/dwarf2codeview.cc | 513 --
 gcc/dwarf2codeview.h  |   3 +
 2 files changed, 493 insertions(+), 23 deletions(-)

diff --git a/gcc/dwarf2codeview.cc b/gcc/dwarf2codeview.cc
index 475a53573e9..9c6614f6297 100644
--- a/gcc/dwarf2codeview.cc
+++ b/gcc/dwarf2codeview.cc
@@ -158,6 +158,7 @@ struct codeview_type
 {
   dw_die_ref die;
   uint32_t num;
+  bool is_fwd_ref;
 };
 
 struct die_hasher : free_ptr_hash 
@@ -197,6 +198,13 @@ struct codeview_subtype
 {
   uint32_t type_num;
 } lf_index;
+struct
+{
+  uint16_t attributes;
+  uint32_t type;
+  codeview_integer offset;
+  char *name;
+} lf_member;
   };
 };
 
@@ -232,9 +240,25 @@ struct codeview_custom_type
   uint32_t fieldlist;
   char *name;
 } lf_enum;
+struct
+{
+  uint16_t num_members;
+  uint16_t properties;
+  uint32_t field_list;
+  uint32_t derived_from;
+  uint32_t vshape;
+  codeview_integer length;
+  char *name;
+} lf_structure;
   };
 };
 
+struct codeview_deferred_type
+{
+  struct codeview_deferred_type *next;
+  dw_die_ref type;
+};
+
 static unsigned int line_label_num;
 static unsigned int func_label_num;
 static unsigned int sym_label_num;
@@ -249,8 +273,9 @@ static uint32_t last_file_id;
 static codeview_symbol *sym, *last_sym;
 static hash_table *types_htab;
 static codeview_custom_type *custom_types, *last_custom_type;
+static codeview_deferred_type *deferred_types, *last_deferred_type;
 
-static uint32_t get_type_num (dw_die_ref type);
+static uint32_t get_type_num (dw_die_ref type, bool in_struct, bool 
no_fwd_ref);
 
 /* Record new line number against the current function.  */
 
@@ -1217,6 +1242,51 @@ write_lf_fieldlist (codeview_custom_type *t)
  free (v->lf_enumerate.name);
  break;
 
+   case LF_MEMBER:
+ /* This is lf_member in binutils and lfMember in Microsoft's
+cvinfo.h:
+
+   struct lf_member
+   {
+ uint16_t kind;
+ uint16_t attributes;
+ uint32_t type;
+ uint16_t offset;
+ char name[];
+   } ATTRIBUTE_PACKED;
+ */
+
+ fputs (integer_asm_op (2, false), asm_out_file);
+ fprint_whex (asm_out_file, LF_MEMBER);
+ putc ('\n', asm_out_file);
+
+ fputs (integer_asm_op (2, false), asm_out_file);
+ fprint_whex (asm_out_file, v->lf_member.attributes);
+ putc ('\n', asm_out_file);
+
+ fputs (integer_asm_op (4, false), asm_out_file);
+ fprint_whex (asm_out_file, v->lf_member.type);
+ putc ('\n', asm_out_file);
+
+ leaf_len = 8 + write_cv_integer (>lf_member.offset);
+
+ if (v->lf_member.name)
+   {
+ name_len = strlen (v->lf_member.name) + 1;
+ ASM_OUTPUT_ASCII (asm_out_file, v->lf_member.name, name_len);
+   }
+ else
+   {
+ name_len = 1;
+ ASM_OUTPUT_ASCII (asm_out_file, "", name_len);
+   }
+
+ leaf_len += name_len;
+ write_cv_padding (4 - (leaf_len % 4));
+
+ free (v->lf_member.name);
+ break;
+
case LF_INDEX:
  /* This is lf_index in binutils and lfIndex in Microsoft's cvinfo.h:
 
@@ -1308,6 +1378,82 @@ write_lf_enum (codeview_custom_type *t)
   asm_fprintf (asm_out_file, "%LLcv_type%x_end:\n", t->num);
 }
 
+/* Write an LF_STRUCTURE or LF_CLASS type (the two have the same structure).  
*/
+
+static void
+write_lf_structure (codeview_custom_type *t)
+{
+  size_t name_len, leaf_len;

[PATCH 01/11] Output CodeView data about variables

2024-06-17 Thread Mark Harmstone
Parse the DW_TAG_variable DIEs, and outputs S_GDATA32 (for global variables)
and S_LDATA32 (static global variables) symbols into the .debug$S section.

gcc/
* dwarf2codeview.cc (S_LDATA32, S_GDATA32): Define.
(struct codeview_symbol): New structure.
(sym, last_sym): New variables.
(write_data_symbol): New function.
(write_codeview_symbols): Call write_data_symbol.
(add_variable, codeview_debug_early_finish): New functions.
* dwarf2codeview.h (codeview_debug_early_finish): Prototype.
* dwarf2out.cc
(dwarf2out_early_finish): Call codeview_debug_early_finish.
---
 gcc/dwarf2codeview.cc | 160 ++
 gcc/dwarf2codeview.h  |   1 +
 gcc/dwarf2out.cc  |   5 ++
 3 files changed, 166 insertions(+)

diff --git a/gcc/dwarf2codeview.cc b/gcc/dwarf2codeview.cc
index db776d79be4..60e84635971 100644
--- a/gcc/dwarf2codeview.cc
+++ b/gcc/dwarf2codeview.cc
@@ -46,6 +46,8 @@ along with GCC; see the file COPYING3.  If not see
 
 #define CHKSUM_TYPE_MD51
 
+#define S_LDATA32  0x110c
+#define S_GDATA32  0x110d
 #define S_COMPILE3 0x113c
 
 #define CV_CFL_80386   0x03
@@ -129,6 +131,22 @@ struct codeview_function
   codeview_line_block *blocks, *last_block;
 };
 
+struct codeview_symbol
+{
+  codeview_symbol *next;
+  uint16_t kind;
+
+  union
+  {
+struct
+{
+  uint32_t type;
+  char *name;
+  dw_die_ref die;
+} data_symbol;
+  };
+};
+
 static unsigned int line_label_num;
 static unsigned int func_label_num;
 static unsigned int sym_label_num;
@@ -140,6 +158,7 @@ static codeview_string *strings, *last_string;
 static codeview_function *funcs, *last_func;
 static const char* last_filename;
 static uint32_t last_file_id;
+static codeview_symbol *sym, *last_sym;
 
 /* Record new line number against the current function.  */
 
@@ -698,6 +717,77 @@ write_compile3_symbol (void)
   targetm.asm_out.internal_label (asm_out_file, SYMBOL_END_LABEL, label_num);
 }
 
+/* Write an S_GDATA32 symbol, representing a global variable, or an S_LDATA32
+   symbol, for a static global variable.  */
+
+static void
+write_data_symbol (codeview_symbol *s)
+{
+  unsigned int label_num = ++sym_label_num;
+  dw_attr_node *loc;
+  dw_loc_descr_ref loc_ref;
+
+  /* This is struct datasym in binutils:
+
+  struct datasym
+  {
+   uint16_t size;
+   uint16_t kind;
+   uint32_t type;
+   uint32_t offset;
+   uint16_t section;
+   char name[];
+  } ATTRIBUTE_PACKED;
+  */
+
+  /* Extract the DW_AT_location attribute from the DIE, and make sure it's in
+ in a format we can parse.  */
+
+  loc = get_AT (s->data_symbol.die, DW_AT_location);
+  if (!loc)
+goto end;
+
+  if (loc->dw_attr_val.val_class != dw_val_class_loc)
+goto end;
+
+  loc_ref = loc->dw_attr_val.v.val_loc;
+  if (!loc_ref || loc_ref->dw_loc_opc != DW_OP_addr)
+goto end;
+
+  /* Output the S_GDATA32 / S_LDATA32 record.  */
+
+  fputs (integer_asm_op (2, false), asm_out_file);
+  asm_fprintf (asm_out_file,
+  "%L" SYMBOL_END_LABEL "%u - %L" SYMBOL_START_LABEL "%u\n",
+  label_num, label_num);
+
+  targetm.asm_out.internal_label (asm_out_file, SYMBOL_START_LABEL, label_num);
+
+  fputs (integer_asm_op (2, false), asm_out_file);
+  fprint_whex (asm_out_file, s->kind);
+  putc ('\n', asm_out_file);
+
+  fputs (integer_asm_op (4, false), asm_out_file);
+  fprint_whex (asm_out_file, s->data_symbol.type);
+  putc ('\n', asm_out_file);
+
+  asm_fprintf (asm_out_file, "\t.secrel32 ");
+  output_addr_const (asm_out_file, loc_ref->dw_loc_oprnd1.v.val_addr);
+  fputc ('\n', asm_out_file);
+
+  asm_fprintf (asm_out_file, "\t.secidx ");
+  output_addr_const (asm_out_file, loc_ref->dw_loc_oprnd1.v.val_addr);
+  fputc ('\n', asm_out_file);
+
+  ASM_OUTPUT_ASCII (asm_out_file, s->data_symbol.name,
+   strlen (s->data_symbol.name) + 1);
+
+  targetm.asm_out.internal_label (asm_out_file, SYMBOL_END_LABEL, label_num);
+
+end:
+  free (s->data_symbol.name);
+}
+
 /* Write the CodeView symbols into the .debug$S section.  */
 
 static void
@@ -714,6 +804,22 @@ write_codeview_symbols (void)
 
   write_compile3_symbol ();
 
+  while (sym)
+{
+  codeview_symbol *n = sym->next;
+
+  switch (sym->kind)
+   {
+   case S_LDATA32:
+   case S_GDATA32:
+ write_data_symbol (sym);
+ break;
+   }
+
+  free (sym);
+  sym = n;
+}
+
   asm_fprintf (asm_out_file, "%LLcv_syms_end:\n");
 }
 
@@ -734,4 +840,58 @@ codeview_debug_finish (void)
   write_codeview_symbols ();
 }
 
+/* Process a DW_TAG_variable DIE, and add an S_GDATA32 or S_LDATA32 symbol for
+   this.  */
+
+static void
+add_variable (dw_die_ref die)
+{
+  codeview_symbol *s;
+  const char *name;
+
+  name = get_AT_string (die, DW_AT_name);
+  if (!name)
+return;
+
+  s = (codeview_symbol *) 

[PATCH 04/11] Handle pointers for CodeView

2024-06-17 Thread Mark Harmstone
Translates DW_TAG_pointer_type DIEs into LF_POINTER symbols, which get
output into the .debug$T section.

gcc/
* dwarf2codeview.cc (FIRST_TYPE): Define.
(struct codeview_custom_type): New structure.
(custom_types, last_custom_type): New variables.
(get_type_num): Prototype.
(write_lf_pointer, write_custom_types): New functions.
(codeview_debug_finish): Call write_custom_types.
(add_custom_type, get_type_num_pointer_type): New functions.
(get_type_num): Handle DW_TAG_pointer_type DIEs.
* dwarf2codeview.h (T_VOID): Define.
(CV_POINTER_32, CV_POINTER_64): Likewise.
(T_32PVOID, T_64PVOID): Likewise.
(CV_PTR_NEAR32, CV_PTR64, LF_POINTER): Likewise.
---
 gcc/dwarf2codeview.cc | 179 +-
 gcc/dwarf2codeview.h  |  13 +++
 2 files changed, 188 insertions(+), 4 deletions(-)

diff --git a/gcc/dwarf2codeview.cc b/gcc/dwarf2codeview.cc
index 5006a176260..51401f2d5bc 100644
--- a/gcc/dwarf2codeview.cc
+++ b/gcc/dwarf2codeview.cc
@@ -56,6 +56,8 @@ along with GCC; see the file COPYING3.  If not see
 #define CV_CFL_C   0x00
 #define CV_CFL_CXX 0x01
 
+#define FIRST_TYPE 0x1000
+
 #define LINE_LABEL "Lcvline"
 #define END_FUNC_LABEL "Lcvendfunc"
 #define SYMBOL_START_LABEL "Lcvsymstart"
@@ -168,6 +170,22 @@ struct die_hasher : free_ptr_hash 
   }
 };
 
+struct codeview_custom_type
+{
+  struct codeview_custom_type *next;
+  uint32_t num;
+  uint16_t kind;
+
+  union
+  {
+struct
+{
+  uint32_t base_type;
+  uint32_t attributes;
+} lf_pointer;
+  };
+};
+
 static unsigned int line_label_num;
 static unsigned int func_label_num;
 static unsigned int sym_label_num;
@@ -181,6 +199,9 @@ static const char* last_filename;
 static uint32_t last_file_id;
 static codeview_symbol *sym, *last_sym;
 static hash_table *types_htab;
+static codeview_custom_type *custom_types, *last_custom_type;
+
+static uint32_t get_type_num (dw_die_ref type);
 
 /* Record new line number against the current function.  */
 
@@ -845,6 +866,71 @@ write_codeview_symbols (void)
   asm_fprintf (asm_out_file, "%LLcv_syms_end:\n");
 }
 
+/* Write an LF_POINTER type.  */
+
+static void
+write_lf_pointer (codeview_custom_type *t)
+{
+  /* This is lf_pointer in binutils and lfPointer in Microsoft's cvinfo.h:
+
+struct lf_pointer
+{
+  uint16_t size;
+  uint16_t kind;
+  uint32_t base_type;
+  uint32_t attributes;
+} ATTRIBUTE_PACKED;
+  */
+
+  fputs (integer_asm_op (2, false), asm_out_file);
+  asm_fprintf (asm_out_file, "%LLcv_type%x_end - %LLcv_type%x_start\n",
+  t->num, t->num);
+
+  asm_fprintf (asm_out_file, "%LLcv_type%x_start:\n", t->num);
+
+  fputs (integer_asm_op (2, false), asm_out_file);
+  fprint_whex (asm_out_file, t->kind);
+  putc ('\n', asm_out_file);
+
+  fputs (integer_asm_op (4, false), asm_out_file);
+  fprint_whex (asm_out_file, t->lf_pointer.base_type);
+  putc ('\n', asm_out_file);
+
+  fputs (integer_asm_op (4, false), asm_out_file);
+  fprint_whex (asm_out_file, t->lf_pointer.attributes);
+  putc ('\n', asm_out_file);
+
+  asm_fprintf (asm_out_file, "%LLcv_type%x_end:\n", t->num);
+}
+
+/* Write the .debug$T section, which contains all of our custom type
+   definitions.  */
+
+static void
+write_custom_types (void)
+{
+  targetm.asm_out.named_section (".debug$T", SECTION_DEBUG, NULL);
+
+  fputs (integer_asm_op (4, false), asm_out_file);
+  fprint_whex (asm_out_file, CV_SIGNATURE_C13);
+  putc ('\n', asm_out_file);
+
+  while (custom_types)
+{
+  codeview_custom_type *n = custom_types->next;
+
+  switch (custom_types->kind)
+   {
+   case LF_POINTER:
+ write_lf_pointer (custom_types);
+ break;
+   }
+
+  free (custom_types);
+  custom_types = n;
+}
+}
+
 /* Finish CodeView debug info emission.  */
 
 void
@@ -861,6 +947,9 @@ codeview_debug_finish (void)
   write_line_numbers ();
   write_codeview_symbols ();
 
+  if (custom_types)
+write_custom_types ();
+
   if (types_htab)
 delete types_htab;
 }
@@ -993,10 +1082,88 @@ get_type_num_base_type (dw_die_ref type)
 }
 }
 
-/* Process a DIE representing a type definition and return its number.  If
-   it's something we can't handle, return 0.  We keep a hash table so that
-   we're not adding the same type multiple times - though if we do it's not
-   disastrous, as ld will deduplicate everything for us.  */
+/* Add a new codeview_custom_type to our singly-linked custom_types list.  */
+
+static void
+add_custom_type (codeview_custom_type *ct)
+{
+  uint32_t num;
+
+  if (last_custom_type)
+{
+  num = last_custom_type->num + 1;
+  last_custom_type->next = ct;
+}
+  else
+{
+  num = FIRST_TYPE;
+  custom_types = ct;
+}
+
+  last_custom_type = ct;
+
+  ct->num = num;
+}
+
+/* Process a DW_TAG_pointer_type DIE.  If 

[PATCH 00/11] CodeView variables and type system

2024-06-17 Thread Mark Harmstone
This patch series adds support for outputting global variables when the
-gcodeview option is provided, along with the type system to go along
with this.

As with previous patches, the best way to see the output is run
Microsoft's cvdump.exe against the object file:
https://github.com/microsoft/microsoft-pdb/raw/master/cvdump/cvdump.exe

You'll also need a recentish version of binutils in order to get ld to
output an actual PDB file that can be read by MSVC or windbg.

This ought to be fairly complete as far as C is concerned. Still to come
are functions, local variables, and some C++ things.

Mark Harmstone (11):
  Output CodeView data about variables
  Handle CodeView base types
  Handle typedefs for CodeView
  Handle pointers for CodeView
  Handle const and varible modifiers for CodeView
  Handle enums for CodeView
  Handle structs and classes for CodeView
  Handle unions for CodeView.
  Handle arrays for CodeView
  Handle bitfields for CodeView
  Handle subroutine types in CodeView

 gcc/dwarf2codeview.cc | 2278 -
 gcc/dwarf2codeview.h  |   67 ++
 gcc/dwarf2out.cc  |5 +
 3 files changed, 2341 insertions(+), 9 deletions(-)

-- 
2.44.2



[PATCH] function.h: eliminate macros "dom_computed" and "n_bbs_in_dom_tree"

2024-06-17 Thread David Malcolm
Be explicit when we use "cfun".

No functional change intended.

Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.

OK for trunk?

gcc/ChangeLog:
* dominance.cc (compute_dom_fast_query): Replace uses of
"dom_computed" macro with explicit use of cfun.
(compute_dom_fast_query_in_region): Likewise.
(calculate_dominance_info): Likewise, also for macro
"n_bbs_in_dom_tree".
(calculate_dominance_info_for_region): Likewise for
"dom_computed" macro.
(get_immediate_dominator): Likewise.
(set_immediate_dominator): Likewise.
(get_dominated_by): Likewise.
(redirect_immediate_dominators): Likewise.
(nearest_common_dominator): Likewise.
(dominated_by_p): Likewise.
(bb_dom_dfs_in): Likewise.
(bb_dom_dfs_out): Likewise.
(recompute_dominator): Likewise.
(iterate_fix_dominators): Likewise.
(add_to_dominance_info): Likewise, also for macro
"n_bbs_in_dom_tree".
(delete_from_dominance_info): Likewise.
(set_dom_info_availability): Likewise for
"dom_computed" macro.
* function.h (dom_computed): Delete macro.
(n_bbs_in_dom_tree): Delete macro.

Signed-off-by: David Malcolm 
---
 gcc/dominance.cc | 70 +---
 gcc/function.h   |  3 ---
 2 files changed, 36 insertions(+), 37 deletions(-)

diff --git a/gcc/dominance.cc b/gcc/dominance.cc
index 0357210ed27f..528b38caa9db 100644
--- a/gcc/dominance.cc
+++ b/gcc/dominance.cc
@@ -672,7 +672,7 @@ compute_dom_fast_query (enum cdi_direction dir)
 
   gcc_checking_assert (dom_info_available_p (dir));
 
-  if (dom_computed[dir_index] == DOM_OK)
+  if (cfun->cfg->x_dom_computed[dir_index] == DOM_OK)
 return;
 
   FOR_ALL_BB_FN (bb, cfun)
@@ -681,7 +681,7 @@ compute_dom_fast_query (enum cdi_direction dir)
assign_dfs_numbers (bb->dom[dir_index], );
 }
 
-  dom_computed[dir_index] = DOM_OK;
+  cfun->cfg->x_dom_computed[dir_index] = DOM_OK;
 }
 
 /* Analogous to the previous function but compute the data for reducible
@@ -697,7 +697,7 @@ compute_dom_fast_query_in_region (enum cdi_direction dir,
 
   gcc_checking_assert (dom_info_available_p (dir));
 
-  if (dom_computed[dir_index] == DOM_OK)
+  if (cfun->cfg->x_dom_computed[dir_index] == DOM_OK)
 return;
 
   /* Assign dfs numbers for region nodes except for entry and exit nodes.  */
@@ -708,7 +708,7 @@ compute_dom_fast_query_in_region (enum cdi_direction dir,
assign_dfs_numbers (bb->dom[dir_index], );
 }
 
-  dom_computed[dir_index] = DOM_OK;
+  cfun->cfg->x_dom_computed[dir_index] = DOM_OK;
 }
 
 /* The main entry point into this module.  DIR is set depending on whether
@@ -721,7 +721,7 @@ calculate_dominance_info (cdi_direction dir, bool 
compute_fast_query)
 {
   unsigned int dir_index = dom_convert_dir_to_idx (dir);
 
-  if (dom_computed[dir_index] == DOM_OK)
+  if (cfun->cfg->x_dom_computed[dir_index] == DOM_OK)
 {
   checking_verify_dominators (dir);
   return;
@@ -730,14 +730,14 @@ calculate_dominance_info (cdi_direction dir, bool 
compute_fast_query)
   timevar_push (TV_DOMINANCE);
   if (!dom_info_available_p (dir))
 {
-  gcc_assert (!n_bbs_in_dom_tree[dir_index]);
+  gcc_assert (!cfun->cfg->x_n_bbs_in_dom_tree[dir_index]);
 
   basic_block b;
   FOR_ALL_BB_FN (b, cfun)
{
  b->dom[dir_index] = et_new_tree (b);
}
-  n_bbs_in_dom_tree[dir_index] = n_basic_blocks_for_fn (cfun);
+  cfun->cfg->x_n_bbs_in_dom_tree[dir_index] = n_basic_blocks_for_fn (cfun);
 
   dom_info di (cfun, dir);
   di.calc_dfs_tree ();
@@ -749,7 +749,7 @@ calculate_dominance_info (cdi_direction dir, bool 
compute_fast_query)
et_set_father (b->dom[dir_index], d->dom[dir_index]);
}
 
-  dom_computed[dir_index] = DOM_NO_FAST_QUERY;
+  cfun->cfg->x_dom_computed[dir_index] = DOM_NO_FAST_QUERY;
 }
   else
 checking_verify_dominators (dir);
@@ -772,7 +772,7 @@ calculate_dominance_info_for_region (cdi_direction dir,
   basic_block bb;
   unsigned int i;
 
-  if (dom_computed[dir_index] == DOM_OK)
+  if (cfun->cfg->x_dom_computed[dir_index] == DOM_OK)
 return;
 
   timevar_push (TV_DOMINANCE);
@@ -791,7 +791,7 @@ calculate_dominance_info_for_region (cdi_direction dir,
 if (basic_block d = di.get_idom (bb))
   et_set_father (bb->dom[dir_index], d->dom[dir_index]);
 
-  dom_computed[dir_index] = DOM_NO_FAST_QUERY;
+  cfun->cfg->x_dom_computed[dir_index] = DOM_NO_FAST_QUERY;
   compute_dom_fast_query_in_region (dir, region);
 
   timevar_pop (TV_DOMINANCE);
@@ -858,7 +858,7 @@ get_immediate_dominator (enum cdi_direction dir, 
basic_block bb)
   unsigned int dir_index = dom_convert_dir_to_idx (dir);
   struct et_node *node = bb->dom[dir_index];
 
-  gcc_checking_assert (dom_computed[dir_index]);
+  gcc_checking_assert (cfun->cfg->x_dom_computed[dir_index]);
 
   if (!node->father)
 

Results for 15.0.0 20240617 (experimental) [master r15-1385-gd78694c238c] (GCC) testsuite on x86_64-pc-linux-gnu

2024-06-17 Thread haochenj--- via Gcc-testresults
ot; * 2" 1
FAIL: gcc.dg/vect/slp-perm-9.c -flto -ffat-lto-objects  scan-tree-dump-times 
vect "vectorizing stmts using SLP" 1
FAIL: gcc.dg/vect/slp-perm-9.c scan-tree-dump-times vect "vectorizing stmts 
using SLP" 1
XPASS: gcc.dg/vect/vect-reduc-in-order-1.c -flto -ffat-lto-objects execution 
test
XPASS: gcc.dg/vect/vect-reduc-in-order-1.c execution test
XPASS: gcc.dg/vect/vect-reduc-in-order-2.c -flto -ffat-lto-objects execution 
test
XPASS: gcc.dg/vect/vect-reduc-in-order-2.c execution test
XPASS: gcc.dg/vect/vect-reduc-in-order-3.c -flto -ffat-lto-objects execution 
test
XPASS: gcc.dg/vect/vect-reduc-in-order-3.c 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.target/i386/avx512bw-vmovdqu16-1.c scan-assembler-times 
(?:vmovdqu16|vextracti128)[ t]+[^{\\n]*%ymm[0-9]+[^\\n]*)(?:\\n|[ 
t]+#) 1
FAIL: gcc.target/i386/avx512bw-vmovdqu16-1.c scan-assembler-times 
(?:vmovdqu16|vinserti128)[ t]+[^{\\n]*)[^\\n]*%ymm[0-9]+(?:\\n|[ 
t]+#) 1
FAIL: gcc.target/i386/avx512dq-pr88465.c scan-assembler-times kxnorb[ \\t] 1
FAIL: gcc.target/i386/avx512f-pr88465.c scan-assembler-times kxnorw[ \\t] 1
FAIL: gcc.target/i386/avx512fp16-13.c scan-assembler-times vmovdqu16[ 
t]*[^,]*,[^{\\n]*%xmm[0-9] 1
FAIL: gcc.target/i386/avx512fp16-13.c scan-assembler-times vmovdqu16[ 
t]*[^,]*,[^{\\n]*%ymm[0-9] 1
FAIL: gcc.target/i386/avx512fp16-13.c scan-assembler-times vmovdqu16[ 
t]*[^{\\n]*%xmm[0-9], *[^,]* 1
FAIL: gcc.target/i386/avx512fp16-13.c scan-assembler-times vmovdqu16[ 
t]*[^{\\n]*%ymm[0-9], *[^,]* 1
XPASS: gcc.target/i386/bitwise_mask_op-3.c scan-assembler-times kmovb[\\t ] 4
XPASS: gcc.target/i386/bitwise_mask_op-3.c scan-assembler-times korb[\\t ] 1
XPASS: gcc.target/i386/bitwise_mask_op-3.c scan-assembler-times kxorb[\\t ] 1
FAIL: gcc.target/i386/minmax-10.c scan-assembler-not cmp
FAIL: gcc.target/i386/minmax-10.c scan-assembler-times test 6
FAIL: gcc.target/i386/pieces-memset-11.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 2
FAIL: gcc.target/i386/pieces-memset-14.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 1
FAIL: gcc.target/i386/pieces-memset-2.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 2
FAIL: gcc.target/i386/pieces-memset-20.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 2
FAIL: gcc.target/i386/pieces-memset-23.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 1
FAIL: gcc.target/i386/pieces-memset-29.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 2
FAIL: gcc.target/i386/pieces-memset-30.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 2
FAIL: gcc.target/i386/pieces-memset-33.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 1
FAIL: gcc.target/i386/pieces-memset-34.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 1
FAIL: gcc.target/i386/pieces-memset-37.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 2
FAIL: gcc.target/i386/pieces-memset-44.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 1
FAIL: gcc.target/i386/pieces-memset-5.c scan-assembler-times vmovdqu[ 
t]+[^\\n]*%ymm 1
FAIL: gcc.target/i386/pr31985.c scan-assembler-times movl 4
FAIL: gcc.target/i386/pr95483-5.c scan-assembler-times 
(?:vmovdqu8|vextracti128)[ t]+[^{\\n]*%ymm[0-9]+[^\\n]*)(?:\\n|[ 
t]+#) 1
FAIL: gcc.target/i386/pr95483-5.c scan-assembler-times 
(?:vmovdqu8|vinserti128)[ t]+[^{\\n]*)[^\\n]*%ymm[0-9]+(?:\\n|[ 
t]+#) 1
FAIL: gcc.target/i386/pr95483-6.c scan-assembler-times (?:vinserti128|vmovdqu)[ 
t]+[^{\\n]*)[^\\n]*%ymm[0-9]+(?:\\n|[ t]+#) 2
FAIL: gcc.target/i386/pr97873-1.c scan-assembler pabsq
FAIL: gcc.target/i386/vect-double-2.c scan-tree-dump-times vect "Vectorized 
loops: 1" 1
FAIL: gcc.target/i386/vect-shiftv4qi.c scan-assembler-times psrlw 5
FAIL: gcc.target/i386/vect-strided-3.c scan-assembler-times movq 4
FAIL: gcc.target/i386/xorsign.c scan-tree-dump-times vect "vectorized 2 loops" 1

=== gcc Summary for unix/-m32 ===

# of expected passes198451
# of unexpected failures159
# of unexpected successes   30
# of expected failures  1551
# of unsupported tests  4098

=== gcc Summary ===

# of expected passes403274
# of unexpected failures318
# of unexpected successes   50
# of expected failures  3096
# of unsupported tests  7408
/export/home/haochenj/src/gcc-regression/bld/gcc/xgcc  version 15.0.0 20240617 
(experimental) [master r15-1385-gd78694c238c] (GCC) 

=== gfortran tests ===


Running target unix

=== gfortran Summary for unix ===

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

Running target unix/-m32

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

# of expected passes70198
# of expected failures  275
# of unsupp

RE: [PATCH] aarch64: Add fix_truncv4sfv4hi2 pattern [PR113882]

2024-06-17 Thread Pengxuan Zheng (QUIC)
> Pengxuan Zheng  writes:
> > This patch adds the fix_truncv4sfv4hi2 (V4SF->V4HI) pattern which is
> > implemented using fix_truncv4sfv4si2 (V4SF->V4SI) and then truncv4siv4hi2
> (V4SI->V4HI).
> >
> > PR target/113882
> >
> > gcc/ChangeLog:
> >
> > * config/aarch64/aarch64-simd.md (fix_truncv4sfv4hi2): New pattern.
> 
> Could we handle this by extending the target-independent code instead?
> Richard mentioned in comment 1 that the current set of intermediate
> conversions is hard-coded, but it didn't sound like he was implying that the
> set shouldn't change.

Yes, Richard. I checked the target-independent code. In fact, SLP already 
handles this type of intermediate conversions. However, the logic is guarded by 
"!flag_trapping_math". Therefore, if we pass -fno-trapping-math , SLP actually 
generates the right vectorized code. Also, looks like the check for 
"!flag_trapping_math" was added intentionally in r14-2085-g77a50c772771f6 to 
fix 
some PRs. So, I'm not sure what we should do here. Thoughts?

  if (GET_MODE_SIZE (lhs_mode) != GET_MODE_SIZE (rhs_mode)
  && (code == FLOAT_EXPR ||
  (code == FIX_TRUNC_EXPR && !flag_trapping_math)))

Thanks,
Pengxuan
> 
> Thanks,
> Richard
> 
> > gcc/testsuite/ChangeLog:
> >
> > * gcc.target/aarch64/fix_trunc2.c: New test.
> >
> > Signed-off-by: Pengxuan Zheng 
> > ---
> >  gcc/config/aarch64/aarch64-simd.md| 13 +
> >  gcc/testsuite/gcc.target/aarch64/fix_trunc2.c | 14 ++
> >  2 files changed, 27 insertions(+)
> >  create mode 100644 gcc/testsuite/gcc.target/aarch64/fix_trunc2.c
> >
> > diff --git a/gcc/config/aarch64/aarch64-simd.md
> > b/gcc/config/aarch64/aarch64-simd.md
> > index 868f4486218..096f7b56a27 100644
> > --- a/gcc/config/aarch64/aarch64-simd.md
> > +++ b/gcc/config/aarch64/aarch64-simd.md
> > @@ -3032,6 +3032,19 @@ (define_expand
> "2"
> >"TARGET_SIMD"
> >{})
> >
> > +
> > +(define_expand "fix_truncv4sfv4hi2"
> > +  [(match_operand:V4HI 0 "register_operand")
> > +   (match_operand:V4SF 1 "register_operand")]
> > +  "TARGET_SIMD"
> > +  {
> > +rtx tmp = gen_reg_rtx (V4SImode);
> > +emit_insn (gen_fix_truncv4sfv4si2 (tmp, operands[1]));
> > +emit_insn (gen_truncv4siv4hi2 (operands[0], tmp));
> > +DONE;
> > +  }
> > +)
> > +
> >  (define_expand "ftrunc2"
> >[(set (match_operand:VHSDF 0 "register_operand")
> > (unspec:VHSDF [(match_operand:VHSDF 1 "register_operand")] diff
> > --git a/gcc/testsuite/gcc.target/aarch64/fix_trunc2.c
> > b/gcc/testsuite/gcc.target/aarch64/fix_trunc2.c
> > new file mode 100644
> > index 000..57cc00913a3
> > --- /dev/null
> > +++ b/gcc/testsuite/gcc.target/aarch64/fix_trunc2.c
> > @@ -0,0 +1,14 @@
> > +/* { dg-do compile } */
> > +/* { dg-options "-O2" } */
> > +
> > +void
> > +f (short *__restrict a, float *__restrict b) {
> > +  a[0] = b[0];
> > +  a[1] = b[1];
> > +  a[2] = b[2];
> > +  a[3] = b[3];
> > +}
> > +
> > +/* { dg-final { scan-assembler-times {fcvtzs\tv[0-9]+.4s, v[0-9]+.4s}
> > +1 } } */
> > +/* { dg-final { scan-assembler-times {xtn\tv[0-9]+.4h, v[0-9]+.4s} 1
> > +} } */


[RFC v3] RISC-V: Promote Zaamo/Zalrsc to a when using an old binutils

2024-06-17 Thread Patrick O'Neill
Binutils 2.42 and before don't support Zaamo/Zalrsc. Promote Zaamo/Zalrsc to
'a' in the -march string when assembling.

This change respects Zaamo/Zalrsc when generating code.

Testcases that check for the default isa string will fail with the old binutils
since zaamo/zalrsc aren't emitted anymore. All other Zaamo/Zalrsc testcases
pass.

gcc/ChangeLog:

* common/config/riscv/riscv-common.cc
(riscv_subset_list::to_string): Add toggle to promote Zaamo/Zalrsc
extensions to 'a'.
(riscv_arch_str): Ditto.
(riscv_expand_arch): Ditto.
(riscv_expand_arch_from_cpu): Ditto.
(riscv_expand_arch_upgrade_exts): New function. Wrapper around
riscv_expand_arch to preserve the function signature.
(riscv_expand_arch_no_upgrade_exts): Ditto
(riscv_expand_arch_from_cpu_upgrade_exts): New function. Wrapper around
riscv_expand_arch_from_cpu to preserve the function signature.
(riscv_expand_arch_from_cpu_no_upgrade_exts): Ditto.
* config/riscv/riscv-protos.h (riscv_arch_str): Add toggle to function
prototype.
* config/riscv/riscv-subset.h: Ditto.
* config/riscv/riscv-target-attr.cc (riscv_process_target_attr):
* config/riscv/riscv.cc (riscv_emit_attribute):
(riscv_declare_function_name):
* config/riscv/riscv.h (riscv_expand_arch): Remove.
(riscv_expand_arch_from_cpu): Ditto.
(riscv_expand_arch_upgrade_exts): Add toggle wrapper functions.
(riscv_expand_arch_no_upgrade_exts): Ditto.
(riscv_expand_arch_from_cpu_upgrade_exts): Ditto.
(riscv_expand_arch_from_cpu_no_upgrade_exts): Ditto.
(EXTRA_SPEC_FUNCTIONS): Ditto.
(OPTION_DEFAULT_SPECS): Use non-upgraded march string when invoking the
compiler.
(ASM_SPEC): Use upgraded march string when invoking the assembler.

Signed-off-by: Patrick O'Neill 
---
v3 ChangeLog:
Rebased on non-promoting patch.
Wrap all Zaamo/Zalrsc upgrade code in #ifndef to prevent compiler
warnings about unused/potentially undefined variables.
Silence unused parameter warning with a voidcast.
---
RFC since I'm not sure if this upgrade behavior is more trouble than
it's worth - this is a pretty invasive change. Happy to iterate further
or just drop these changes.
---
 gcc/common/config/riscv/riscv-common.cc | 111 +---
 gcc/config/riscv/riscv-protos.h |   3 +-
 gcc/config/riscv/riscv-subset.h |   2 +-
 gcc/config/riscv/riscv-target-attr.cc   |   4 +-
 gcc/config/riscv/riscv.cc   |   7 +-
 gcc/config/riscv/riscv.h|  46 ++
 6 files changed, 137 insertions(+), 36 deletions(-)

diff --git a/gcc/common/config/riscv/riscv-common.cc 
b/gcc/common/config/riscv/riscv-common.cc
index 1dc1d9904c7..05c26f73b73 100644
--- a/gcc/common/config/riscv/riscv-common.cc
+++ b/gcc/common/config/riscv/riscv-common.cc
@@ -907,7 +907,7 @@ riscv_subset_list::add (const char *subset, bool implied_p)
VERSION_P to determine append version info or not.  */

 std::string
-riscv_subset_list::to_string (bool version_p) const
+riscv_subset_list::to_string (bool version_p, bool upgrade_exts) const
 {
   std::ostringstream oss;
   oss << "rv" << m_xlen;
@@ -916,10 +916,17 @@ riscv_subset_list::to_string (bool version_p) const
   riscv_subset_t *subset;

   bool skip_zifencei = false;
-  bool skip_zaamo_zalrsc = false;
   bool skip_zicsr = false;
   bool i2p0 = false;

+#ifndef HAVE_AS_MARCH_ZAAMO_ZALRSC
+  bool upgrade_zaamo_zalrsc = false;
+  bool has_a_ext = false;
+  bool insert_a_ext = false;
+  bool inserted_a_ext = false;
+  riscv_subset_t *a_subset;
+#endif
+
   /* For RISC-V ISA version 2.2 or earlier version, zicsr and zifencei is
  included in the base ISA.  */
   if (riscv_isa_spec == ISA_SPEC_CLASS_2P2)
@@ -945,8 +952,33 @@ riscv_subset_list::to_string (bool version_p) const
   skip_zifencei = true;
 #endif
 #ifndef HAVE_AS_MARCH_ZAAMO_ZALRSC
-  /* Skip since binutils 2.42 and earlier don't recognize zaamo/zalrsc.  */
-  skip_zaamo_zalrsc = true;
+  /* Upgrade Zaamo/Zalrsc extensions to 'a' since binutils 2.42 and earlier
+ don't recognize zaamo/zalrsc.  */
+  upgrade_zaamo_zalrsc = upgrade_exts;
+  if (upgrade_zaamo_zalrsc)
+{
+  for (subset = m_head; subset != NULL; subset = subset->next)
+   {
+ if (subset->name == "a")
+   has_a_ext = true;
+ if (subset->name == "zaamo" || subset->name == "zalrsc")
+   insert_a_ext = true;
+   }
+  if (insert_a_ext && !has_a_ext)
+   {
+ unsigned int major_version = 0, minor_version = 0;
+ get_default_version ("a", _version, _version);
+ a_subset = new riscv_subset_t ();
+ a_subset->name = "a";
+ a_subset->implied_p = false;
+ a_subset->major_version = major_version;
+ a_subset->minor_version = minor_version;
+   }
+}
+#else
+  /* Silence unused parameter warning when 

[Bug tree-optimization/97405] ICE in get_or_alloc_expr_for in code hoisting with SVE intrinsics

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

Andrew Pinski  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
   Target Milestone|--- |15.0
 Resolution|--- |FIXED

--- Comment #9 from Andrew Pinski  ---
Fixed.

[Bug tree-optimization/97405] ICE in get_or_alloc_expr_for in code hoisting with SVE intrinsics

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

--- Comment #8 from GCC Commits  ---
The trunk branch has been updated by Andrew Pinski :

https://gcc.gnu.org/g:17979deb15d34dd4f036ca93d2977d0fc4d556a7

commit r15-1387-g17979deb15d34dd4f036ca93d2977d0fc4d556a7
Author: Andrew Pinski 
Date:   Mon Jun 17 16:45:34 2024 -0700

aarch64: Add testcase for PR97405

This aarch64 sve specific code was fixed by r15-917-gc9842f99042454
which added a riscv specific testcase so adding an aarch64 one to test
the fix does not regress is a good idea.

Committed as obvious after testing the testcase for aarch64-linux-gnu.

PR tree-optimization/97405

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/sve/pr97405-1.c: New test.

Signed-off-by: Andrew Pinski 

[gcc r15-1387] aarch64: Add testcase for PR97405

2024-06-17 Thread Andrew Pinski via Gcc-cvs
https://gcc.gnu.org/g:17979deb15d34dd4f036ca93d2977d0fc4d556a7

commit r15-1387-g17979deb15d34dd4f036ca93d2977d0fc4d556a7
Author: Andrew Pinski 
Date:   Mon Jun 17 16:45:34 2024 -0700

aarch64: Add testcase for PR97405

This aarch64 sve specific code was fixed by r15-917-gc9842f99042454
which added a riscv specific testcase so adding an aarch64 one to test
the fix does not regress is a good idea.

Committed as obvious after testing the testcase for aarch64-linux-gnu.

PR tree-optimization/97405

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/sve/pr97405-1.c: New test.

Signed-off-by: Andrew Pinski 

Diff:
---
 gcc/testsuite/gcc.target/aarch64/sve/pr97405-1.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pr97405-1.c 
b/gcc/testsuite/gcc.target/aarch64/sve/pr97405-1.c
new file mode 100644
index ..5efa32c99280
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/pr97405-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-march=armv8.2-a+sve -O2" }
+/* PR tree-optimization/97405 */
+#include "arm_sve.h"
+
+void
+a (svuint8x3_t b, unsigned char *p, int c) {
+  if (c)
+svst1_u8(svptrue_pat_b8(SV_VL16), p, svget3_u8(b, 1));
+  else
+svst1_u8(svwhilelt_b8(6, 6), p, svget3_u8(b, 1));
+}
+


[COMMITTED] aarch64: Add testcase for PR97405

2024-06-17 Thread Andrew Pinski
This aarch64 sve specific code was fixed by r15-917-gc9842f99042454
which added a riscv specific testcase so adding an aarch64 one to test
the fix does not regress is a good idea.

Committed as obvious after testing the testcase for aarch64-linux-gnu.

PR tree-optimization/97405

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/sve/pr97405-1.c: New test.

Signed-off-by: Andrew Pinski 
---
 gcc/testsuite/gcc.target/aarch64/sve/pr97405-1.c | 13 +
 1 file changed, 13 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/pr97405-1.c

diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pr97405-1.c 
b/gcc/testsuite/gcc.target/aarch64/sve/pr97405-1.c
new file mode 100644
index 000..5efa32c9928
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/pr97405-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-march=armv8.2-a+sve -O2" }
+/* PR tree-optimization/97405 */
+#include "arm_sve.h"
+
+void
+a (svuint8x3_t b, unsigned char *p, int c) {
+  if (c)
+svst1_u8(svptrue_pat_b8(SV_VL16), p, svget3_u8(b, 1));
+  else
+svst1_u8(svwhilelt_b8(6, 6), p, svget3_u8(b, 1));
+}
+
-- 
2.43.0



[Bug tree-optimization/97405] ICE in get_or_alloc_expr_for in code hoisting with SVE intrinsics

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

Andrew Pinski  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=115214
 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |pinskia at gcc dot 
gnu.org

--- Comment #7 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #6)
> Fixed on the trunk, I suspect r15-917-gc9842f99042454 fixed it.
> That revision is explictly fixing `POLY_INT_CST [16, 16] /[ex] 16` case too.
> 
> I think we should just add the testcase and close it as fixed.

yes that fixed it, will commit a testcase in a little bit.

Re: [PATCH V3 2/2] RISC-V: Move mode assertion out of conditional branch in emit_insn

2024-06-17 Thread Jeff Law




On 6/17/24 12:33 PM, Edwin Lu wrote:

When emitting insns, we have an early assertion to ensure the input
operand's mode and the expanded operand's mode are the same; however, it
does not perform this check if the pattern does not have an explicit
machine mode specifying the operand. In this scenario, it will always
assume that mode = Pmode to correctly satisfy the
maybe_legitimize_operand check, however, there may be problems when
working in 32 bit environments.

Make the assert unconditional and replace it with an internal error for
more descriptive logging

gcc/ChangeLog:

* config/riscv/riscv-v.cc: Move assert out of conditional block

OK.

Jeff



Re: [PATCH V3 1/2] RISC-V: Fix vwsll combine on rv32 targets

2024-06-17 Thread Jeff Law




On 6/17/24 12:33 PM, Edwin Lu wrote:

On rv32 targets, vwsll_zext1_scalar_ would trigger an ice in
maybe_legitimize_instruction when zero extending a uint32 to uint64 due
to a mismatch between the input operand's mode (DI) and the expanded insn
operand's mode (Pmode == SI). Ensure that mode of the operands match

Tested on rv32/64 gcv newlib. Letting CI perform additional testing

gcc/ChangeLog:

* config/riscv/autovec-opt.md: Fix mode mismatch

OK
jeff




[gcc r15-1386] [to-be-committed, RISC-V] Handle zero_extract destination for single bit insertions

2024-06-17 Thread Jeff Law via Gcc-cvs
https://gcc.gnu.org/g:67bc21af7ba35b773b5cf0e85107715f7c2240e4

commit r15-1386-g67bc21af7ba35b773b5cf0e85107715f7c2240e4
Author: Jeff Law 
Date:   Mon Jun 17 17:24:03 2024 -0600

[to-be-committed,RISC-V] Handle zero_extract destination for single bit 
insertions

Combine will use zero_extract destinations for certain bitfield
insertions.  If the bitfield is a single bit constant, then we can use
bset/bclr.

In this case we are only dealing with word_mode objects, so we don't
have to worry about the SI->DI extension issues for TARGET_64BIT.

The testcase was derived from 502.gcc in spec from the RAU team.

An earlier version of this (TARGET_64BIT only) went through Ventana's CI
system.  This version has gone though mine after generalizing it to
handle rv32 as well.  I'll wait for pre-commit CI to render its verdict
before moving forward.

gcc/
* config/riscv/bitmanip.md (bsetclr_zero_extract): New pattern.

gcc/testsuite/

* gcc.target/riscv/zbs-zext-3.c: New test.

Diff:
---
 gcc/config/riscv/bitmanip.md| 17 +
 gcc/testsuite/gcc.target/riscv/zbs-zext-3.c | 27 +++
 2 files changed, 44 insertions(+)

diff --git a/gcc/config/riscv/bitmanip.md b/gcc/config/riscv/bitmanip.md
index 311f0d373c00..094bc2acf1c7 100644
--- a/gcc/config/riscv/bitmanip.md
+++ b/gcc/config/riscv/bitmanip.md
@@ -654,6 +654,23 @@
  (any_or:DI (ashift:DI (const_int 1) (match_dup 1))
(match_dup 3)))])
 
+;; Yet another form of a bset/bclr that can be created by combine.
+(define_insn "*bsetclr_zero_extract"
+  [(set (zero_extract:X (match_operand:X 0 "register_operand" "+r")
+   (const_int 1)
+   (zero_extend:X
+ (match_operand:QI 1 "register_operand" "r")))
+   (match_operand 2 "immediate_operand" "n"))]
+  "TARGET_ZBS
+   && (operands[2] == CONST0_RTX (mode)
+   || operands[2] == CONST1_RTX (mode))"
+  {
+return (operands[2] == CONST0_RTX (mode)
+   ? "bclr\t%0,%0,%1"
+   : "bset\t%0,%0,%1");
+  }
+  [(set_attr "type" "bitmanip")])
+
 (define_insn "*bclr"
   [(set (match_operand:X 0 "register_operand" "=r")
(and:X (rotate:X (const_int -2)
diff --git a/gcc/testsuite/gcc.target/riscv/zbs-zext-3.c 
b/gcc/testsuite/gcc.target/riscv/zbs-zext-3.c
new file mode 100644
index ..0239014e06bf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/zbs-zext-3.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gc_zba_zbb_zbs -mabi=lp64d" { target { rv64 } } } 
*/
+/* { dg-options "-march=rv32gc_zba_zbb_zbs -mabi=ilp32" { target { rv32 } } } 
*/
+/* { dg-skip-if "" { *-*-* } { "-O0" "-Og" } } */
+
+/* We need to adjust the constant so this works for rv32 and rv64.  */
+#if __riscv_xlen == 32
+#define ONE 1U
+#else
+#define ONE 1ULL
+#endif
+
+void add_to_hard_reg_set(long long *a, unsigned int count) {
+  int i = 0;
+  while(i++ < count)
+*a |= (1U << i);
+}
+
+void remove_from_hard_reg_set(long long *a, unsigned int count) {
+  int i = 0;
+  while(i++ < count)
+*a &= ~(ONE << i);
+}
+
+
+/* { dg-final { scan-assembler-not "and\t" } } */
+/* { dg-final { scan-assembler-not "andn\t" } } */


Re: [PATCH] rs6000: Compute rop_hash_save_offset for non-Altivec compiles [PR115389]

2024-06-17 Thread Peter Bergner
On 6/16/24 9:40 PM, Kewen.Lin wrote:
> on 2024/6/17 10:31, Peter Bergner wrote:
>> On 6/16/24 9:10 PM, Kewen.Lin wrote:
>>> on 2024/6/15 01:05, Peter Bergner wrote:
 That said, the --with-cpu=power5 build without fortran did bootstrap and
 regtest with no regressions, so the build did test that code path and
 exposed no problems.
>>>
>>> OK, nice!  Thanks!
>>
>> I assume this means you're "OK" with the updated patch, correct?
> 
> Yes, OK for trunk, thanks!

Thanks.  We will need backports to GCC 11, as it is broken back to when
ROP was first added then.  I'll let things burn-in on trunk for a couple
of days so Bill's CI builders have a chance to test it on all of our
configs.  





>> Do you want to take a stab at writing that or do you want me to do that?
> 
> Either is fine for me, then let me give it a shot.

Sounds good, thanks.  That will allow me to handle the other ROP issues
I came across, which are reported in PR114759.

Peter




[Bug c++/115501] [13/14/15 Regression] ICE: in build_call_a with dynamic_cast after invalid definition of __cxxabiv1::__dynamic_cast since r13-3299

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||pinskia at gcc dot gnu.org

--- Comment #7 from Andrew Pinski  ---
(In reply to Marek Polacek from comment #6)
> build_dynamic_cast_1 now calls pushdecl which calls duplicate_decls and that
> emits the "conflicting declaration" error and returns error_mark_node, so
> the subsequent build_cxx_call crashes on the error_mark_node.
> 
> Maybe we need just:
> 
> --- a/gcc/cp/rtti.cc
> +++ b/gcc/cp/rtti.cc
> @@ -793,6 +793,8 @@ build_dynamic_cast_1 (location_t loc, tree type, tree
> expr,
>   dcast_fn = pushdecl (dcast_fn, /*hiding=*/true);
>   pop_abi_namespace (flags);
>   dynamic_cast_node = dcast_fn;
> + if (dcast_fn == error_mark_node)
> +   return error_mark_node;
> }
>   result = build_cxx_call (dcast_fn, 4, elems, complain);
>   SET_EXPR_LOCATION (result, loc);

Most likely that check should be after the `!dcast_fn` check rather than inside
it so if you try to use dynamic_cast twice, the second one would not cause an
ICE.

Results for 12.3.1 20240617 [remotes/origin/releases/gcc-12 r12-10562-gea0aa9765d] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-06-17 Thread Bill Seurer (POWER8) via Gcc-testresults
/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/pr56605.c scan-rtl-dump-times combine "(compare:CC 
((?:and|zero_extend):(?:[SD]I) ((?:sub)?reg:[SD]I" 1
FAIL: gcc.target/powerpc/pr86731-fwrapv-longlong.c scan-assembler-times 
mp?lxvM|mlxvM|mlxvd2xM|mxxspltidpM 2
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 passes162461
# of unexpected failures170
# of unexpected successes   14
# of expected failures  1468
# of unsupported tests  3909
/home/gccbuild/build/nightly/build-gcc-12/gcc/xgcc  version 12.3.1 20240617 
[remotes/origin/releases/gcc-12 r12-10562-gea0aa9765d] (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 passes66426
# of unexpected failures6
# of unexpected successes   6
# of expected failures  284
# of unsupported tests  190
/home/gccbuild/build/nightly/build-gcc-12/gcc/gfortran  version 12.3.1 20240617 
[remotes/origin/releases/gcc-12 r12-10562-gea0aa9765d] (GCC) 

=== g++ tests ===


Running target unix

=== g++ Summary ===

# of expected passes228604
# of expected failures  1930
# of unsupported tests  10565
/home/gccbuild/build/nightly/build-gcc-12/gcc/xg++  version 12.3.1 20240617 
[remotes/origin/releases/gcc-12 r12-10562-gea0aa9765d] (GCC) 

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


Running target unix

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

# of expected passes1502
# of expected failures  10
# of unsupported tests  79
/home/gccbuild/build/nightly/build-gcc-12/gcc/xg++  version 12.3.1 20240617 
[remotes/origin/relea

Results for 13.3.1 20240617 [releases/gcc-13 r13-8852-ga62db395b1] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-06-17 Thread Bill Seurer (POWER8) via Gcc-testresults
: 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 passes169276
# of unexpected failures127
# of unexpected successes   16
# of expected failures  1544
# of unsupported tests  4000
/home/gccbuild/build/nightly/build-gcc-13/gcc/xgcc  version 13.3.1 20240617 
[releases/gcc-13 r13-8852-ga62db395b1] (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 -f

Results for 15.0.0 20240617 (experimental) [master r15-1380-g8584c98f370] (GCC) testsuite on s390x-ibm-linux-gnu z16

2024-06-17 Thread stefansf--- via Gcc-testresults
LAST_UPDATED: Mon Jun 17 17:05:03 UTC 2024 (revision r15-1380-g8584c98f370)

=== acats tests ===
FAIL:   cb1010a

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

=== 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: 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/pr84877.c execution test
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 scan-tree-dump omplower 
"(?n)#pragma omp target oacc_parallel 

Results for 13.3.1 20240617 [releases/gcc-13 r13-8854-gbe14e6cf7f] (GCC) testsuite on powerpc64le-unknown-linux-gnu

2024-06-17 Thread Bill Seurer (POWER9) via Gcc-testresults
 -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/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   -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/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 passes170294
# of unexpected failures113
# of unexpected successes   23
# of expected failures  1554
# of unsupported tests  3213
/home/gccbuild/build/nightly/build-gcc-13/gcc/xgcc  version 13.3.1 20240617 
[releases/gcc-13 r13-8854-gbe14e6cf7f] (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 passes68348
# of unexpected failures6
# of unexpected successes   6
# of expected failures  271
# of unsupported tests  168
/home/gccbuild/build/nightly/build-gcc-13/gcc/gfortran  version 13.3.1 20240617 
[releases/gcc-1

Re: [PATCH] rs6000: ROP - Do not disable shrink-wrapping for leaf functions [PR114759]

2024-06-17 Thread Segher Boessenkool
Hi!

On Mon, Jun 17, 2024 at 05:26:39PM -0500, Peter Bergner wrote:
> While auditing our ROP code generation for some test cases I wrote, I noticed
> a few issues which I'm tracking in PR114759.  The first issue I noticed is we
> disable shrink-wrapping when using -mrop-protect, even in the cases where we
> never emit the ROP instructions because they're not needed.

Please don't call this "ROP instructions".  -mrop-protect tries to make
it much harder to succesfully do exploits in a style called "return-
oriented programming", starting from a stack overwrite normally.  It
does this by hashing the return address together with the stack pointer
value and with the previous hash value (so the whole call stack hashed),
and checking that before returning.

"ROP insns" are the instructions used in such exploits, not what you
mean here :-)

The instructions are called "hash*"C, so maybe call tbem "hash insns"
or "ROP protect hash insns"?.

> The problem is
> we disable shrink-wrapping too early, before we know whether we will need to
> emit the ROP instructions or not.  The fix is to delay disabling shrink
> wrapping until we've decided whether we will or won't be emitting the ROP
> instructions.

>   * config/rs6000/rs6000.cc (rs6000_override_options_after_change): Move
>   the disabling of shrink-wrapping from here
>   * config/rs6000/rs6000-logue.cc (rs6000_stack_info): ...to here.

Hrm.  Can you do it in some particular caller of rs6000_stack_info,
instead?  The rs6000_stack_info function itself is not suppposed to
change any state whatsoever.

> --- a/gcc/config/rs6000/rs6000-logue.cc
> +++ b/gcc/config/rs6000/rs6000-logue.cc
> @@ -720,7 +720,11 @@ rs6000_stack_info (void)
>&& info->calls_p
>&& DEFAULT_ABI == ABI_ELFv2
>&& rs6000_rop_protect)
> -info->rop_hash_size = 8;
> +{
> +  /* If we are inserting ROP-protect instructions, disable shrink wrap.  
> */
> +  flag_shrink_wrap = 0;
> +  info->rop_hash_size = 8;
> +}

The comment should say *why*!  The fact that we do is clear from the
code itself already.  But why do we want this?

> --- a/gcc/config/rs6000/rs6000.cc
> +++ b/gcc/config/rs6000/rs6000.cc
> @@ -3427,10 +3427,6 @@ rs6000_override_options_after_change (void)
>  }
>else if (!OPTION_SET_P (flag_cunroll_grow_size))
>  flag_cunroll_grow_size = flag_peel_loops || optimize >= 3;
> -
> -  /* If we are inserting ROP-protect instructions, disable shrink wrap.  */
> -  if (rs6000_rop_protect)
> -flag_shrink_wrap = 0;
>  }

(Yes, I know the original code didn't say either, but let's try to make
things better :-) )

> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/powerpc/pr114759-1.c
> @@ -0,0 +1,16 @@
> +/* { dg-do compile } */
> +/* { dg-options "-O2 -mdejagnu-cpu=power10 -mrop-protect 
> -fdump-rtl-pro_and_epilogue" } */
> +/* { dg-require-effective-target rop_ok } */

Do you want rop_ok while you are *forcing* it to be okay anyway?  Why?


Segher


Results for 14.1.1 20240617 [releases/gcc-14 r14-10322-g922648759b0] (GCC) testsuite on i686-pc-linux-gnu

2024-06-17 Thread haochenj via Gcc-testresults
86/avx512vl-broadcast-pr87767-1.c scan-assembler-times 
vpbroadcastd[t ]+%(?:r|e)[^\\n]*, %xmm[0-9]+ 3
FAIL: gcc.target/i386/avx512vl-broadcast-pr87767-1.c scan-assembler-times 
vpbroadcastd[t ]+%(?:r|e)[^\\n]*, %ymm[0-9]+ 3
FAIL: gcc.target/i386/cleanup-1.c (test for excess errors)
UNRESOLVED: gcc.target/i386/cleanup-1.c compilation failed to produce executable
FAIL: gcc.target/i386/interrupt-12.c scan-assembler-times leave 1
FAIL: gcc.target/i386/interrupt-13.c scan-assembler-times leave 1
FAIL: gcc.target/i386/interrupt-14.c scan-assembler-times leave 2
FAIL: gcc.target/i386/interrupt-15.c scan-assembler-times leave 2
FAIL: gcc.target/i386/ipa-stack-alignment-2.c scan-assembler sub.*%.sp
FAIL: gcc.target/i386/ipa-stack-alignment.c scan-assembler sub.*%.sp
FAIL: gcc.target/i386/minmax-10.c scan-assembler-not cmp
FAIL: gcc.target/i386/minmax-10.c scan-assembler-times test 6
FAIL: gcc.target/i386/pr100704-3.c scan-assembler push[lq]\\tf+
FAIL: gcc.target/i386/pr103144-mul-1.c scan-tree-dump-times vect "vectorized 1 
loops" 4
FAIL: gcc.target/i386/pr103144-neg-1.c scan-tree-dump-times vect "vectorized 1 
loops" 4
FAIL: gcc.target/i386/pr103144-shift-1.c scan-tree-dump-times vect "vectorized 
1 loops" 6
FAIL: gcc.target/i386/pr106245-3.c scan-assembler cltd
FAIL: gcc.target/i386/pr31985.c scan-assembler-times movl 4
XPASS: gcc.target/i386/pr54855-9.c scan-assembler-not movaps
FAIL: gcc.target/i386/pr79690.c scan-assembler mov[au]p.[ \\t][^,]+, %gs:
FAIL: gcc.target/i386/pr79723.c scan-assembler mov[au]p.[ \\t][^,]+, %gs:
FAIL: gcc.target/i386/pr82699-1.c scan-assembler-times 
t.cfi_startprocntendbr 1
FAIL: gcc.target/i386/pr82699-2.c scan-assembler-times 
t.cfi_startprocntendbr 1
FAIL: gcc.target/i386/pr82699-3.c scan-assembler-times 
t.cfi_startprocntendbr 1
FAIL: gcc.target/i386/pr82699-5.c scan-assembler-times 
t.cfi_startprocntendbr 1
FAIL: gcc.target/i386/pr82699-6.c scan-assembler-times 
t.cfi_startprocntendbr 1
FAIL: gcc.target/i386/pr90356.c scan-assembler pxor
FAIL: gcc.target/i386/pr93492-2.c scan-assembler 
\\t.cfi_startproc\\n\\tendbr(32|64)\\n.*.LPFE0:\\n\\tnop\\n\\tret\\n
FAIL: gcc.target/i386/pr93492-3.c scan-assembler 
\\t.cfi_startproc\\n\\tendbr(32|64)\\n.*.LPFE0:\\n\\tnop\\n1:\\tcall\\t[^\\n]*__fentry__[^\\n]*\\n\\tret\\n
FAIL: gcc.target/i386/pr93492-4.c scan-assembler 
\\t.cfi_startproc\\n.*.LPFE0:\\n\\tnop\\n\\tret\\n
FAIL: gcc.target/i386/pr93492-5.c scan-assembler 
\\t.cfi_startproc\\n.*.LPFE0:\\n\\tnop\\n1:\\tcall\\t[^\\n]*__fentry__[^\\n]*\\n\\tret\\n
FAIL: gcc.target/i386/pr95126-m32-1.c scan-assembler movl[ t]*\$
FAIL: gcc.target/i386/pr95126-m32-2.c scan-assembler movl[ t]*\$
FAIL: gcc.target/i386/pr97032.c (internal compiler error: output_operand: 
invalid use of register 'frame')
FAIL: gcc.target/i386/pr97032.c (test for excess errors)
UNRESOLVED: gcc.target/i386/pr97032.c scan-assembler call[ 
\\t]*_?__errno_location
FAIL: gcc.target/i386/sse2-pr39821.c scan-tree-dump-times vect "vectorized 1 
loops in function" 5
FAIL: gcc.target/i386/sse4-pr39821.c scan-tree-dump-times vect "vectorized 1 
loops in function" 6
FAIL: gcc.target/i386/vec_pack_fp16-1.c scan-assembler-times vcvtdq2ph 2
FAIL: gcc.target/i386/vec_pack_fp16-1.c scan-assembler-times vcvtph2ps 2
FAIL: gcc.target/i386/vec_pack_fp16-1.c scan-assembler-times vcvtps2ph 2
FAIL: gcc.target/i386/vec_pack_fp16-1.c scan-assembler-times vcvttph2dq 2
FAIL: gcc.target/i386/vec_pack_fp16-2.c scan-assembler-times vcvtdq2ph 2
FAIL: gcc.target/i386/vec_pack_fp16-2.c scan-assembler-times vcvtph2ps 2
FAIL: gcc.target/i386/vec_pack_fp16-2.c scan-assembler-times vcvtps2ph 2
FAIL: gcc.target/i386/vec_pack_fp16-2.c scan-assembler-times vcvttph2dq 2
FAIL: gcc.target/i386/vect-double-2.c scan-tree-dump-times vect "Vectorized 
loops: 1" 1
FAIL: gcc.target/i386/vect-float16-11.c scan-assembler-times vdivph 16
FAIL: gcc.target/i386/vect-float16-12.c scan-assembler-times vdivph 16
FAIL: gcc.target/i386/vect-float16-2.c scan-assembler-times vaddph 16
FAIL: gcc.target/i386/vect-float16-3.c scan-assembler-times vaddph 16
FAIL: gcc.target/i386/vect-float16-5.c scan-assembler-times vsubph 16
FAIL: gcc.target/i386/vect-float16-6.c scan-assembler-times vsubph 16
FAIL: gcc.target/i386/vect-float16-8.c scan-assembler-times vmulph 16
FAIL: gcc.target/i386/vect-float16-9.c scan-assembler-times vmulph 16
FAIL: gcc.target/i386/vect-pr113078.c scan-assembler-times vpsub[^\\r\\n]*%k 2
FAIL: gcc.target/i386/vect-pr67800.c scan-tree-dump vect "vectorized 1 loops"
FAIL: gcc.target/i386/vect-reduc-1.c scan-assembler-times padd 5
FAIL: gcc.target/i386/vect-reduc-1.c scan-assembler-times psrl 2
FAIL: gcc.target/i386/xorsign.c scan-tree-dump-times vect "vectorized 2 loops" 1

=== gcc Summary ===

# of expected passes    196381
# of unexpected failures229
# of u

  1   2   3   4   5   >