On Mon, Apr 22, 2024 at 12:05 PM Alexandre Oliva <ol...@adacore.com> wrote: > > Ping?-ish for the full version of the RFC posted at > https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566588.html > > On Mar 11, 2021, Richard Biener <richard.guent...@gmail.com> wrote: > > > On Thu, Mar 11, 2021 at 9:03 AM Alexandre Oliva <ol...@adacore.com> wrote: > > >> So I'm leaning towards this proposed change, just extended to other > >> platforms that also decay from run to compile rather than link, and thus > >> run into this problem in g++.dg/vect/pr95401.cc. Would this be > >> acceptable? > > > I think that's OK. It's probably difficult to make the test UNSUPPORTED > > when dg-additional-sources is discovered with a dg-do compile test? > > Thanks, here's a completed version. > > > When vect.exp finds our configuration disables altivec by default, it > disables the execution of vectorization tests, assuming the test > hardware doesn't support it. > > Tests become just compile tests, but compile tests won't work > correctly when additional sources are named, e.g. pr95401.cc, because > GCC refuses to compile multiple files into the same asm output. > > With this patch, the default for when execution is not possible > becomes link. > > Regstrapped on x86_64-linux-gnu and ppc64el-linux-gnu. Also tested with > gcc-13 on ppc64-vx7r2 and ppc-vx7r2. Ok to install?
That makes sense. OK Thanks, Richard. > > for gcc/testsuite/ChangeLog > > * lib/target-supports.exp (check_vect_support_and_set_flags): > Decay to link rather than compile. > --- > gcc/testsuite/lib/target-supports.exp | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/gcc/testsuite/lib/target-supports.exp > b/gcc/testsuite/lib/target-supports.exp > index 3a5713d98691f..54a55585371b0 100644 > --- a/gcc/testsuite/lib/target-supports.exp > +++ b/gcc/testsuite/lib/target-supports.exp > @@ -11625,7 +11625,7 @@ proc check_vect_support_and_set_flags { } { > if [check_750cl_hw_available] { > set dg-do-what-default run > } else { > - set dg-do-what-default compile > + set dg-do-what-default link > } > } elseif [istarget powerpc*-*-*] { > # Skip targets not supporting -maltivec. > @@ -11655,14 +11655,14 @@ proc check_vect_support_and_set_flags { } { > # some other cpu type specified above. > set DEFAULT_VECTCFLAGS [linsert $DEFAULT_VECTCFLAGS 0 > "-mcpu=970"] > } > - set dg-do-what-default compile > + set dg-do-what-default link > } > } elseif { [istarget i?86-*-*] || [istarget x86_64-*-*] } { > lappend DEFAULT_VECTCFLAGS "-msse2" > if { [check_effective_target_sse2_runtime] } { > set dg-do-what-default run > } else { > - set dg-do-what-default compile > + set dg-do-what-default link > } > } elseif { [istarget mips*-*-*] > && [check_effective_target_nomips16] } { > @@ -11681,7 +11681,7 @@ proc check_vect_support_and_set_flags { } { > if [check_effective_target_ultrasparc_hw] { > set dg-do-what-default run > } else { > - set dg-do-what-default compile > + set dg-do-what-default link > } > } elseif [istarget alpha*-*-*] { > # Alpha's vectorization capabilities are extremely limited. > @@ -11694,7 +11694,7 @@ proc check_vect_support_and_set_flags { } { > if [check_alpha_max_hw_available] { > set dg-do-what-default run > } else { > - set dg-do-what-default compile > + set dg-do-what-default link > } > } elseif [istarget ia64-*-*] { > set dg-do-what-default run > @@ -11707,7 +11707,7 @@ proc check_vect_support_and_set_flags { } { > if [is-effective-target arm_neon_hw] { > set dg-do-what-default run > } else { > - set dg-do-what-default compile > + set dg-do-what-default link > } > } elseif [istarget aarch64*-*-*] { > set dg-do-what-default run > @@ -11731,7 +11731,7 @@ proc check_vect_support_and_set_flags { } { > set dg-do-what-default run > } else { > lappend DEFAULT_VECTCFLAGS "-march=z14" "-mzarch" > - set dg-do-what-default compile > + set dg-do-what-default link > } > } elseif [istarget amdgcn-*-*] { > set dg-do-what-default run > @@ -11742,7 +11742,7 @@ proc check_vect_support_and_set_flags { } { > foreach item [add_options_for_riscv_v ""] { > lappend DEFAULT_VECTCFLAGS $item > } > - set dg-do-what-default compile > + set dg-do-what-default link > } > } elseif [istarget loongarch*-*-*] { > # Set the default vectorization option to "-mlsx" due to the problem > @@ -11751,7 +11751,7 @@ proc check_vect_support_and_set_flags { } { > if [check_effective_target_loongarch_sx_hw] { > set dg-do-what-default run > } else { > - set dg-do-what-default compile > + set dg-do-what-default link > } > } else { > return 0 > > > -- > Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ > Free Software Activist GNU Toolchain Engineer > More tolerance and less prejudice are key for inclusion and diversity > Excluding neuro-others for not behaving ""normal"" is *not* inclusive