]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
23 months agoDaily bump.
GCC Administrator [Tue, 8 Aug 2023 00:17:37 +0000 (00:17 +0000)] 
Daily bump.

23 months agoRISC-V: Support VLS basic operation auto-vectorization
Juzhe-Zhong [Mon, 7 Aug 2023 09:27:15 +0000 (17:27 +0800)] 
RISC-V: Support VLS basic operation auto-vectorization

This patch support VLS modes auto-vectorization to enhance VLA auto-vectorization
when niters is known.

Consider this following case:

  void __attribute__ ((noinline, noclone))                                     \
  PREFIX##_##TYPE##NUM (TYPE *__restrict a, TYPE *__restrict b, TYPE *__restrict c)  \
  {                                                                            \
    for (int i = 0; i < NUM; ++i)                                              \
      a[i] = b[i] OP c[i];                                                     \
  }

DEF_OP_VV (plus, 16, int8_t, +)

Before this patch:

plus_int8_t16(signed char*, signed char*, signed char*):
        li      a5,16
        csrr    a4,vlenb
        bleu    a5,a4,.L2
        mv      a5,a4
.L2:
        vsetvli zero,a5,e8,m1,ta,ma
        vle8.v  v2,0(a1)
        vle8.v  v1,0(a2)
        vsetvli a4,zero,e8,m1,ta,ma
        vadd.vv v1,v1,v2
        vsetvli zero,a5,e8,m1,ta,ma
        vse8.v  v1,0(a0)
        ret

After this patch:

plus_int8_t16:
vsetivli zero,16,e8,m1,ta,ma
vle8.v v1,0(a2)
vle8.v v2,0(a1)
vadd.vv v1,v1,v2
vse8.v v1,0(a0)
ret

gcc/ChangeLog:

* config/riscv/autovec-vls.md (<optab><mode>3): Add VLS modes.
* config/riscv/vector-iterators.md: Ditto.
* config/riscv/vector.md: Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/vls/def.h: Add basic operations.
* gcc.target/riscv/rvv/autovec/vls/and-1.c: New test.
* gcc.target/riscv/rvv/autovec/vls/and-2.c: New test.
* gcc.target/riscv/rvv/autovec/vls/and-3.c: New test.
* gcc.target/riscv/rvv/autovec/vls/div-1.c: New test.
* gcc.target/riscv/rvv/autovec/vls/ior-1.c: New test.
* gcc.target/riscv/rvv/autovec/vls/ior-2.c: New test.
* gcc.target/riscv/rvv/autovec/vls/ior-3.c: New test.
* gcc.target/riscv/rvv/autovec/vls/max-1.c: New test.
* gcc.target/riscv/rvv/autovec/vls/min-1.c: New test.
* gcc.target/riscv/rvv/autovec/vls/minus-1.c: New test.
* gcc.target/riscv/rvv/autovec/vls/minus-2.c: New test.
* gcc.target/riscv/rvv/autovec/vls/minus-3.c: New test.
* gcc.target/riscv/rvv/autovec/vls/mod-1.c: New test.
* gcc.target/riscv/rvv/autovec/vls/mult-1.c: New test.
* gcc.target/riscv/rvv/autovec/vls/plus-1.c: New test.
* gcc.target/riscv/rvv/autovec/vls/plus-2.c: New test.
* gcc.target/riscv/rvv/autovec/vls/plus-3.c: New test.

23 months agolibstdc++: Fix incorrect use of abs and log10 in std::format [PR110860]
Jonathan Wakely [Mon, 7 Aug 2023 14:30:03 +0000 (15:30 +0100)] 
libstdc++: Fix incorrect use of abs and log10 in std::format [PR110860]

The std::formatter implementation for floating-point types uses
__builtin_abs and __builtin_log10 to avoid including all of <cmath>, but
those functions are not generic. The result of abs(2e304) is -INT_MIN
which is undefined, and then log10(INT_MIN) is NaN. As well as being
undefined, we fail to grow the buffer correctly, and then loop more
times than needed to allocate a buffer and try formatting the value into
it again.

We can use if-constexpr to choose the correct form of log10 to use for
the type, and avoid using abs entirely. This avoids the undefined
behaviour and should mean we only reallocate and retry std::to_chars
once.

libstdc++-v3/ChangeLog:

PR libstdc++/110860
* include/std/format (__formatter_fp::format): Do not use
__builtin_abs and __builtin_log10 with arbitrary floating-point
types.

23 months agolibstdc++: Constrain __format::_Iter_sink for contiguous iterators [PR110917]
Jonathan Wakely [Mon, 7 Aug 2023 13:37:25 +0000 (14:37 +0100)] 
libstdc++: Constrain __format::_Iter_sink for contiguous iterators [PR110917]

We can't write to a span<_CharT> if the contiguous iterator has a value
type that isn't _CharT.

libstdc++-v3/ChangeLog:

PR libstdc++/110917
* include/std/format (__format::_Iter_sink<CharT, OutIter>):
Constrain partial specialization for contiguous iterators to
require the value type to be CharT.
* testsuite/std/format/functions/format_to.cc: New test.

23 months agoi386: Fix grammar typo in diagnostic
Jonathan Wakely [Mon, 7 Aug 2023 10:19:23 +0000 (11:19 +0100)] 
i386: Fix grammar typo in diagnostic

gcc/ChangeLog:

* config/i386/i386.cc (ix86_invalid_conversion): Fix grammar.

23 months agolibstdc++: Fix past-the-end increment in std::format [PR110862]
Jonathan Wakely [Thu, 3 Aug 2023 07:45:43 +0000 (08:45 +0100)] 
libstdc++: Fix past-the-end increment in std::format [PR110862]

At the end of a replacement field we should check that the closing brace
is actually present before incrementing past it.

libstdc++-v3/ChangeLog:

PR libstdc++/110862
* include/std/format (_Scanner::_M_on_replacement_field):
Check for expected '}' before incrementing iterator.
* testsuite/std/format/string.cc: Check "{0:{0}" format string.

23 months agotoplevel: Makefile.def: add install-strip dependency on libsframe
Indu Bhagat [Thu, 19 Jan 2023 07:17:49 +0000 (23:17 -0800)] 
toplevel: Makefile.def: add install-strip dependency on libsframe

As noted in PR libsframe/30014 - FTBFS: install-strip fails because
bfdlib relinks and fails to find libsframe, the install time
dependencies of libbfd need to be updated.

ChangeLog:

* Makefile.def: Reflect that libsframe needs to installed before
libbfd.  Reorder a bit to better track libsframe dependencies.
* Makefile.in: Regenerate.

23 months agobfd: linker: merge .sframe sections
Indu Bhagat [Tue, 15 Nov 2022 23:07:04 +0000 (15:07 -0800)] 
bfd: linker: merge .sframe sections

The linker merges all the input .sframe sections.  When merging, the
linker verifies that all the input .sframe sections have the same
abi/arch.

The linker uses libsframe library to perform key actions on the
.sframe sections - decode, read, and create output data.  This
implies buildsystem changes to make and install libsframe before
libbfd.

The linker places the output .sframe section in a new segment of its
own: PT_GNU_SFRAME.  A new segment is not added, however, if the
generated .sframe section is empty.

When a section is discarded from the final link, the corresponding
entries in the .sframe section for those functions are also deleted.

The linker sorts the SFrame FDEs on start address by default and sets
the SFRAME_F_FDE_SORTED flag in the .sframe section.

This patch also adds support for generation of SFrame unwind
information for the .plt* sections on x86_64.  SFrame unwind info is
generated for IBT enabled PLT, lazy/non-lazy PLT.

The existing linker option --no-ld-generated-unwind-info has been
adapted to include the control of whether .sframe unwind information
will be generated for the linker generated sections like PLT.

Changes to the linker script have been made as necessary.

ChangeLog:

* Makefile.def: Add install dependency on libsframe for libbfd.
* Makefile.in: Regenerated.

23 months agolibtool.m4: augment symcode for Solaris 11
Nick Alcock [Mon, 27 Sep 2021 19:31:21 +0000 (20:31 +0100)] 
libtool.m4: augment symcode for Solaris 11

This reports common symbols like GNU nm, via a type code of 'C'.

ChangeLog:

* libtool.m4 (lt_cv_sys_global_symbol_pipe): Augment symcode for
Solaris 11.

gcc/ChangeLog:

* configure: Regenerate.

libatomic/ChangeLog:

* configure: Regenerate.

libbacktrace/ChangeLog:

* configure: Regenerate.

libcc1/ChangeLog:

* configure: Regenerate.

libffi/ChangeLog:

* configure: Regenerate.

libgfortran/ChangeLog:

* configure: Regenerate.

libgm2/ChangeLog:

* configure: Regenerate.

libgomp/ChangeLog:

* configure: Regenerate.

libitm/ChangeLog:

* configure: Regenerate.

libobjc/ChangeLog:

* configure: Regenerate.

libphobos/ChangeLog:

* configure: Regenerate.

libquadmath/ChangeLog:

* configure: Regenerate.

libsanitizer/ChangeLog:

* configure: Regenerate.

libssp/ChangeLog:

* configure: Regenerate.

libstdc++-v3/ChangeLog:

* configure: Regenerate.

libvtv/ChangeLog:

* configure: Regenerate.

lto-plugin/ChangeLog:

* configure: Regenerate.

zlib/ChangeLog:

* configure: Regenerate.

23 months agoPKG_CHECK_MODULES: Properly check if $pkg_cv_[]$1[]_LIBS works
H.J. Lu [Tue, 28 Jul 2020 13:59:20 +0000 (06:59 -0700)] 
PKG_CHECK_MODULES: Properly check if $pkg_cv_[]$1[]_LIBS works

There is no need to check $pkg_cv_[]$1[]_LIBS works if package check
failed.

config/ChangeLog:

* pkg.m4 (PKG_CHECK_MODULES): Use AC_TRY_LINK only if
$pkg_failed = no.

23 months agoPKG_CHECK_MODULES: Check if $pkg_cv_[]$1[]_LIBS works
H.J. Lu [Tue, 28 Jul 2020 10:50:10 +0000 (03:50 -0700)] 
PKG_CHECK_MODULES: Check if $pkg_cv_[]$1[]_LIBS works

It is quite normal to have headers without library on multilib OSes.
Add AC_TRY_LINK to PKG_CHECK_MODULES to check if $pkg_cv_[]$1[]_LIBS
works.

config/ChangeLog:

* pkg.m4 (PKG_CHECK_MODULES): Add AC_TRY_LINK to check if
$pkg_cv_[]$1[]_LIBS works.

23 months agoDeprecate a.out support for NetBSD targets.
John Ericson [Wed, 11 Aug 2021 12:17:54 +0000 (13:17 +0100)] 
Deprecate a.out support for NetBSD targets.

As discussed previously, a.out support is now quite deprecated, and in
some cases removed, in both Binutils itself and NetBSD, so this legacy
default makes little sense. `netbsdelf*` and `netbsdaout*` still work
allowing the user to be explicit about there choice. Additionally, the
configure script warns about the change as Nick Clifton requested.

One possible concern was the status of NetBSD on NS32K, where only a.out
was supported. But per [1] NetBSD has removed support, and if it were to
come back, it would be with ELF. The binutils implementation is
therefore marked obsolete, per the instructions in the last message.

With that patch and this one applied, I have confirmed the following:

--target=i686-unknown-netbsd
--target=i686-unknown-netbsdelf
  builds completely

--target=i686-unknown-netbsdaout
  properly fails because target is deprecated.

--target=vax-unknown-netbsdaout builds completely except for gas, where
the target is deprecated.

[1]: https://mail-index.netbsd.org/tech-toolchain/2021/07/19/msg004025.html

config/ChangeLog:

* picflag.m4: Simplify SHmedia NetBSD match by presuming ELF.

gcc/ChangeLog:

* configure: Regenerate.

libada/ChangeLog:

* configure: Regenerate.

libgcc/ChangeLog:

* configure: Regenerate.

libiberty/ChangeLog:

* configure: Regenerate.

23 months agoPR27116, Spelling errors found by Debian style checker
Alan Modra [Fri, 1 Jan 2021 03:51:52 +0000 (14:21 +1030)] 
PR27116, Spelling errors found by Debian style checker

config/ChangeLog:

* override.m4: Correct comment grammar.

23 months agoegrep in binutils
Alan Modra [Wed, 28 Sep 2022 04:07:31 +0000 (13:37 +0930)] 
egrep in binutils

Apparently some distros have a nagging egrep that helpfully tells you
egrep is deprecated and to use "grep -E".  The nag message causes a ld
testsuite failure.  What's more the advice isn't that good.  The "-E"
flag may not be available with older versions of grep.

This patch fixes bare invocation of egrep within binutils, replacing
it with the autoconf $EGREP or with grep.

config/ChangeLog:

* lib-ld.m4 (AC_LIB_PROG_LD_GNU): Require AC_PROG_EGREP and
invoke $EGREP.
(AC_LIB_PROG_LD): Likewise.

gcc/ChangeLog:

* configure: Regenerate.

intl/ChangeLog:

* configure: Regenerate.

libcpp/ChangeLog:

* configure: Regenerate.

libgcc/ChangeLog:

* configure: Regenerate.

libstdc++-v3/ChangeLog:

* configure: Regenerate.

23 months agoAdd support for the haiku operating system
Alexander von Gluck IV [Thu, 2 Sep 2021 11:19:14 +0000 (12:19 +0100)] 
Add support for the haiku operating system

These are the os support patches we have been grooming and maintaining
for quite a few years over on git.haiku-os.org.  All of these
architectures are working and most have been stable for quite some time.

ChangeLog:

* configure: Regenerate.
* configure.ac: Add Haiku to list of ELF OSes
* libtool.m4: Update sys_lib_dlsearch_path_spec on Haiku.

gcc/ChangeLog:

* configure: Regenerate.

libatomic/ChangeLog:

* configure: Regenerate.

libbacktrace/ChangeLog:

* configure: Regenerate.

libcc1/ChangeLog:

* configure: Regenerate.

libffi/ChangeLog:

* configure: Regenerate.

libgfortran/ChangeLog:

* configure: Regenerate.

libgm2/ChangeLog:

* configure: Regenerate.

libgomp/ChangeLog:

* configure: Regenerate.

libitm/ChangeLog:

* configure: Regenerate.

libobjc/ChangeLog:

* configure: Regenerate.

libphobos/ChangeLog:

* configure: Regenerate.

libquadmath/ChangeLog:

* configure: Regenerate.

libsanitizer/ChangeLog:

* configure: Regenerate.

libssp/ChangeLog:

* configure: Regenerate.

libstdc++-v3/ChangeLog:

* configure: Regenerate.

libvtv/ChangeLog:

* configure: Regenerate.

lto-plugin/ChangeLog:

* configure: Regenerate.

zlib/ChangeLog:

* configure: Regenerate.

23 months agolibtool.m4: fix the NM="/nm/over/here -B/option/with/path" case
Nick Alcock [Fri, 3 Dec 2021 16:33:25 +0000 (16:33 +0000)] 
libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case

My previous nm patch handled all cases but one -- if the user set NM in
the environment to a path which contained an option, libtool's nm
detection tries to run nm against a copy of nm with the options in it:
e.g. if NM was set to "nm --blargle", and nm was found in /usr/bin, the
test would try to run "/usr/bin/nm --blargle /usr/bin/nm --blargle".
This is unlikely to be desirable: in this case we should run
"/usr/bin/nm --blargle /usr/bin/nm".

Furthermore, as part of this nm has to detect when the passed-in $NM
contains a path, and in that case avoid doing a path search itself.
This too was thrown off if an option contained something that looked
like a path, e.g. NM="nm -B../prev-gcc"; libtool then tries to run
"nm -B../prev-gcc nm" which rarely works well (and indeed it looks
to see whether that nm exists, finds it doesn't, and wrongly concludes
that nm -p or whatever does not work).

Fix all of these by clipping all options (defined as everything
including and after the first " -") before deciding whether nm
contains a path (but not using the clipped value for anything else),
and then removing all options from the path-modified nm before
looking to see whether that nm existed.

NM=my-nm now does a path search and runs e.g.
  /usr/bin/my-nm -B /usr/bin/my-nm

NM=/usr/bin/my-nm now avoids a path search and runs e.g.
  /usr/bin/my-nm -B /usr/bin/my-nm

NM="my-nm -p../wombat" now does a path search and runs e.g.
  /usr/bin/my-nm -p../wombat -B /usr/bin/my-nm

NM="../prev-binutils/new-nm -B../prev-gcc" now avoids a path search:
  ../prev-binutils/my-nm -B../prev-gcc -B ../prev-binutils/my-nm

This seems to be all combinations, including those used by GCC bootstrap
(which, before this commit, fails to bootstrap when configured
--with-build-config=bootstrap-lto, because the lto plugin is now using
--export-symbols-regex, which requires libtool to find a working nm,
while also using -B../prev-gcc to point at the lto plugin associated
with the GCC just built.)

Regenerate all affected configure scripts.

ChangeLog:

* libtool.m4 (LT_PATH_NM): Handle user-specified NM with
options, including options containing paths.

gcc/ChangeLog:

* configure: Regenerate.

libatomic/ChangeLog:

* configure: Regenerate.

libbacktrace/ChangeLog:

* configure: Regenerate.

libcc1/ChangeLog:

* configure: Regenerate.

libffi/ChangeLog:

* configure: Regenerate.

libgfortran/ChangeLog:

* configure: Regenerate.

libgm2/ChangeLog:

* configure: Regenerate.

libgomp/ChangeLog:

* configure: Regenerate.

libitm/ChangeLog:

* configure: Regenerate.

libobjc/ChangeLog:

* configure: Regenerate.

libphobos/ChangeLog:

* configure: Regenerate.

libquadmath/ChangeLog:

* configure: Regenerate.

libsanitizer/ChangeLog:

* configure: Regenerate.

libssp/ChangeLog:

* configure: Regenerate.

libstdc++-v3/ChangeLog:

* configure: Regenerate.

libvtv/ChangeLog:

* configure: Regenerate.

lto-plugin/ChangeLog:

* configure: Regenerate.

zlib/ChangeLog:

* configure: Regenerate.

23 months agolibtool.m4: fix nm BSD flag detection
Nick Alcock [Mon, 27 Sep 2021 19:31:21 +0000 (20:31 +0100)] 
libtool.m4: fix nm BSD flag detection

Libtool needs to get BSD-format (or MS-format) output out of the system
nm, so that it can scan generated object files for symbol names for
-export-symbols-regex support.  Some nms need specific flags to turn on
BSD-formatted output, so libtool checks for this in its AC_PATH_NM.
Unfortunately the code to do this has a pair of interlocking flaws:

 - it runs the test by doing an nm of /dev/null.  Some platforms
   reasonably refuse to do an nm on a device file, but before now this
   has only been worked around by assuming that the error message has a
   specific textual form emitted by Tru64 nm, and that getting this
   error means this is Tru64 nm and that nm -B would work to produce
   BSD-format output, even though the test never actually got anything
   but an error message out of nm -B.  This is fixable by nm'ing *nm
   itself* (since we necessarily have a path to it).

 - the test is entirely skipped if NM is set in the environment, on the
   grounds that the user has overridden the test: but the user cannot
   reasonably be expected to know that libtool wants not only nm but
   also flags forcing BSD-format output.  Worse yet, one such "user" is
   the top-level Cygnus configure script, which neither tests for
   nor specifies any BSD-format flags.  So platforms needing BSD-format
   flags always fail to set them when run in a Cygnus tree, breaking
   -export-symbols-regex on such platforms.  Libtool also needs to
   augment $LD on some platforms, but this is done unconditionally,
   augmenting whatever the user specified: the nm check should do the
   same.

   One wrinkle: if the user has overridden $NM, a path might have been
   provided: so we use the user-specified path if there was one, and
   otherwise do the path search as usual.  (If the nm specified doesn't
   work, this might lead to a few extra pointless path searches -- but
   the test is going to fail anyway, so that's not a problem.)

(Tested with NM unset, and set to nm, /usr/bin/nm, my-nm where my-nm is a
symlink to /usr/bin/nm on the PATH, and /not-on-the-path/my-nm where
*that* is a symlink to /usr/bin/nm.)

ChangeLog:

* libtool.m4 (LT_PATH_NM): Try BSDization flags with a user-provided
NM, if there is one.  Run nm on itself, not on /dev/null, to avoid
errors from nms that refuse to work on non-regular files.  Remove
other workarounds for this problem.  Strip out blank lines from the
nm output.

fixincludes/ChangeLog:

* configure: Regenerate.

gcc/ChangeLog:

* configure: Regenerate.

libatomic/ChangeLog:

* configure: Regenerate.

libbacktrace/ChangeLog:

* configure: Regenerate.

libcc1/ChangeLog:

* configure: Regenerate.

libffi/ChangeLog:

* configure: Regenerate.

libgfortran/ChangeLog:

* configure: Regenerate.

libgm2/ChangeLog:

* configure: Regenerate.

libgomp/ChangeLog:

* configure: Regenerate.

libitm/ChangeLog:

* configure: Regenerate.

libobjc/ChangeLog:

* configure: Regenerate.

libphobos/ChangeLog:

* configure: Regenerate.

libquadmath/ChangeLog:

* configure: Regenerate.

libsanitizer/ChangeLog:

* configure: Regenerate.

libssp/ChangeLog:

* configure: Regenerate.

libstdc++-v3/ChangeLog:

* configure: Regenerate.

libvtv/ChangeLog:

* configure: Regenerate.

lto-plugin/ChangeLog:

* configure: Regenerate.

zlib/ChangeLog:

* configure: Regenerate.

23 months agoconfigure: reinstate 32b PA-RISC HP-UX target in toplevel
Arsen Arsenović [Wed, 2 Aug 2023 14:09:29 +0000 (16:09 +0200)] 
configure: reinstate 32b PA-RISC HP-UX target in toplevel

The Binutils still support this target.

ChangeLog:

* configure.ac: Reinstate 32b PA-RISC HP-UX targets
* configure: Regenerate.

23 months agoPass PKG_CONFIG_PATH down from top-level Makefile
Simon Marchi [Fri, 8 Apr 2022 14:56:41 +0000 (10:56 -0400)] 
Pass PKG_CONFIG_PATH down from top-level Makefile

[Sending to binutils, gdb-patches and gcc-patches, since it touches the
top-level Makefile/configure]

I have my debuginfod library installed in a non-standard location
(/opt/debuginfod), which requires me to set
PKG_CONFIG_PATH=/opt/debuginfod/lib/pkg-config.  If I just set it during
configure:

    $ PKG_CONFIG_PATH=/opt/debuginfod/lib/pkg-config ./configure --with-debuginfod
    $ make

or

    $ ./configure --with-debuginfod PKG_CONFIG_PATH=/opt/debuginfod/lib/pkg-config
    $ make

Then PKG_CONFIG_PATH is only present (and ignored) during the top-level
configure.  When running make (which runs gdb's and binutils'
configure), PKG_CONFIG_PATH is not set, which results in their configure
script not finding the library:

    checking for libdebuginfod >= 0.179... no
    configure: error: "--with-debuginfod was given, but libdebuginfod is missing or unusable."

Change the top-level configure/Makefile system to capture the value
passed when configuring the top-level and pass it down to
subdirectories (similar to CFLAGS, LDFLAGS, etc).

I don't know much about the top-level build system, so I really don't
know if I did this correctly.  The changes are:

 - Use AC_SUBST(PKG_CONFIG_PATH) in configure.ac, so that
   @PKG_CONFIG_PATH@ gets replaced with the actual PKG_CONFIG_PATH value
   in config files (i.e. Makefile)
 - Add a PKG_CONFIG_PATH Makefile variable in Makefile.tpl, initialized
   to @PKG_CONFIG_PATH@
 - Add PKG_CONFIG_PATH to HOST_EXPORTS in Makefile.tpl, which are the
   variables set when running the sub-configures

I initially added PKG_CONFIG_PATH to flags_to_pass, in Makefile.def, but
I don't think it's needed.  AFAIU, this defines the flags to pass down
when calling "make" in subdirectories.  We only need PKG_CONFIG_PATH to
be passed down during configure.  After that, it's captured in
gdb/config.status, so even if a "make" causes a re-configure later
(because gdb/configure has changed, for example), the PKG_CONFIG_PATH
value will be remembered.

Change-Id: I91138dfca41c43b05e53e445f62e4b27882536bf

ChangeLog:

* configure.ac: Add AC_SUBST(PKG_CONFIG_PATH).
* configure: Re-generate.
* Makefile.tpl (HOST_EXPORTS): Pass PKG_CONFIG_PATH.
(PKG_CONFIG_PATH): New.
* Makefile.in: Re-generate.

23 months agoDisable year 2038 support on 32-bit hosts by default
Luis Machado [Mon, 25 Jul 2022 23:17:38 +0000 (00:17 +0100)] 
Disable year 2038 support on 32-bit hosts by default

With a recent import of gnulib, code has been pulled that tests and enables
64-bit time_t by default on 32-bit hosts that support it.

Although gdb can use the gnulib support, bfd doesn't use gnulib and currently
doesn't do these checks.

As a consequence, if we have a 32-bit host that supports 64-bit time_t, we'll
have a mismatch between gdb's notion of time_t and bfd's notion of time_t.

This will lead to mismatches in the struct stat size, leading to memory
corruption and crashes.

This patch disables the year 2038 check for now, which makes things work
reliably again.

I'd consider this a temporary fix until we have proper bfd checks for the year
2038, if it makes sense.  64-bit hosts seems to be more common these days, so
I'm not sure how important it is to have this support enabled and how soon
we want to enable it.

Thoughts?

ChangeLog:

* configure.ac: Disable year2038 by default on 32-bit hosts.
* configure: Regenerate.

23 months agogprofng: a new GNU profiler
Vladimir Mezentsev [Fri, 11 Mar 2022 08:58:31 +0000 (08:58 +0000)] 
gprofng: a new GNU profiler

ChangeLog:

* Makefile.def: Add gprofng module.
* configure.ac: Add --enable-gprofng option.
* Makefile.in: Regenerate.
* configure: Regenerate.

include/ChangeLog:

* collectorAPI.h: New file.
* libcollector.h: New file.
* libfcollector.h: New file.

23 months agoadd --enable-default-compressed-debug-sections-algorithm configure option
Martin Liska [Mon, 3 Oct 2022 07:42:20 +0000 (09:42 +0200)] 
add --enable-default-compressed-debug-sections-algorithm configure option

ChangeLog:

* configure.ac: Add --enable-default-compressed-debug-sections-algorithm.
* configure: Regenerate.

23 months agoconfigure: require libzstd >= 1.4.0
Christophe Lyon [Fri, 4 Nov 2022 10:06:47 +0000 (11:06 +0100)] 
configure: require libzstd >= 1.4.0

gas uses ZSTD_compressStream2 which is only available with libzstd >=
1.4.0, leading to build errors when an older version is installed.

This patch updates the check libzstd presence to check its version is
>= 1.4.0. However, since gas seems to be the only component requiring
such a recent version this may imply that we disable ZSTD support for
all components although some would still benefit from an older
version.

I ran 'autoreconf -f' in all directories containing a configure.ac
file, using vanilla autoconf-2.69 and automake-1.15.1. I noticed
several errors from autoheader in readline, as well as warnings in
intl, but they are unrelated to this patch.

This should fix some of the buildbots.

OK for trunk?

Thanks,

Christophe

config/ChangeLog:

* zstd.m4: Add minimum version requirement of 1.4.0.

23 months agobinutils, gdb: support zstd compressed debug sections
Fangrui Song [Tue, 27 Sep 2022 02:50:13 +0000 (19:50 -0700)] 
binutils, gdb: support zstd compressed debug sections

PR29397 PR29563: Add new configure option --with-zstd which defaults to
auto.  If pkgconfig/libzstd.pc is found, define HAVE_ZSTD and support
zstd compressed debug sections for most tools.

* bfd: for addr2line, objdump --dwarf, gdb, etc
* gas: support --compress-debug-sections=zstd
* ld: support ELFCOMPRESS_ZSTD input and --compress-debug-sections=zstd
* objcopy: support ELFCOMPRESS_ZSTD input for
  --decompress-debug-sections and --compress-debug-sections=zstd
* gdb: support ELFCOMPRESS_ZSTD input.  The bfd change references zstd
  symbols, so gdb has to link against -lzstd in this patch.

If zstd is not supported, ELFCOMPRESS_ZSTD input triggers an error.  We
can avoid HAVE_ZSTD if binutils-gdb imports zstd/ like zlib/, but this
is too heavyweight, so don't do it for now.

```
% ld/ld-new a.o
ld/ld-new: a.o: section .debug_abbrev is compressed with zstd, but BFD is not built with zstd support
...

% ld/ld-new a.o --compress-debug-sections=zstd
ld/ld-new: --compress-debug-sections=zstd: ld is not built with zstd support

% binutils/objcopy --compress-debug-sections=zstd a.o b.o
binutils/objcopy: --compress-debug-sections=zstd: binutils is not built with zstd support

% binutils/objcopy b.o --decompress-debug-sections
binutils/objcopy: zstd.o: section .debug_abbrev is compressed with zstd, but BFD is not built with zstd support
...
```

config/ChangeLog:

* zstd.m4: New file.

ChangeLog:
* configure: Regenerate.
* configure.ac: Add --with-zstd.

23 months agotoplevel: Recover tilegx/tilepro targets
Arsen Arsenović [Sat, 29 Jul 2023 18:29:13 +0000 (20:29 +0200)] 
toplevel: Recover tilegx/tilepro targets

These are still supported in Binutils.

ChangeLog:

* configure: Regenerate.
* configure.ac: Recover tilegx/tilepro targets.

23 months agoGCC: Check if AR works with --plugin and rc
H.J. Lu [Tue, 12 Jan 2021 00:26:39 +0000 (16:26 -0800)] 
GCC: Check if AR works with --plugin and rc

AR from older binutils doesn't work with --plugin and rc:

[hjl@gnu-cfl-2 bin]$ touch foo.c
[hjl@gnu-cfl-2 bin]$ ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c
[hjl@gnu-cfl-2 bin]$ ./ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c
./ar: no operation specified
[hjl@gnu-cfl-2 bin]$ ./ar --version
GNU ar (Linux/GNU Binutils) 2.29.51.0.1.20180112
Copyright (C) 2018 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
[hjl@gnu-cfl-2 bin]$

Check if AR works with --plugin and rc before passing --plugin to AR and
RANLIB.

ChangeLog:

* configure: Regenerated.
* libtool.m4 (_LT_CMD_OLD_ARCHIVE): Check if AR works with
--plugin and rc before enabling --plugin.

config/ChangeLog:

* gcc-plugin.m4 (GCC_PLUGIN_OPTION): Check if AR works with
--plugin and rc before enabling --plugin.

gcc/ChangeLog:

* configure: Regenerate.

libatomic/ChangeLog:

* configure: Regenerate.

libbacktrace/ChangeLog:

* configure: Regenerate.

libcc1/ChangeLog:

* configure: Regenerate.

libffi/ChangeLog:

* configure: Regenerate.

libgfortran/ChangeLog:

* configure: Regenerate.

libgm2/ChangeLog:

* configure: Regenerate.

libgomp/ChangeLog:

* configure: Regenerate.

libiberty/ChangeLog:

* configure: Regenerate.

libitm/ChangeLog:

* configure: Regenerate.

libobjc/ChangeLog:

* configure: Regenerate.

libphobos/ChangeLog:

* configure: Regenerate.

libquadmath/ChangeLog:

* configure: Regenerate.

libsanitizer/ChangeLog:

* configure: Regenerate.

libssp/ChangeLog:

* configure: Regenerate.

libstdc++-v3/ChangeLog:

* configure: Regenerate.

libvtv/ChangeLog:

* configure: Regenerate.

lto-plugin/ChangeLog:

* configure: Regenerate.

zlib/ChangeLog:

* configure: Regenerate.

23 months agoSync with binutils: GCC: Pass --plugin to AR and RANLIB
H.J. Lu [Sat, 13 Nov 2021 14:11:41 +0000 (06:11 -0800)] 
Sync with binutils: GCC: Pass --plugin to AR and RANLIB

Sync with binutils for building binutils with LTO:

50ad1254d50 GCC: Pass --plugin to AR and RANLIB

Detect GCC LTO plugin.  Pass --plugin to AR and RANLIB to support LTO
build.

ChangeLog:

* Makefile.tpl (AR): Add @AR_PLUGIN_OPTION@
(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
* configure.ac: Include config/gcc-plugin.m4.
AC_SUBST AR_PLUGIN_OPTION and RANLIB_PLUGIN_OPTION.
* libtool.m4 (_LT_CMD_OLD_ARCHIVE): Pass --plugin to AR and
RANLIB if possible.
* Makefile.in: Regenerated.
* configure: Likewise.

config/ChangeLog:

* gcc-plugin.m4 (GCC_PLUGIN_OPTION): New.

libiberty/ChangeLog:

* Makefile.in (AR): Add @AR_PLUGIN_OPTION@
(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
(configure_deps): Depend on ../config/gcc-plugin.m4.
* configure.ac: AC_SUBST AR_PLUGIN_OPTION and
RANLIB_PLUGIN_OPTION.
* aclocal.m4: Regenerated.
* configure: Likewise.

zlib/ChangeLog:

* configure: Regenerated.

gcc/ChangeLog:

* configure: Regenerate.

libatomic/ChangeLog:

* configure: Regenerate.

libbacktrace/ChangeLog:

* configure: Regenerate.

libcc1/ChangeLog:

* configure: Regenerate.

libffi/ChangeLog:

* configure: Regenerate.

libgfortran/ChangeLog:

* configure: Regenerate.

libgm2/ChangeLog:

* configure: Regenerate.

libgomp/ChangeLog:

* configure: Regenerate.

libitm/ChangeLog:

* configure: Regenerate.

libobjc/ChangeLog:

* configure: Regenerate.

libphobos/ChangeLog:

* configure: Regenerate.

libquadmath/ChangeLog:

* configure: Regenerate.

libsanitizer/ChangeLog:

* configure: Regenerate.

libssp/ChangeLog:

* configure: Regenerate.

libstdc++-v3/ChangeLog:

* configure: Regenerate.

libvtv/ChangeLog:

* configure: Regenerate.

lto-plugin/ChangeLog:

* configure: Regenerate.

23 months agogcc-4.5 build fixes
Alan Modra [Mon, 15 May 2023 13:23:21 +0000 (22:53 +0930)] 
gcc-4.5 build fixes

Trying to build binutils with an older gcc currently fails.  Working
around these gcc bugs is not onerous so let's fix them.

include/ChangeLog:

* xtensa-dynconfig.h (xtensa_isa_internal): Delete unnecessary
forward declaration.

23 months agoPR29961, plugin-api.h: "Could not detect architecture endianess"
Alan Modra [Mon, 15 May 2023 13:02:32 +0000 (22:32 +0930)] 
PR29961, plugin-api.h: "Could not detect architecture endianess"

Found when attempting to build binutils on sparc sunos-5.8 where
sys/byteorder.h defines _BIG_ENDIAN but not any of the BYTE_ORDER
variants.  This patch adds the extra tests to cope with the old
machine, and tidies the header a little.

include/ChangeLog:

* plugin-api.h: When handling non-gcc or gcc < 4.6.0 include
necessary header files before testing macros.  Make more use
of #elif.  Test _LITTLE_ENDIAN and _BIG_ENDIAN in final tests.

23 months agotoplevel: Substitute GDCFLAGS instead of using CFLAGS
Arsen Arsenović [Sat, 5 Aug 2023 13:02:06 +0000 (15:02 +0200)] 
toplevel: Substitute GDCFLAGS instead of using CFLAGS

r14-2875-g1ed21e23d6d4da ("Use substituted GDCFLAGS") already
implemented this change, but only on the generated file rather than in
the template it is generated from.

ChangeLog:

* Makefile.tpl: Substitute @GDCFLAGS@ instead of using
$(CFLAGS).

23 months ago[committed][RISC-V]Don't reject constants in cmov condition
Jeff Law [Mon, 7 Aug 2023 20:34:40 +0000 (14:34 -0600)] 
[committed][RISC-V]Don't reject constants in cmov condition

This test is too aggressive.  Constants have VOIDmode, so we need to let the
through this phase of conditional move support.

Fixes several missed conditional moves with the trunk.

gcc/
* config/riscv/riscv.cc (riscv_expand_conditional_move): Allow
VOIDmode operands to conditional before canonicalization.

23 months agocprop_hardreg: Allow propagation of stack pointer in more cases.
Manolis Tsamis [Mon, 7 Aug 2023 10:10:16 +0000 (12:10 +0200)] 
cprop_hardreg: Allow propagation of stack pointer in more cases.

The stack pointer propagation fix 736f8fd3 turned out to be more
restrictive than needed by rejecting propagation of the stack pointer
when REG_POINTER didn't match.

This commit removes this check:
  When the stack pointer is propagated it is fine for this to result in
  REG_POINTER becoming true from false, which is what the original code
  checked.

This simplification makes the previously introduced function
maybe_copy_reg_attrs obsolete and the logic can be inlined at the call
sites, as it was before 736f8fd3.

gcc/ChangeLog:

* regcprop.cc (maybe_copy_reg_attrs): Remove unnecessary function.
(find_oldest_value_reg): Inline stack_pointer_rtx check.
(copyprop_hardreg_forward_1): Inline stack_pointer_rtx check.

23 months agoMAINTAINERS: Add myself as a BPF port reviewer
David Faust [Mon, 7 Aug 2023 17:17:48 +0000 (10:17 -0700)] 
MAINTAINERS: Add myself as a BPF port reviewer

ChangeLog:

* MAINTAINERS: Add the BPF port to my reviewer listing.

23 months agoipa-sra: Don't consider CLOBBERS as writes preventing splitting
Martin Jambor [Mon, 7 Aug 2023 17:13:41 +0000 (19:13 +0200)] 
ipa-sra: Don't consider CLOBBERS as writes preventing splitting

When IPA-SRA detects whether a parameter passed by reference is
written to, it does not special case CLOBBERs which means it often
bails out unnecessarily, especially when dealing with C++ destructors.
Fixed by the obvious continue in the two relevant loops and by adding
a simple function that marks the clobbers in the transformation code
as statements to be removed.

gcc/ChangeLog:

2023-08-04  Martin Jambor  <mjambor@suse.cz>

PR ipa/110378
* ipa-param-manipulation.h (class ipa_param_body_adjustments): New
members get_ddef_if_exists_and_is_used and mark_clobbers_dead.
* ipa-sra.cc (isra_track_scalar_value_uses): Ignore clobbers.
(ptr_parm_has_nonarg_uses): Likewise.
* ipa-param-manipulation.cc
(ipa_param_body_adjustments::get_ddef_if_exists_and_is_used): New.
(ipa_param_body_adjustments::mark_dead_statements): Move initial
checks to get_ddef_if_exists_and_is_used.
(ipa_param_body_adjustments::mark_clobbers_dead): New.
(ipa_param_body_adjustments::common_initialization): Call
mark_clobbers_dead when splitting.

gcc/testsuite/ChangeLog:

2023-07-31  Martin Jambor  <mjambor@suse.cz>

PR ipa/110378
* g++.dg/ipa/pr110378-1.C: New test.

23 months ago[committed] [RISC-V] Handle more cases in riscv_expand_conditional_move
Raphael Zinsly [Mon, 7 Aug 2023 14:26:24 +0000 (10:26 -0400)] 
[committed] [RISC-V] Handle more cases in riscv_expand_conditional_move

As I've mentioned in the main zicond thread, Ventana has had patches
that support more cases by first emitting a suitable scc instruction
essentially as a canonicalization step of the condition for zicond.

For example if we have

(set (target) (if_then_else (op (reg1) (reg2))
                            (true_value)
                            (false_value)))

The two register comparison isn't handled by zicond directly.  But we
can generate something like this instead

(set (temp) (op (reg1) (reg2)))
(set (target) (if_then_else (op (temp) (const_int 0))
                            (true_value)
                            (false_value)

Then let the remaining code from Xiao handle the true_value/false_value
to make sure it's zicond compatible.

This is primarily Raphael's work.  My involvement has been mostly to
move it from its original location (in the .md file) into the expander
function and fix minor problems with the FP case.

gcc/
* config/riscv/riscv.cc (riscv_expand_int_scc): Add invert_ptr
as an argument and pass it to riscv_emit_int_order_test.
(riscv_expand_conditional_move): Handle cases where the condition
is not EQ/NE or the second argument to the conditional is not
(const_int 0).
* config/riscv/riscv-protos.h (riscv_expand_int_scc): Update prototype.

Co-authored-by: Jeff Law <jlaw@ventanamicro.com>
23 months agoMATCH: [PR109959] `(uns <= 1) & uns` could be optimized to `uns == 1`
Andrew Pinski [Sun, 6 Aug 2023 20:57:35 +0000 (13:57 -0700)] 
MATCH: [PR109959] `(uns <= 1) & uns` could be optimized to `uns == 1`

I noticed while looking into some code generation of bitmap_single_bit_set_p,
that sometimes:
```
  if (uns > 1)
    return 0;
  return uns == 1;
```
Would not optimize down to just:
```
return uns == 1;
```

In this case, VRP likes to change `a == 1` into `(bool)a` if
a has a range of [0,1] due to `a <= 1` side of the branch.
We might end up with this similar code even without VRP,
in the case of builtin-sprintf-warn-23.c (and Wrestrict.c), we had:
```
if (s < 0 || 1 < s)
  s = 0;
```
Which is the same as `s = ((unsigned)s) <= 1 ? s : 0`;
So we should be able to catch that also.

This adds 2 patterns to catch `(uns <= 1) & uns` and
`(uns > 1) ? 0 : uns` and convert those into:
`(convert) uns == 1`.

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

PR tree-optimization/109959

gcc/ChangeLog:

* match.pd (`(a > 1) ? 0 : (cast)a`, `(a <= 1) & (cast)a`):
New patterns.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/builtin-sprintf-warn-23.c: Remove xfail.
* c-c++-common/Wrestrict.c: Update test and remove some xfail.
* gcc.dg/tree-ssa/cmpeq-1.c: New test.
* gcc.dg/tree-ssa/cmpeq-2.c: New test.
* gcc.dg/tree-ssa/cmpeq-3.c: New test.

23 months agoUse RPO order for sinking
Richard Biener [Thu, 3 Aug 2023 13:41:16 +0000 (15:41 +0200)] 
Use RPO order for sinking

The following makes us use RPO order instead of walking post-dominators.
This ensures we visit a block before any predecessors.  I've seen
some extra sinking because of this in a larger testcase but failed
to reduce a smaller one (processing of post-dominator sons is unordered
so I failed to have "luck").

* tree-ssa-sink.cc (pass_sink_code::execute): Do not
calculate post-dominators.  Calculate RPO on the inverted
graph and process blocks in that order.

23 months agoFix ICE in rtl check when bootstrap.
liuhongt [Mon, 7 Aug 2023 03:10:52 +0000 (11:10 +0800)] 
Fix ICE in rtl check when bootstrap.

/var/tmp/portage/sys-devel/gcc-14.0.0_pre20230806/work/gcc-14-20230806/libgfortran/generated/matmul_i1.c: In function â€˜matmul_i1_avx512f’:
/var/tmp/portage/sys-devel/gcc-14.0.0_pre20230806/work/gcc-14-20230806/libgfortran/generated/matmul_i1.c:1781:1: internal compiler error: RTL check: expected elt 0 type 'i' or 'n', have 'w' (rtx const_int) in vpternlog_redundant_operand_mask, at config/i386/i386.cc:19460
 1781 | }
      | ^
0x5559de26dc2d rtl_check_failed_type2(rtx_def const*, int, int, int, char const*, int, char const*)
        /var/tmp/portage/sys-devel/gcc-14.0.0_pre20230806/work/gcc-14-20230806/gcc/rtl.cc:761
0x5559de340bfe vpternlog_redundant_operand_mask(rtx_def**)
        /var/tmp/portage/sys-devel/gcc-14.0.0_pre20230806/work/gcc-14-20230806/gcc/config/i386/i386.cc:19460
0x5559dfec67a6 split_44
        /var/tmp/portage/sys-devel/gcc-14.0.0_pre20230806/work/gcc-14-20230806/gcc/config/i386/sse.md:12730
0x5559dfec67a6 split_63
        /var/tmp/portage/sys-devel/gcc-14.0.0_pre20230806/work/gcc-14-20230806/gcc/config/i386/sse.md:28428
0x5559deb8a682 try_split(rtx_def*, rtx_insn*, int)
        /var/tmp/portage/sys-devel/gcc-14.0.0_pre20230806/work/gcc-14-20230806/gcc/emit-rtl.cc:3800
0x5559deb8adf2 try_split(rtx_def*, rtx_insn*, int)
        /var/tmp/portage/sys-devel/gcc-14.0.0_pre20230806/work/gcc-14-20230806/gcc/emit-rtl.cc:3972
0x5559def69194 split_insn
        /var/tmp/portage/sys-devel/gcc-14.0.0_pre20230806/work/gcc-14-20230806/gcc/recog.cc:3385
0x5559def70c57 split_all_insns()
        /var/tmp/portage/sys-devel/gcc-14.0.0_pre20230806/work/gcc-14-20230806/gcc/recog.cc:3489
0x5559def70d0c execute
        /var/tmp/portage/sys-devel/gcc-14.0.0_pre20230806/work/gcc-14-20230806/gcc/recog.cc:4413

Use INTVAL (imm_op) instead of XINT (imm_op, 0).

gcc/ChangeLog:

PR target/110926
* config/i386/i386-protos.h
(vpternlog_redundant_operand_mask): Adjust parameter type.
* config/i386/i386.cc (vpternlog_redundant_operand_mask): Use
INTVAL instead of XINT, also adjust parameter type from rtx*
to rtx since the function only needs operands[4] in vpternlog
pattern.
(substitute_vpternlog_operands): Pass operands[4] instead of
operands to vpternlog_redundant_operand_mask.
* config/i386/sse.md: Ditto.

23 months agoImprove -fopt-info-vec for basic-block vectorization
Richard Biener [Mon, 7 Aug 2023 11:53:59 +0000 (13:53 +0200)] 
Improve -fopt-info-vec for basic-block vectorization

We currently dump notes like

flow_lam.f:65:72: optimized: basic block part vectorized using 32 byte vectors
flow_lam.f:65:72: optimized: basic block part vectorized using 32 byte vectors
flow_lam.f:65:72: optimized: basic block part vectorized using 32 byte vectors
flow_lam.f:65:72: optimized: basic block part vectorized using 32 byte vectors
..

repeating the same location for multiple instances because we
clobber vect_location during BB vectorization.  The following
avoids this, improving things to

flow_lam.f:15:72: optimized: basic block part vectorized using 32 byte vectors
flow_lam.f:16:72: optimized: basic block part vectorized using 32 byte vectors
flow_lam.f:17:72: optimized: basic block part vectorized using 32 byte vectors
flow_lam.f:18:72: optimized: basic block part vectorized using 32 byte vectors
...

* tree-vect-slp.cc (vect_slp_region): Save/restore vect_location
around dumping code.

23 months agoi386: Clear upper bits of XMM register for V4HFmode/V2HFmode operations [PR110762]
liuhongt [Fri, 4 Aug 2023 07:35:54 +0000 (15:35 +0800)] 
i386: Clear upper bits of XMM register for V4HFmode/V2HFmode operations [PR110762]

Similar like r14-2786-gade30fad6669e5, the patch is for V4HF/V2HFmode.

gcc/ChangeLog:

PR target/110762
* config/i386/mmx.md (<insn><mode>3): Changed from define_insn
to define_expand and break into ..
(<insn>v4hf3): .. this.
(divv4hf3): .. this.
(<insn>v2hf3): .. this.
(divv2hf3): .. this.
(movd_v2hf_to_sse): New define_expand.
(movq_<mode>_to_sse): Extend to V4HFmode.
(mmxdoublevecmode): Ditto.
(V2FI_V4HF): New mode iterator.
* config/i386/sse.md (*vec_concatv4sf): Extend to hanlde V8HF
by using mode iterator V4SF_V8HF, renamed to ..
(*vec_concat<mode>): .. this.
(*vec_concatv4sf_0): Extend to handle V8HF by using mode
iterator V4SF_V8HF, renamed to ..
(*vec_concat<mode>_0): .. this.
(*vec_concatv8hf_movss): New define_insn.
(V4SF_V8HF): New mode iterator.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr110762-v4hf.c: New test.

23 months agoada: Refactor multiple returns
Sheri Bernstein [Thu, 27 Jul 2023 17:12:37 +0000 (17:12 +0000)] 
ada: Refactor multiple returns

Replace multiple returns by a single return statement with a conditional
expression. This is more readable and maintainable, and also conformant with
a Highly Recommended design principle of ISO 26262-6.

gcc/ada/

* libgnat/s-parame__qnx.adb: Refactor multiple returns.

23 months agoada: Extend precondition of Interfaces.C.String.Value with Length
Piotr Trojanek [Fri, 28 Jul 2023 10:13:28 +0000 (12:13 +0200)] 
ada: Extend precondition of Interfaces.C.String.Value with Length

The existing precondition guarded against exception Dereference_Error,
but not against Constraint_Error.

The RM rule B.3.1(36/3) only mentions Constraint_Error for the Value
function which returns char_array, but the one which returns String
has the same restriction, because it is equivalent to calling the
variant which returns char_array and then converted.

gcc/ada/

* libgnat/i-cstrin.ads (Value): Extend preconditions; adapt comment for
the package.

23 months agoada: Crash in GNATprove due to wrong detection of inlining
Yannick Moy [Fri, 28 Jul 2023 07:17:41 +0000 (09:17 +0200)] 
ada: Crash in GNATprove due to wrong detection of inlining

When a function is called in a predicate, it was not properly detected
as not always inlined in GNATprove mode, which led to crashes later during
analysis. Fixed now.

gcc/ada/

* sem_res.adb (Resolve_Call): Always call Cannot_Inline so that
subprogram called is marked as not always inlined.

23 months agoada: Spurious error on class-wide preconditions
Javier Miranda [Thu, 27 Jul 2023 11:02:20 +0000 (11:02 +0000)] 
ada: Spurious error on class-wide preconditions

The compiler reports an spurious error when a class-wide precondition
expression has a class-wide type conversion.

gcc/ada/

* sem_res.adb (Resolve_Type_Conversion): Do not warn on conversion
to class-wide type on internally build helpers of class-wide
preconditions.

23 months agotree-optimization/110897 - Fix missed vectorization of shift on both RISC-V and aarch64
Juzhe-Zhong [Mon, 7 Aug 2023 01:54:31 +0000 (09:54 +0800)] 
tree-optimization/110897 - Fix missed vectorization of shift on both RISC-V and aarch64

Consider this following case:

#include <stdint.h>

#define TEST2_TYPE(TYPE) \
  __attribute__((noipa)) \
  void vshiftr_##TYPE (TYPE *__restrict dst, TYPE *__restrict a, TYPE *__restrict b, int n) \
  { \
    for (int i = 0; i < n; i++) \
      dst[i] = (a[i]) >> b[i]; \
  }

#define TEST_ALL() \
 TEST2_TYPE(uint8_t) \
 TEST2_TYPE(uint16_t) \
 TEST2_TYPE(uint32_t) \
 TEST2_TYPE(uint64_t) \

TEST_ALL()

Both RISC-V and aarch64 of trunk GCC failed vectorize uint8_t/uint16_t with following missed report:

<source>:17:1: missed: couldn't vectorize loop
<source>:17:1: missed: not vectorized: relevant stmt not supported: patt_46 = MIN_EXPR <_6, 7>;
<source>:17:1: missed: couldn't vectorize loop
<source>:17:1: missed: not vectorized: relevant stmt not supported: patt_47 = MIN_EXPR <_7, 15>;
Compiler returned: 0

Both GCC 13.1 can vectorize, see:

https://godbolt.org/z/6vaMK5M1o

Bootstrap and regression on X86 passed.

Ok for trunk ?

gcc/ChangeLog:

* tree-vect-patterns.cc (vect_recog_over_widening_pattern): Add op vectype.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/binop/narrow-1.c: Adapt testcase.

23 months agox86: drop redundant "prefix_data16" attributes
Jan Beulich [Mon, 7 Aug 2023 09:53:17 +0000 (11:53 +0200)] 
x86: drop redundant "prefix_data16" attributes

The attribute defaults to 1 for TI-mode insns of type sselog, sselog1,
sseiadd, sseimul, and sseishft.

In *<code>v8hi3 [smaxmin] and *<code>v16qi3 [umaxmin] also drop the
similarly stray "prefix_extra" at this occasion. These two max/min
flavors are encoded in 0f space.

gcc/

* config/i386/mmx.md (*mmx_pinsrd): Drop "prefix_data16".
(*mmx_pinsrb): Likewise.
(*mmx_pextrb): Likewise.
(*mmx_pextrb_zext): Likewise.
(mmx_pshufbv8qi3): Likewise.
(mmx_pshufbv4qi3): Likewise.
(mmx_pswapdv2si2): Likewise.
(*pinsrb): Likewise.
(*pextrb): Likewise.
(*pextrb_zext): Likewise.
* config/i386/sse.md (*sse4_1_mulv2siv2di3<mask_name>): Likewise.
(*sse2_eq<mode>3): Likewise.
(*sse2_gt<mode>3): Likewise.
(<sse2p4_1>_pinsr<ssemodesuffix>): Likewise.
(*vec_extract<mode>): Likewise.
(*vec_extract<PEXTR_MODE12:mode>_zext): Likewise.
(*vec_extractv16qi_zext): Likewise.
(ssse3_ph<plusminus_mnemonic>wv8hi3): Likewise.
(ssse3_pmaddubsw128): Likewise.
(*<ssse3_avx2>_pmulhrsw<mode>3<mask_name>): Likewise.
(<ssse3_avx2>_pshufb<mode>3<mask_name>): Likewise.
(<ssse3_avx2>_psign<mode>3): Likewise.
(<ssse3_avx2>_palignr<mode>): Likewise.
(*abs<mode>2): Likewise.
(sse4_2_pcmpestr): Likewise.
(sse4_2_pcmpestri): Likewise.
(sse4_2_pcmpestrm): Likewise.
(sse4_2_pcmpestr_cconly): Likewise.
(sse4_2_pcmpistr): Likewise.
(sse4_2_pcmpistri): Likewise.
(sse4_2_pcmpistrm): Likewise.
(sse4_2_pcmpistr_cconly): Likewise.
(vgf2p8affineinvqb_<mode><mask_name>): Likewise.
(vgf2p8affineqb_<mode><mask_name>): Likewise.
(vgf2p8mulb_<mode><mask_name>): Likewise.
(*<code>v8hi3 [smaxmin]): Drop "prefix_data16" and
"prefix_extra".
(*<code>v16qi3 [umaxmin]): Likewise.

23 months agox86: correct "length_immediate" in a few cases
Jan Beulich [Mon, 7 Aug 2023 09:52:14 +0000 (11:52 +0200)] 
x86: correct "length_immediate" in a few cases

When first added explicitly in 3ddffba914b2 ("i386.md
(sse4_1_round<mode>2): Add avx512f alternative"), "*" should not have
been used for the pre-existing alternative. The attribute was plain
missing. Subsequent changes adding more alternatives then generously
extended the bogus pattern.

Apparently something similar happened to the two mmx_pblendvb_* insns.

gcc/

* config/i386/i386.md (sse4_1_round<mode>2): Make
"length_immediate" uniformly 1.
* config/i386/mmx.md (mmx_pblendvb_v8qi): Likewise.
(mmx_pblendvb_<mode>): Likewise.

23 months agox86: add missing "prefix" attribute to VF{,C}MULC
Jan Beulich [Mon, 7 Aug 2023 09:50:42 +0000 (11:50 +0200)] 
x86: add missing "prefix" attribute to VF{,C}MULC

gcc/

* config/i386/sse.md
(<avx512>_<complexopname>_<mode><maskc_name><round_name>): Add
"prefix" attribute.
(avx512fp16_<complexopname>sh_v8hf<mask_scalarc_name><round_scalarcz_name>):
Likewise.

23 months agox86: add (adjust) XOP insn attributes
Jan Beulich [Mon, 7 Aug 2023 09:49:55 +0000 (11:49 +0200)] 
x86: add (adjust) XOP insn attributes

Many were lacking "prefix" and "prefix_extra", some had a bogus value of
2 for "prefix_extra" (presumably inherited from their SSE5 counterparts,
which are long gone) and a meaningless "prefix_data16" one. Where
missing, "mode" attributes are also added. (Note that "sse4arg" and
"ssemuladd" ones don't need further adjustment in this regard.)

gcc/

* config/i386/sse.md (xop_phadd<u>bw): Add "prefix",
"prefix_extra", and "mode" attributes.
(xop_phadd<u>bd): Likewise.
(xop_phadd<u>bq): Likewise.
(xop_phadd<u>wd): Likewise.
(xop_phadd<u>wq): Likewise.
(xop_phadd<u>dq): Likewise.
(xop_phsubbw): Likewise.
(xop_phsubwd): Likewise.
(xop_phsubdq): Likewise.
(xop_rotl<mode>3): Add "prefix" and "prefix_extra" attributes.
(xop_rotr<mode>3): Likewise.
(xop_frcz<mode>2): Likewise.
(*xop_vmfrcz<mode>2): Likewise.
(xop_vrotl<mode>3): Add "prefix" attribute. Change
"prefix_extra" to 1.
(xop_sha<mode>3): Likewise.
(xop_shl<mode>3): Likewise.

23 months agox86: drop stray "prefix_extra"
Jan Beulich [Mon, 7 Aug 2023 09:48:12 +0000 (11:48 +0200)] 
x86: drop stray "prefix_extra"

While the attribute is relevant for legacy- and VEX-encoded insns, it is
of no relevance for EVEX-encoded ones.

While there in <mask_codefor>avx512dq_broadcast<mode><mask_name>_1 add
the missing "length_immediate".

gcc/

* config/i386/sse.md
(*<avx512>_eq<mode>3<mask_scalar_merge_name>_1): Drop
"prefix_extra".
(avx512dq_vextract<shuffletype>64x2_1_mask): Likewise.
(*avx512dq_vextract<shuffletype>64x2_1): Likewise.
(avx512f_vextract<shuffletype>32x4_1_mask): Likewise.
(*avx512f_vextract<shuffletype>32x4_1): Likewise.
(vec_extract_lo_<mode>_mask [AVX512 forms]): Likewise.
(vec_extract_lo_<mode> [AVX512 forms]): Likewise.
(vec_extract_hi_<mode>_mask [AVX512 forms]): Likewise.
(vec_extract_hi_<mode> [AVX512 forms]): Likewise.
(@vec_extract_lo_<mode> [AVX512 forms]): Likewise.
(@vec_extract_hi_<mode> [AVX512 forms]): Likewise.
(vec_extract_lo_v64qi): Likewise.
(vec_extract_hi_v64qi): Likewise.
(*vec_widen_umult_even_v16si<mask_name>): Likewise.
(*vec_widen_smult_even_v16si<mask_name>): Likewise.
(*avx512f_<code><mode>3<mask_name>): Likewise.
(*vec_extractv4ti): Likewise.
(avx512bw_<code>v32qiv32hi2<mask_name>): Likewise.
(<mask_codefor>avx512dq_broadcast<mode><mask_name>_1): Likewise.
Add "length_immediate".

23 months agox86: replace/correct bogus "prefix_extra"
Jan Beulich [Mon, 7 Aug 2023 09:47:27 +0000 (11:47 +0200)] 
x86: replace/correct bogus "prefix_extra"

In the rdrand and rdseed cases "prefix_0f" is meant instead. For
mmx_floatv2siv2sf2 1 is correct only for the first alternative. For
the integer min/max cases 1 uniformly applies to legacy and VEX
encodings (the UB and SW variants are dealt with separately anyway).
Same for {,V}MOVNTDQA.

Unlike {,V}PEXTRW, which has two encoding forms, {,V}PINSRW only has
a single form in 0f space. (In *vec_extract<mode> note that the
dropped part if the condition also referenced non-existing alternative
2.)

Of the integer compare insns, only the 64-bit element forms are encoded
in 0f38 space.

gcc/

* config/i386/i386.md (@rdrand<mode>): Add "prefix_0f". Drop
"prefix_extra".
(@rdseed<mode>): Likewise.
* config/i386/mmx.md (<code><mode>3 [smaxmin and umaxmin cases]):
Adjust "prefix_extra".
* config/i386/sse.md (@vec_set<mode>_0): Likewise.
(*sse4_1_<code><mode>3<mask_name>): Likewise.
(*avx2_eq<mode>3): Likewise.
(avx2_gt<mode>3): Likewise.
(<sse2p4_1>_pinsr<ssemodesuffix>): Likewise.
(*vec_extract<mode>): Likewise.
(<vi8_sse4_1_avx2_avx512>_movntdqa): Likewise.

23 months agox86: "prefix_extra" can't really be "2"
Jan Beulich [Mon, 7 Aug 2023 09:46:44 +0000 (11:46 +0200)] 
x86: "prefix_extra" can't really be "2"

In the three remaining instances separate "prefix_0f" and "prefix_rep"
are what is wanted instead.

gcc/

* config/i386/i386.md (rd<fsgs>base<mode>): Add "prefix_0f" and
"prefix_rep". Drop "prefix_extra".
(wr<fsgs>base<mode>): Likewise.
(ptwrite<mode>): Likewise.

23 months agox86: "ssemuladd" adjustments
Jan Beulich [Mon, 7 Aug 2023 09:45:20 +0000 (11:45 +0200)] 
x86: "ssemuladd" adjustments

They're all VEX3- (also covering XOP) or EVEX-encoded. Express that in
the default calculation of "prefix". FMA4 insns also all have a 1-byte
immediate operand.

Where the default calculation is not sufficient / applicable, add
explicit "prefix" attributes. While there also add a "mode" attribute to
fma_<complexpairopname>_<mode>_pair.

gcc/

* config/i386/i386.md (isa): Move up.
(length_immediate): Handle "fma4".
(prefix): Handle "ssemuladd".
* config/i386/sse.md (*fma_fmadd_<mode>): Add "prefix" attribute.
(<sd_mask_codefor>fma_fmadd_<mode><sd_maskz_name><round_name>):
Likewise.
(<avx512>_fmadd_<mode>_mask<round_name>): Likewise.
(<avx512>_fmadd_<mode>_mask3<round_name>): Likewise.
(<sd_mask_codefor>fma_fmsub_<mode><sd_maskz_name><round_name>):
Likewise.
(<avx512>_fmsub_<mode>_mask<round_name>): Likewise.
(<avx512>_fmsub_<mode>_mask3<round_name>): Likewise.
(*fma_fnmadd_<mode>): Likewise.
(<sd_mask_codefor>fma_fnmadd_<mode><sd_maskz_name><round_name>):
Likewise.
(<avx512>_fnmadd_<mode>_mask<round_name>): Likewise.
(<avx512>_fnmadd_<mode>_mask3<round_name>): Likewise.
(<sd_mask_codefor>fma_fnmsub_<mode><sd_maskz_name><round_name>):
Likewise.
(<avx512>_fnmsub_<mode>_mask<round_name>): Likewise.
(<avx512>_fnmsub_<mode>_mask3<round_name>): Likewise.
(<sd_mask_codefor>fma_fmaddsub_<mode><sd_maskz_name><round_name>):
Likewise.
(<avx512>_fmaddsub_<mode>_mask<round_name>): Likewise.
(<avx512>_fmaddsub_<mode>_mask3<round_name>): Likewise.
(<sd_mask_codefor>fma_fmsubadd_<mode><sd_maskz_name><round_name>):
Likewise.
(<avx512>_fmsubadd_<mode>_mask<round_name>): Likewise.
(<avx512>_fmsubadd_<mode>_mask3<round_name>): Likewise.
(*fmai_fmadd_<mode>): Likewise.
(*fmai_fmsub_<mode>): Likewise.
(*fmai_fnmadd_<mode><round_name>): Likewise.
(*fmai_fnmsub_<mode><round_name>): Likewise.
(avx512f_vmfmadd_<mode>_mask<round_name>): Likewise.
(avx512f_vmfmadd_<mode>_mask3<round_name>): Likewise.
(avx512f_vmfmadd_<mode>_maskz_1<round_name>): Likewise.
(*avx512f_vmfmsub_<mode>_mask<round_name>): Likewise.
(avx512f_vmfmsub_<mode>_mask3<round_name>): Likewise.
(*avx512f_vmfmsub_<mode>_maskz_1<round_name>): Likewise.
(avx512f_vmfnmadd_<mode>_mask<round_name>): Likewise.
(avx512f_vmfnmadd_<mode>_mask3<round_name>): Likewise.
(avx512f_vmfnmadd_<mode>_maskz_1<round_name>): Likewise.
(*avx512f_vmfnmsub_<mode>_mask<round_name>): Likewise.
(*avx512f_vmfnmsub_<mode>_mask3<round_name>): Likewise.
(*avx512f_vmfnmsub_<mode>_maskz_1<round_name>): Likewise.
(*fma4i_vmfmadd_<mode>): Likewise.
(*fma4i_vmfmsub_<mode>): Likewise.
(*fma4i_vmfnmadd_<mode>): Likewise.
(*fma4i_vmfnmsub_<mode>): Likewise.
(fma_<complexopname>_<mode><sdc_maskz_name><round_name>): Likewise.
(<avx512>_<complexopname>_<mode>_mask<round_name>): Likewise.
(avx512fp16_fma_<complexopname>sh_v8hf<mask_scalarcz_name><round_scalarcz_name>):
Likewise.
(avx512fp16_<complexopname>sh_v8hf_mask<round_name>): Likewise.
(xop_p<macs><ssemodesuffix><ssemodesuffix>): Likewise.
(xop_p<macs>dql): Likewise.
(xop_p<macs>dqh): Likewise.
(xop_p<macs>wd): Likewise.
(xop_p<madcs>wd): Likewise.
(fma_<complexpairopname>_<mode>_pair): Likewise. Add "mode" attribute.

23 months agox86: "sse4arg" adjustments
Jan Beulich [Mon, 7 Aug 2023 09:44:37 +0000 (11:44 +0200)] 
x86: "sse4arg" adjustments

Record common properties in other attributes' default calculations:
There's always a 1-byte immediate, and they're always encoded in a VEX3-
like manner (note that "prefix_extra" already evaluates to 1 in this
case). The drop now (or already previously) redundant explicit
attributes, adding "mode" ones where they were missing.

Furthermore use "sse4arg" consistently for all VPCOM* insns; so far
signed comparisons did use it, while unsigned ones used "ssecmp". Note
that while they have (not counting the explicit or implicit immediate
operand) they really only have 3 operands, the operator is also counted
in those patterns. That's relevant for establishing the "memory"
attribute's value, and at the same time benign when there are only
register operands.

Note that despite also having 4 operands, multiply-add insns aren't
affected by this change, as they use "ssemuladd" for "type".

gcc/

* config/i386/i386.md (length_immediate): Handle "sse4arg".
(prefix): Likewise.
(*xop_pcmov_<mode>): Add "mode" attribute.
* config/i386/mmx.md (*xop_maskcmp<mode>3): Drop "prefix_data16",
"prefix_rep", "prefix_extra", and "length_immediate" attributes.
(*xop_maskcmp_uns<mode>3): Likewise. Switch "type" to "sse4arg".
(*xop_pcmov_<mode>): Add "mode" attribute.
* config/i386/sse.md (xop_pcmov_<mode><avxsizesuffix>): Add "mode"
attribute.
(xop_maskcmp<mode>3): Drop "prefix_data16", "prefix_rep",
"prefix_extra", and "length_immediate" attributes.
(xop_maskcmp_uns<mode>3): Likewise. Switch "type" to "sse4arg".
(xop_maskcmp_uns2<mode>3): Drop "prefix_data16", "prefix_extra",
and "length_immediate" attributes. Switch "type" to "sse4arg".
(xop_pcom_tf<mode>3): Likewise.
(xop_vpermil2<mode>3): Drop "length_immediate" attribute.

23 months agox86: "prefix_extra" tidying
Jan Beulich [Mon, 7 Aug 2023 09:43:55 +0000 (11:43 +0200)] 
x86: "prefix_extra" tidying

Drop SSE5 leftovers from both its comment and its default calculation.
A value of 2 simply cannot occur anymore. Instead extend the comment to
mention the use of the attribute in "length_vex", clarifying why
"prefix_extra" can actually be meaningful on VEX-encoded insns despite
those not having any real prefixes except possibly segment overrides.

gcc/

* config/i386/i386.md (prefix_extra): Correct comment. Fold
cases yielding 2 into ones yielding 1.

23 months agolibsanitizer: Fix SPARC stacktraces
Rainer Orth [Mon, 7 Aug 2023 09:29:02 +0000 (11:29 +0200)] 
libsanitizer: Fix SPARC stacktraces

As detailed in LLVM Issue #57624
(https://github.com/llvm/llvm-project/issues/57624), a patch to
sanitizer_internal_defs.h broke SPARC stacktraces in the sanitizers.
The issue has now been fixed upstream (https://reviews.llvm.org/D156504)
and I'd like to cherry-pick that patch.

Bootstrapped without regressions on sparc-sun-solaris2.11.

2023-07-27  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

libsanitizer:
* sanitizer_common/sanitizer_stacktrace_sparc.cpp,
sanitizer_common/sanitizer_unwind_linux_libcdep.cpp: Cherry-pick
llvm-project revision 679c076ae446af81eba81ce9b94203a273d4b88a.

23 months agoFix profile update after versioning ifconverted loop
Jan Hubicka [Mon, 7 Aug 2023 08:55:58 +0000 (10:55 +0200)] 
Fix profile update after versioning ifconverted loop

If loop is ifconverted and later versioning by vectorizer, vectorizer will
reuse the scalar loop produced by ifconvert. Curiously enough it does not seem
to do so for versions produced by loop distribution while for loop distribution
this matters (since since both ldist versions survive to final code) while
after ifcvt it does not (since we remove non-vectorized path).

This patch fixes associated profile update.  Here it is necessary to scale both
arms of the conditional according to runtime checks inserted.  We got partly
right the loop body, but not the preheader block and block after exit.  The
first is particularly bad since it changes loop iterations estimates.

So we now turn 4 original loops:
  loop 1: iterations by profile: 473.497707 (reliable) entry count:84821 (precise, freq 0.9979)
  loop 2: iterations by profile: 100.000000 (reliable) entry count:39848881 (precise, freq 468.8104)
  loop 3: iterations by profile: 100.000000 (reliable) entry count:39848881 (precise, freq 468.8104)
  loop 4: iterations by profile: 100.999596 (reliable) entry count:84167 (precise, freq 0.9902)

Into following loops
  iterations by profile: 5.312499 (unreliable, maybe flat) entry count:12742188 (guessed, freq 149.9081)
     vectorized and split loop 1, peeled
  iterations by profile: 0.009496 (unreliable, maybe flat) entry count:374798 (guessed, freq 4.4094)
     split loop 1 (last iteration), peeled
  iterations by profile: 100.000008 (unreliable) entry count:3945039 (guessed, freq 46.4122)
     scalar version of loop 1
  iterations by profile: 100.000007 (unreliable) entry count:7101070 (guessed, freq 83.5420)
     redundant scalar version of loop 1 which we could eliminate if vectorizer understood ldist
  iterations by profile: 100.000000 (unreliable) entry count:35505353 (guessed, freq 417.7100)
     unvectorized loop 2
  iterations by profile: 5.312500 (unreliable) entry count:25563855 (guessed, freq 300.7512)
     vectorized loop 2, not peeled (hits max-peel-insns)
  iterations by profile: 100.000007 (unreliable) entry count:7101070 (guessed, freq 83.5420)
     unvectorized loop 3
  iterations by profile: 5.312500 (unreliable) entry count:25563855 (guessed, freq 300.7512)
     vectorized loop 3, not peeled (hits max-peel-insns)
  iterations by profile: 473.497707 (reliable) entry count:84821 (precise, freq 0.9979)
     loop 1
  iterations by profile: 100.999596 (reliable) entry count:84167 (precise, freq 0.9902)
     loop 4

With this change we are on 0 profile erros on hmmer benchmark:

Pass dump id |dynamic mismatch          |overall                              |
             |in count                  |size            |time                |
172t ch_vect |            0             |      996       | 385812023346       |
173t ifcvt   |     71010686    +71010686|     1021  +2.5%| 468361969416 +21.4%|
174t vect    |    210830784   +139820098|     1497 +46.6%| 216073467874 -53.9%|
175t dce     |    210830784             |     1387  -7.3%| 205273170281  -5.0%|
176t pcom    |    210830784             |     1387       | 201722634966  -1.7%|
177t cunroll |            0   -210830784|     1443  +4.0%| 180441501289 -10.5%|
182t ivopts  |            0             |     1385  -4.0%| 136412345683 -24.4%|
183t lim     |            0             |     1389  +0.3%| 135093950836  -1.0%|
192t reassoc |            0             |     1381  -0.6%| 134778347700  -0.2%|
193t slsr    |            0             |     1380  -0.1%| 134738100330  -0.0%|
195t tracer  |            0             |     1521 +10.2%| 134738179146  +0.0%|
196t fre     |      2680654     +2680654|     1489  -2.1%| 134659672725  -0.1%|
198t dom     |      5361308     +2680654|     1473  -1.1%| 134449553658  -0.2%|
201t vrp     |      5361308             |     1474  +0.1%| 134489004050  +0.0%|
202t ccp     |      5361308             |     1472  -0.1%| 134440752274  -0.0%|
204t dse     |      5361308             |     1444  -1.9%| 133802300525  -0.5%|
206t forwprop|      5361308             |     1433  -0.8%| 133542828370  -0.2%|
207t sink    |      5361308             |     1431  -0.1%| 133542658728  -0.0%|
211t store-me|      5361308             |     1430  -0.1%| 133542573728  -0.0%|
212t cddce   |      5361308             |     1428  -0.1%| 133541776728  -0.0%|
258r expand  |      5361308             |----------------|--------------------|
260r into_cfg|      5361308             |     9334  -0.8%| 885820707913  -0.6%|
261r jump    |      5361308             |     9330  -0.0%| 885820367913  -0.0%|
265r fwprop1 |      5361308             |     9206  -1.3%| 876756504385  -1.0%|
267r rtl pre |      5361308             |     9210  +0.0%| 876914305953  +0.0%|
269r cprop   |      5361308             |     9202  -0.1%| 876756165101  -0.0%|
271r cse_loca|      5361308             |     9198  -0.0%| 876727760821  -0.0%|
272r ce1     |      5361308             |     9126  -0.8%| 875726815885  -0.1%|
276r loop2_in|      5361308             |     9167  +0.4%| 873573110570  -0.2%|
282r cprop   |      5361308             |     9095  -0.8%| 871937317262  -0.2%|
284r cse2    |      5361308             |     9091  -0.0%| 871936977978  -0.0%|
285r dse1    |      5361308             |     9067  -0.3%| 871437031602  -0.1%|
290r combine |      5361308             |     9071  +0.0%| 869206278202  -0.3%|
292r stv     |      5361308             |    17157 +89.1%| 2111071925708+142.9%|
295r bbpart  |      5361308             |    17161  +0.0%| 2111071925708       |
296r outof_cf|      5361308             |    17233  +0.4%| 2111655121000  +0.0%|
297r split1  |      5361308             |    17245  +0.1%| 2111656138852  +0.0%|
306r ira     |      5361308             |    19189 +11.3%| 2136098398308  +1.2%|
307r reload  |      5361308             |    12101 -36.9%| 981091222830 -54.1%|
309r postrelo|      5361308             |    12019  -0.7%| 978750345475  -0.2%|
310r gcse2   |      5361308             |    12027  +0.1%| 978329108320  -0.0%|
311r split2  |      5361308             |    12023  -0.0%| 978507631352  +0.0%|
312r ree     |      5361308             |    12027  +0.0%| 978505414244  -0.0%|
313r cmpelim |      5361308             |    11979  -0.4%| 977531601988  -0.1%|
314r pro_and_|      5361308             |    12091  +0.9%| 977541801988  +0.0%|
315r dse2    |      5361308             |    12091       | 977541801988       |
316r csa     |      5361308             |    12087  -0.0%| 977541461988  -0.0%|
317r jump2   |      5361308             |    12039  -0.4%| 977683176572  +0.0%|
318r compgoto|      5361308             |    12039       | 977683176572       |
320r peephole|      5361308             |    12047  +0.1%| 977362727612  -0.0%|
321r ce3     |      5361308             |    12047       | 977362727612       |
323r cprop_ha|      5361308             |    11907  -1.2%| 968751076676  -0.9%|
324r rtl_dce |      5361308             |    11903  -0.0%| 968593274820  -0.0%|
325r bbro    |      5361308             |    11883  -0.2%| 967964046644  -0.1%|

Bootstrapped/regtested x86_64-linux, plan to commit it tomorrow if there are no
complains.

gcc/ChangeLog:

PR tree-optimization/106293
* tree-vect-loop-manip.cc (vect_loop_versioning): Fix profile update.
* tree-vect-loop.cc (vect_transform_loop): Likewise.

gcc/testsuite/ChangeLog:

PR tree-optimization/106293
* gcc.dg/vect/vect-cond-11.c: Check profile consistency.
* gcc.dg/vect/vect-widen-mult-extern-1.c: Check profile consistency.

23 months agoMATCH: Extend min_value/max_value to pointer types
Andrew Pinski [Sat, 5 Aug 2023 16:23:26 +0000 (09:23 -0700)] 
MATCH: Extend min_value/max_value to pointer types

Since we already had the infrastructure to optimize
`(x == 0) && (x > y)` to false for integer types,
this extends the same to pointer types as indirectly
requested by PR 96695.

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

gcc/ChangeLog:

PR tree-optimization/96695
* match.pd (min_value, max_value): Extend to
pointer types too.

gcc/testsuite/ChangeLog:

PR tree-optimization/96695
* gcc.dg/pr96695-1.c: New test.
* gcc.dg/pr96695-10.c: New test.
* gcc.dg/pr96695-11.c: New test.
* gcc.dg/pr96695-12.c: New test.
* gcc.dg/pr96695-2.c: New test.
* gcc.dg/pr96695-3.c: New test.
* gcc.dg/pr96695-4.c: New test.
* gcc.dg/pr96695-5.c: New test.
* gcc.dg/pr96695-6.c: New test.
* gcc.dg/pr96695-7.c: New test.
* gcc.dg/pr96695-8.c: New test.
* gcc.dg/pr96695-9.c: New test.

23 months agoDaily bump.
GCC Administrator [Mon, 7 Aug 2023 00:16:55 +0000 (00:16 +0000)] 
Daily bump.

23 months ago[Committed] Avoid FAIL of gcc.target/i386/pr110792.c
Roger Sayle [Sun, 6 Aug 2023 22:19:10 +0000 (23:19 +0100)] 
[Committed] Avoid FAIL of gcc.target/i386/pr110792.c

My apologies (again), I managed to mess up the 64-bit version of the
test case for PR 110792.  Unlike the 32-bit version, the 64-bit case
contains exactly the same load instructions, just in a different order
making the correct and incorrect behaviours impossible to distinguish
with a scan-assembler-not.  Somewhere between checking that this test
failed in a clean tree without the patch, and getting the escaping
correct, I'd failed to notice that this also FAILs in the patched tree.
Doh!  Instead of removing the test completely, I've left it as a
compilation test.

The original fix is tested by the 32-bit test case.

Committed to mainline as obvious.  Sorry for the incovenience.

2023-08-06  Roger Sayle  <roger@nextmovesoftware.com>

gcc/testsuite/ChangeLog
PR target/110792
* gcc.target/i386/pr110792.c: Remove dg-final scan-assembler-not.

23 months agoAdd builtin_expect to predict that CPU supports cpuid to cpuid.h
Jan Hubicka [Sun, 6 Aug 2023 20:53:14 +0000 (22:53 +0200)] 
Add builtin_expect to predict that CPU supports cpuid to cpuid.h

This is needed to avoid impossible threading update in vectorizer testcase,
but should also reflect reality on most CPUs we care about.

gcc/ChangeLog:

* config/i386/cpuid.h (__get_cpuid_count, __get_cpuid_max): Add
__builtin_expect that CPU likely supports cpuid.

23 months agoDisable loop distribution for loops with estimated iterations 0
Jan Hubicka [Sun, 6 Aug 2023 20:33:33 +0000 (22:33 +0200)] 
Disable loop distribution for loops with estimated iterations 0

This prevents useless loop distribiton produced in hmmer.  With FDO we now
correctly work out that the loop created for last iteraiton is not going to
iterate however loop distribution still produces a verioned loop that has no
chance to survive loop vectorizer since we only keep distributed loops
when loop vectorization suceeds and it requires number of (header) iterations
to exceed the vectorization factor.

gcc/ChangeLog:

* tree-loop-distribution.cc (loop_distribution::execute): Disable
distribution for loops with estimated iterations 0.

23 months agoFix profile update after peeled epilogues
Jan Hubicka [Sun, 6 Aug 2023 19:23:31 +0000 (21:23 +0200)] 
Fix profile update after peeled epilogues

Epilogue peeling expects the scalar loop to have same number of executions as
the vector loop which is true at the beggining of vectorization. However if the
epilogues are vectorized, this is no longer the case.  In this situation the
loop preheader is replaced by new guard code with correct profile, however
loop body is left unscaled.  This leads to loop that exists more often then
it is entered.

This patch add slogic to scale the frequencies down and also to fix profile
of original preheader where necesary.

Bootstrapped/regtested x86_64-linux, comitted.

gcc/ChangeLog:

* tree-vect-loop-manip.cc (vect_do_peeling): Fix profile update of peeled epilogues.

gcc/testsuite/ChangeLog:

* gcc.dg/vect/vect-bitfield-read-1.c: Check profile consistency.
* gcc.dg/vect/vect-bitfield-read-2.c: Check profile consistency.
* gcc.dg/vect/vect-bitfield-read-3.c: Check profile consistency.
* gcc.dg/vect/vect-bitfield-read-4.c: Check profile consistency.
* gcc.dg/vect/vect-bitfield-read-5.c: Check profile consistency.
* gcc.dg/vect/vect-bitfield-read-6.c: Check profile consistency.
* gcc.dg/vect/vect-bitfield-read-7.c: Check profile consistency.
* gcc.dg/vect/vect-bitfield-write-1.c: Check profile consistency.
* gcc.dg/vect/vect-bitfield-write-2.c: Check profile consistency.
* gcc.dg/vect/vect-bitfield-write-3.c: Check profile consistency.
* gcc.dg/vect/vect-bitfield-write-4.c: Check profile consistency.
* gcc.dg/vect/vect-bitfield-write-5.c: Check profile consistency.
* gcc.dg/vect/vect-epilogues-2.c: Check profile consistency.
* gcc.dg/vect/vect-epilogues.c: Check profile consistency.
* gcc.dg/vect/vect-mask-store-move-1.c: Check profile consistency.

23 months agolibstdc++: [_GLIBCXX_INLINE_VERSION] Add __cxa_call_terminate symbol export
François Dumont [Sat, 5 Aug 2023 15:18:16 +0000 (17:18 +0200)] 
libstdc++: [_GLIBCXX_INLINE_VERSION] Add __cxa_call_terminate symbol export

libstdc++-v3/ChangeLog:

* config/abi/pre/gnu-versioned-namespace.ver: Add __cxa_call_terminate
symbol export.

23 months agoDaily bump.
GCC Administrator [Sun, 6 Aug 2023 00:16:37 +0000 (00:16 +0000)] 
Daily bump.

23 months agoPR modula2/110779 SysClock can not read the clock
Gaius Mulley [Sat, 5 Aug 2023 16:35:12 +0000 (17:35 +0100)] 
PR modula2/110779 SysClock can not read the clock

This patch completes the implementation of the ISO module
SysClock.mod.  Three new testcases are provided.  wrapclock.{cc,def}
are new support files providing access to clock_settime, clock_gettime
and glibc timezone variables.

gcc/m2/ChangeLog:

PR modula2/110779
* gm2-libs-iso/SysClock.mod: Re-implement using wrapclock.
* gm2-libs-iso/wrapclock.def: New file.

libgm2/ChangeLog:

PR modula2/110779
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac (GM2_CHECK_LIB): Check for clock_gettime
and clock_settime.
* libm2iso/Makefile.am (M2DEFS): Add wrapclock.def.
* libm2iso/Makefile.in: Regenerate.
* libm2iso/wraptime.cc: Replace HAVE_TIMEVAL with
HAVE_STRUCT_TIMEVAL.
* libm2iso/wrapclock.cc: New file.

gcc/testsuite/ChangeLog:

PR modula2/110779
* gm2/iso/run/pass/m2date.mod: New test.
* gm2/iso/run/pass/testclock.mod: New test.
* gm2/iso/run/pass/testclock2.mod: New test.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
23 months agoc: Less warnings for parameters declared as arrays [PR98536]
Martin Uecker [Thu, 13 Apr 2023 17:35:15 +0000 (19:35 +0200)] 
c: Less warnings for parameters declared as arrays [PR98536]

To avoid false positivies, tune the warnings for parameters declared
as arrays with size expressions.  Do not warn when more bounds are
specified in the declaration than before.

PR c/98536

gcc/c-family/:
* c-warn.cc (warn_parm_array_mismatch): Do not warn if more
bounds are specified.

gcc/testsuite:
* gcc.dg/Wvla-parameter-4.c: Adapt test.
* gcc.dg/attr-access-2.c: Adapt test.

23 months agoc: _Generic should not warn in non-active branches [PR68193,PR97100,PR110703]
Martin Uecker [Fri, 4 Aug 2023 05:48:21 +0000 (07:48 +0200)] 
c: _Generic should not warn in non-active branches [PR68193,PR97100,PR110703]

To avoid false diagnostics, use c_inhibit_evaluation_warnings when
a generic association is known to not match during parsing.  We may
still generate false positives if the default branch comes earler than
a specific association that matches.

PR c/68193
PR c/97100
PR c/110703

gcc/c/:
* c-parser.cc (c_parser_generic_selection): Inhibit evaluation
warnings branches that are known not be taken during parsing.

gcc/testsuite/ChangeLog:
* gcc.dg/pr68193.c: New test.

23 months agoDaily bump.
GCC Administrator [Sat, 5 Aug 2023 00:17:11 +0000 (00:17 +0000)] 
Daily bump.

23 months ago[PATCH v3] [RISC-V] Generate Zicond instruction for select pattern with condition...
Xiao Zeng [Fri, 4 Aug 2023 21:23:56 +0000 (17:23 -0400)] 
[PATCH v3] [RISC-V] Generate Zicond instruction for select pattern with condition eq or neq to 0

This patch recognizes Zicond patterns when the select pattern
with condition eq or neq to 0 (using eq as an example), namely:

1 rd = (rs2 == 0) ? non-imm : 0
2 rd = (rs2 == 0) ? non-imm : non-imm
3 rd = (rs2 == 0) ? reg : non-imm
4 rd = (rs2 == 0) ? reg : reg

gcc/ChangeLog:

* config/riscv/riscv.cc (riscv_expand_conditional_move): Recognize
more Zicond patterns.  Fix whitespace typo.
(riscv_rtx_costs): Remove accidental code duplication.

Co-authored-by: Jeff Law <jlaw@ventanamicro.com>
23 months agoanalyzer: handle function attribute "alloc_size" [PR110426]
David Malcolm [Fri, 4 Aug 2023 20:18:40 +0000 (16:18 -0400)] 
analyzer: handle function attribute "alloc_size" [PR110426]

This patch makes -fanalyzer make use of the function attribute
"alloc_size", allowing -fanalyzer to emit -Wanalyzer-allocation-size,
-Wanalyzer-out-of-bounds, and -Wanalyzer-tainted-allocation-size on
execution paths involving allocations using such functions.

gcc/analyzer/ChangeLog:
PR analyzer/110426
* bounds-checking.cc (region_model::check_region_bounds): Handle
symbolic base regions.
* call-details.cc: Include "stringpool.h" and "attribs.h".
(call_details::lookup_function_attribute): New function.
* call-details.h (call_details::lookup_function_attribute): New
function decl.
* region-model-manager.cc
(region_model_manager::maybe_fold_binop): Add reference to
PR analyzer/110902.
* region-model-reachability.cc (reachable_regions::handle_sval):
Add symbolic regions for pointers that are conjured svalues for
the LHS of a stmt.
* region-model.cc (region_model::canonicalize): Purge dynamic
extents for regions that aren't referenced.
(get_result_size_in_bytes): New function.
(region_model::on_call_pre): Use get_result_size_in_bytes and
potentially set the dynamic extents of the region pointed to by
the return value.
(region_model::deref_rvalue): Add param "add_nonnull_constraint"
and use it to conditionalize adding the constraint.
(pending_diagnostic_subclass::dubious_allocation_size): Add "stmt"
param to both ctors and use it to initialize new "m_stmt" field.
(pending_diagnostic_subclass::operator==): Use m_stmt; don't use
m_lhs or m_rhs.
(pending_diagnostic_subclass::m_stmt): New field.
(region_model::check_region_size): Generalize to any kind of
pointer svalue by using deref_rvalue rather than checking for
region_svalue.  Pass stmt to dubious_allocation_size ctor.
* region-model.h (region_model::deref_rvalue): Add param
"add_nonnull_constraint".
* svalue.cc (conjured_svalue::lhs_value_p): New function.
* svalue.h (conjured_svalue::lhs_value_p): New decl.

gcc/testsuite/ChangeLog:
PR analyzer/110426
* gcc.dg/analyzer/allocation-size-1.c: Update expected message to
reflect consolidation of size and assignment into a single event.
* gcc.dg/analyzer/allocation-size-2.c: Likewise.
* gcc.dg/analyzer/allocation-size-3.c: Likewise.
* gcc.dg/analyzer/allocation-size-4.c: Likewise.
* gcc.dg/analyzer/allocation-size-multiline-1.c: Likewise.
* gcc.dg/analyzer/allocation-size-multiline-2.c: Likewise.
* gcc.dg/analyzer/allocation-size-multiline-3.c: Likewise.
* gcc.dg/analyzer/attr-alloc_size-1.c: New test.
* gcc.dg/analyzer/attr-alloc_size-2.c: New test.
* gcc.dg/analyzer/attr-alloc_size-3.c: New test.
* gcc.dg/analyzer/explode-4.c: New test.
* gcc.dg/analyzer/taint-size-1.c: Add test coverage for
__attribute__ alloc_size.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
23 months agoanalyzer: fix some svalue::dump_to_pp implementations
David Malcolm [Fri, 4 Aug 2023 20:17:12 +0000 (16:17 -0400)] 
analyzer: fix some svalue::dump_to_pp implementations

gcc/analyzer/ChangeLog:
* svalue.cc (region_svalue::dump_to_pp): Support NULL type.
(constant_svalue::dump_to_pp): Likewise.
(initial_svalue::dump_to_pp): Likewise.
(conjured_svalue::dump_to_pp): Likewise.  Fix missing print of the
type.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
23 months agoi386: eliminate redundant operands of VPTERNLOG
Yan Simonaytes [Tue, 25 Jul 2023 17:43:19 +0000 (20:43 +0300)] 
i386: eliminate redundant operands of VPTERNLOG

As mentioned in PR 110202, GCC may be presented with input where control
word of the VPTERNLOG intrinsic implies that some of its operands do not
affect the result.  In that case, we can eliminate redundant operands
of the instruction by substituting any other operand in their place.
This removes false dependencies.

For instance, instead of (252 = 0xfc = _MM_TERNLOG_A | _MM_TERNLOG_B)

vpternlogq $252, %zmm2, %zmm1, %zmm0

emit

vpternlogq $252, %zmm0, %zmm1, %zmm0

When VPTERNLOG is invariant w.r.t first and second operands, and the
third operand is memory, load memory into the output operand first, i.e.
instead of (85 = 0x55 = ~_MM_TERNLOG_C)

vpternlogq $85, (%rdi), %zmm1, %zmm0

emit

vmovdqa64 (%rdi), %zmm0
vpternlogq $85, %zmm0, %zmm0, %zmm0

gcc/ChangeLog:

PR target/110202
* config/i386/i386-protos.h
(vpternlog_redundant_operand_mask): Declare.
(substitute_vpternlog_operands): Declare.
* config/i386/i386.cc
(vpternlog_redundant_operand_mask): New helper.
(substitute_vpternlog_operands): New function.  Use them...
* config/i386/sse.md: ... here in new VPTERNLOG define_splits.

gcc/testsuite/ChangeLog:

PR target/110202
* gcc.target/i386/invariant-ternlog-1.c: New test.
* gcc.target/i386/invariant-ternlog-2.c: New test.

23 months agoSpecify signed/unsigned/dontcare in calls to extract_bit_field_1.
Roger Sayle [Fri, 4 Aug 2023 15:26:06 +0000 (16:26 +0100)] 
Specify signed/unsigned/dontcare in calls to extract_bit_field_1.

This patch is inspired by Jakub's work on PR rtl-optimization/110717.
The bitfield example described in comment #2, looks like:

struct S { __int128 a : 69; };
unsigned type bar (struct S *p) {
  return p->a;
}

which on x86_64 with -O2 currently generates:

bar:    movzbl  8(%rdi), %ecx
        movq    (%rdi), %rax
        andl    $31, %ecx
        movq    %rcx, %rdx
        salq    $59, %rdx
        sarq    $59, %rdx
        ret

The ANDL $31 is interesting... we first extract an unsigned 69-bit bitfield
by masking/clearing the top bits of the most significant word, and then
it gets sign-extended, by left shifting and arithmetic right shifting.
Obviously, this bit-wise AND is redundant, for signed bit-fields, we don't
require these bits to be cleared, if we're about to set them appropriately.

This patch eliminates this redundancy in the middle-end, during RTL
expansion, but extending the extract_bit_field APIs so that the integer
UNSIGNEDP argument takes a special value; 0 indicates the field should
be sign extended, 1 (any non-zero value) indicates the field should be
zero extended, but -1 indicates a third option, that we don't care how
or whether the field is extended.  By passing and checking this sentinel
value at the appropriate places we avoid the useless bit masking (on
all targets).

For the test case above, with this patch we now generate:

bar:    movzbl  8(%rdi), %ecx
        movq    (%rdi), %rax
        movq    %rcx, %rdx
        salq    $59, %rdx
        sarq    $59, %rdx
        ret

2023-08-04  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
* expmed.cc (extract_bit_field_1): Document that an UNSIGNEDP
value of -1 is equivalent to don't care.
(extract_integral_bit_field): Indicate that we don't require
the most significant word to be zero extended, if we're about
to sign extend it.
(extract_fixed_bit_field_1): Document that an UNSIGNEDP value
of -1 is equivalent to don't care.  Don't clear the most
significant bits with AND mask when UNSIGNEDP is -1.

gcc/testsuite/ChangeLog
* gcc.target/i386/pr110717-2.c: New test case.

23 months agoi386: Split SUBREGs of SSE vector registers into vec_select insns.
Roger Sayle [Fri, 4 Aug 2023 15:23:38 +0000 (16:23 +0100)] 
i386: Split SUBREGs of SSE vector registers into vec_select insns.

This patch is the final piece in the series to improve the ABI issues
affecting PR 88873.  The previous patches tackled inserting DFmode
values into V2DFmode registers, by introducing insvti_{low,high}part
patterns.  This patch improves the extraction of DFmode values from
V2DFmode registers via TImode intermediates.

I'd initially thought this would require new extvti_{low,high}part
patterns to be defined, but all that's required is to recognize that
the SUBREG idioms produced by combine are equivalent to (forms of)
vec_select patterns.  The target-independent middle-end can't be sure
that the appropriate vec_select instruction exists on the target,
hence doesn't canonicalize a SUBREG of a vector mode as a vec_select,
but the backend can provide a define_split stating where and when
this is useful, for example, considering whether the operand is in
memory, or whether !TARGET_SSE_MATH and the destination is i387.

For pr88873.c, gcc -O2 -march=cascadelake currently generates:

foo:    vpunpcklqdq     %xmm3, %xmm2, %xmm7
        vpunpcklqdq     %xmm1, %xmm0, %xmm6
        vpunpcklqdq     %xmm5, %xmm4, %xmm2
        vmovdqa %xmm7, -24(%rsp)
        vmovdqa %xmm6, %xmm1
        movq    -16(%rsp), %rax
        vpinsrq $1, %rax, %xmm7, %xmm4
        vmovapd %xmm4, %xmm6
        vfmadd132pd     %xmm1, %xmm2, %xmm6
        vmovapd %xmm6, -24(%rsp)
        vmovsd  -16(%rsp), %xmm1
        vmovsd  -24(%rsp), %xmm0
        ret

with this patch, we now generate:

foo: vpunpcklqdq     %xmm1, %xmm0, %xmm6
        vpunpcklqdq     %xmm3, %xmm2, %xmm7
        vpunpcklqdq     %xmm5, %xmm4, %xmm2
        vmovdqa %xmm6, %xmm1
        vfmadd132pd     %xmm7, %xmm2, %xmm1
        vmovsd  %xmm1, %xmm1, %xmm0
        vunpckhpd       %xmm1, %xmm1, %xmm1
        ret

The improvement is even more dramatic when compared to the original
29 instructions shown in comment #8.  GCC 13, for example, required
12 transfers to/from memory.

2023-08-04  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
* config/i386/sse.md (define_split): Convert highpart:DF extract
from V2DFmode register into a sse2_storehpd instruction.
(define_split): Likewise, convert lowpart:DF extract from V2DF
register into a sse2_storelpd instruction.

gcc/testsuite/ChangeLog
* gcc.target/i386/pr88873.c: Tweak to check for improved code.

23 months agoAdd documentation for -Wflex-array-member-not-at-end.
Qing Zhao [Fri, 4 Aug 2023 14:24:32 +0000 (14:24 +0000)] 
Add documentation for -Wflex-array-member-not-at-end.

'-Wflex-array-member-not-at-end (C and C++ only)'
     Warn when a structure containing a C99 flexible array member as the
     last field is not at the end of another structure.  This warning
     warns e.g.  about

          struct flex  { int length; char data[]; };
          struct mid_flex { int m; struct flex flex_data; int n; };

gcc/ChangeLog:

* doc/invoke.texi (-Wflex-array-member-not-at-end): Document
new option.

23 months agoLRA: Check input insn pattern hard regs against early clobber hard regs for live...
Vladimir N. Makarov [Fri, 4 Aug 2023 12:04:44 +0000 (08:04 -0400)] 
LRA: Check input insn pattern hard regs against early clobber hard regs for live info

For the test case LRA generates wrong code for AVR cpymem_qi insn:

(insn 16 15 17 3 (parallel [
            (set (mem:BLK (reg:HI 26 r26) [0  A8])
                (mem:BLK (reg:HI 30 r30) [0  A8]))
            (unspec [
                    (const_int 0 [0])
                ] UNSPEC_CPYMEM)
            (use (reg:QI 52))
            (clobber (reg:HI 26 r26))
            (clobber (reg:HI 30 r30))
            (clobber (reg:QI 0 r0))
            (clobber (reg:QI 52))
        ]) "t.c":16:22 132 {cpymem_qi}

The insn gets the same value in r26 and r30.  The culprit is clobbering
r30 and using r30 as input.  For such situation LRA wrongly assumes that
r30 does not live before the insn.  The patch is fixing it.

gcc/ChangeLog:

* lra-lives.cc (process_bb_lives): Check input insn pattern hard regs
against early clobber hard regs.

gcc/testsuite/ChangeLog:

* gcc.target/avr/lra-cpymem_qi.c: New.

23 months agomiddle-end: clean up vect testsuite using pragma novector
Tamar Christina [Fri, 4 Aug 2023 12:52:46 +0000 (13:52 +0100)] 
middle-end: clean up vect testsuite using pragma novector

The support for early break vectorization breaks lots of scan vect and slp
testcases because they assume that loops with abort () in them cannot be
vectorized.  Additionally it breaks the point of having a scalar loop to check
the output of the vectorizer if that loop is also vectorized.

For that reason this adds

vectorized using this patch series.

FWIW, none of these tests were failing to vectorize or run before the pragma.
The tests that did point to some issues were copies to the early break test
suit as well.

gcc/testsuite/ChangeLog:

* g++.dg/vect/pr84556.cc: Add novector pragma.
* g++.dg/vect/simd-1.cc: Add novector pragma.
* g++.dg/vect/simd-2.cc: Add novector pragma.
* g++.dg/vect/simd-3.cc: Add novector pragma.
* g++.dg/vect/simd-4.cc: Add novector pragma.
* g++.dg/vect/simd-5.cc: Add novector pragma.
* g++.dg/vect/simd-6.cc: Add novector pragma.
* g++.dg/vect/simd-7.cc: Add novector pragma.
* g++.dg/vect/simd-8.cc: Add novector pragma.
* g++.dg/vect/simd-9.cc: Add novector pragma.
* g++.dg/vect/simd-clone-6.cc: Add novector pragma.
* gcc.dg/vect/O3-pr70130.c: Add novector pragma.
* gcc.dg/vect/Os-vect-95.c: Add novector pragma.
* gcc.dg/vect/bb-slp-1.c: Add novector pragma.
* gcc.dg/vect/bb-slp-16.c: Add novector pragma.
* gcc.dg/vect/bb-slp-2.c: Add novector pragma.
* gcc.dg/vect/bb-slp-24.c: Add novector pragma.
* gcc.dg/vect/bb-slp-25.c: Add novector pragma.
* gcc.dg/vect/bb-slp-26.c: Add novector pragma.
* gcc.dg/vect/bb-slp-27.c: Add novector pragma.
* gcc.dg/vect/bb-slp-28.c: Add novector pragma.
* gcc.dg/vect/bb-slp-29.c: Add novector pragma.
* gcc.dg/vect/bb-slp-42.c: Add novector pragma.
* gcc.dg/vect/bb-slp-cond-1.c: Add novector pragma.
* gcc.dg/vect/bb-slp-over-widen-1.c: Add novector pragma.
* gcc.dg/vect/bb-slp-over-widen-2.c: Add novector pragma.
* gcc.dg/vect/bb-slp-pattern-1.c: Add novector pragma.
* gcc.dg/vect/bb-slp-pattern-2.c: Add novector pragma.
* gcc.dg/vect/bb-slp-pow-1.c: Add novector pragma.
* gcc.dg/vect/bb-slp-pr101615-2.c: Add novector pragma.
* gcc.dg/vect/bb-slp-pr65935.c: Add novector pragma.
* gcc.dg/vect/bb-slp-subgroups-1.c: Add novector pragma.
* gcc.dg/vect/costmodel/i386/costmodel-vect-31.c: Add novector pragma.
* gcc.dg/vect/costmodel/i386/costmodel-vect-33.c: Add novector pragma.
* gcc.dg/vect/costmodel/i386/costmodel-vect-68.c: Add novector pragma.
* gcc.dg/vect/costmodel/ppc/costmodel-slp-12.c: Add novector pragma.
* gcc.dg/vect/costmodel/ppc/costmodel-slp-33.c: Add novector pragma.
* gcc.dg/vect/costmodel/ppc/costmodel-slp-34.c: Add novector pragma.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-31a.c: Add novector pragma.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-31b.c: Add novector pragma.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-31c.c: Add novector pragma.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-33.c: Add novector pragma.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-68a.c: Add novector pragma.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-68b.c: Add novector pragma.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-68c.c: Add novector pragma.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-76a.c: Add novector pragma.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c: Add novector pragma.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-76c.c: Add novector pragma.
* gcc.dg/vect/costmodel/ppc/costmodel-vect-outer-fir.c: Add novector pragma.
* gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c: Add novector pragma.
* gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c: Add novector pragma.
* gcc.dg/vect/costmodel/x86_64/costmodel-vect-68.c: Add novector pragma.
* gcc.dg/vect/fast-math-bb-slp-call-1.c: Add novector pragma.
* gcc.dg/vect/fast-math-bb-slp-call-2.c: Add novector pragma.
* gcc.dg/vect/fast-math-vect-call-1.c: Add novector pragma.
* gcc.dg/vect/fast-math-vect-call-2.c: Add novector pragma.
* gcc.dg/vect/fast-math-vect-complex-3.c: Add novector pragma.
* gcc.dg/vect/if-cvt-stores-vect-ifcvt-18.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-noreassoc-outer-1.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-noreassoc-outer-2.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-noreassoc-outer-3.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-noreassoc-outer-5.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-10.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-10a.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-10b.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-11.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-12.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-15.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-16.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-17.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-18.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-19.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-20.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-21.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-22.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-3.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-4.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-5.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-6-global.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-6.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-7.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-8.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-9.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-9a.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-outer-9b.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-slp-30.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-slp-31.c: Add novector pragma.
* gcc.dg/vect/no-scevccp-vect-iv-2.c: Add novector pragma.
* gcc.dg/vect/no-section-anchors-vect-31.c: Add novector pragma.
* gcc.dg/vect/no-section-anchors-vect-34.c: Add novector pragma.
* gcc.dg/vect/no-section-anchors-vect-36.c: Add novector pragma.
* gcc.dg/vect/no-section-anchors-vect-64.c: Add novector pragma.
* gcc.dg/vect/no-section-anchors-vect-65.c: Add novector pragma.
* gcc.dg/vect/no-section-anchors-vect-66.c: Add novector pragma.
* gcc.dg/vect/no-section-anchors-vect-68.c: Add novector pragma.
* gcc.dg/vect/no-section-anchors-vect-69.c: Add novector pragma.
* gcc.dg/vect/no-section-anchors-vect-outer-4h.c: Add novector pragma.
* gcc.dg/vect/no-trapping-math-2.c: Add novector pragma.
* gcc.dg/vect/no-trapping-math-vect-111.c: Add novector pragma.
* gcc.dg/vect/no-trapping-math-vect-ifcvt-11.c: Add novector pragma.
* gcc.dg/vect/no-trapping-math-vect-ifcvt-12.c: Add novector pragma.
* gcc.dg/vect/no-trapping-math-vect-ifcvt-13.c: Add novector pragma.
* gcc.dg/vect/no-trapping-math-vect-ifcvt-14.c: Add novector pragma.
* gcc.dg/vect/no-trapping-math-vect-ifcvt-15.c: Add novector pragma.
* gcc.dg/vect/no-tree-dom-vect-bug.c: Add novector pragma.
* gcc.dg/vect/no-tree-pre-slp-29.c: Add novector pragma.
* gcc.dg/vect/no-vfa-pr29145.c: Add novector pragma.
* gcc.dg/vect/no-vfa-vect-101.c: Add novector pragma.
* gcc.dg/vect/no-vfa-vect-102.c: Add novector pragma.
* gcc.dg/vect/no-vfa-vect-102a.c: Add novector pragma.
* gcc.dg/vect/no-vfa-vect-37.c: Add novector pragma.
* gcc.dg/vect/no-vfa-vect-43.c: Add novector pragma.
* gcc.dg/vect/no-vfa-vect-45.c: Add novector pragma.
* gcc.dg/vect/no-vfa-vect-49.c: Add novector pragma.
* gcc.dg/vect/no-vfa-vect-51.c: Add novector pragma.
* gcc.dg/vect/no-vfa-vect-53.c: Add novector pragma.
* gcc.dg/vect/no-vfa-vect-57.c: Add novector pragma.
* gcc.dg/vect/no-vfa-vect-61.c: Add novector pragma.
* gcc.dg/vect/no-vfa-vect-79.c: Add novector pragma.
* gcc.dg/vect/no-vfa-vect-depend-1.c: Add novector pragma.
* gcc.dg/vect/no-vfa-vect-depend-2.c: Add novector pragma.
* gcc.dg/vect/no-vfa-vect-depend-3.c: Add novector pragma.
* gcc.dg/vect/no-vfa-vect-dv-2.c: Add novector pragma.
* gcc.dg/vect/pr101445.c: Add novector pragma.
* gcc.dg/vect/pr103581.c: Add novector pragma.
* gcc.dg/vect/pr105219.c: Add novector pragma.
* gcc.dg/vect/pr108608.c: Add novector pragma.
* gcc.dg/vect/pr18400.c: Add novector pragma.
* gcc.dg/vect/pr18536.c: Add novector pragma.
* gcc.dg/vect/pr20122.c: Add novector pragma.
* gcc.dg/vect/pr25413.c: Add novector pragma.
* gcc.dg/vect/pr30784.c: Add novector pragma.
* gcc.dg/vect/pr37539.c: Add novector pragma.
* gcc.dg/vect/pr40074.c: Add novector pragma.
* gcc.dg/vect/pr45752.c: Add novector pragma.
* gcc.dg/vect/pr45902.c: Add novector pragma.
* gcc.dg/vect/pr46009.c: Add novector pragma.
* gcc.dg/vect/pr48172.c: Add novector pragma.
* gcc.dg/vect/pr51074.c: Add novector pragma.
* gcc.dg/vect/pr51581-3.c: Add novector pragma.
* gcc.dg/vect/pr51581-4.c: Add novector pragma.
* gcc.dg/vect/pr53185-2.c: Add novector pragma.
* gcc.dg/vect/pr56918.c: Add novector pragma.
* gcc.dg/vect/pr56920.c: Add novector pragma.
* gcc.dg/vect/pr56933.c: Add novector pragma.
* gcc.dg/vect/pr57705.c: Add novector pragma.
* gcc.dg/vect/pr57741-2.c: Add novector pragma.
* gcc.dg/vect/pr57741-3.c: Add novector pragma.
* gcc.dg/vect/pr59591-1.c: Add novector pragma.
* gcc.dg/vect/pr59591-2.c: Add novector pragma.
* gcc.dg/vect/pr59594.c: Add novector pragma.
* gcc.dg/vect/pr59984.c: Add novector pragma.
* gcc.dg/vect/pr60276.c: Add novector pragma.
* gcc.dg/vect/pr61194.c: Add novector pragma.
* gcc.dg/vect/pr61680.c: Add novector pragma.
* gcc.dg/vect/pr62021.c: Add novector pragma.
* gcc.dg/vect/pr63341-2.c: Add novector pragma.
* gcc.dg/vect/pr64252.c: Add novector pragma.
* gcc.dg/vect/pr64404.c: Add novector pragma.
* gcc.dg/vect/pr64421.c: Add novector pragma.
* gcc.dg/vect/pr64493.c: Add novector pragma.
* gcc.dg/vect/pr64495.c: Add novector pragma.
* gcc.dg/vect/pr66251.c: Add novector pragma.
* gcc.dg/vect/pr66253.c: Add novector pragma.
* gcc.dg/vect/pr68502-1.c: Add novector pragma.
* gcc.dg/vect/pr68502-2.c: Add novector pragma.
* gcc.dg/vect/pr69820.c: Add novector pragma.
* gcc.dg/vect/pr70021.c: Add novector pragma.
* gcc.dg/vect/pr70354-1.c: Add novector pragma.
* gcc.dg/vect/pr70354-2.c: Add novector pragma.
* gcc.dg/vect/pr71259.c: Add novector pragma.
* gcc.dg/vect/pr78005.c: Add novector pragma.
* gcc.dg/vect/pr78558.c: Add novector pragma.
* gcc.dg/vect/pr80815-2.c: Add novector pragma.
* gcc.dg/vect/pr80815-3.c: Add novector pragma.
* gcc.dg/vect/pr80928.c: Add novector pragma.
* gcc.dg/vect/pr81410.c: Add novector pragma.
* gcc.dg/vect/pr81633.c: Add novector pragma.
* gcc.dg/vect/pr81740-1.c: Add novector pragma.
* gcc.dg/vect/pr81740-2.c: Add novector pragma.
* gcc.dg/vect/pr85586.c: Add novector pragma.
* gcc.dg/vect/pr87288-1.c: Add novector pragma.
* gcc.dg/vect/pr87288-2.c: Add novector pragma.
* gcc.dg/vect/pr87288-3.c: Add novector pragma.
* gcc.dg/vect/pr88903-1.c: Add novector pragma.
* gcc.dg/vect/pr88903-2.c: Add novector pragma.
* gcc.dg/vect/pr90018.c: Add novector pragma.
* gcc.dg/vect/pr92420.c: Add novector pragma.
* gcc.dg/vect/pr94994.c: Add novector pragma.
* gcc.dg/vect/pr96783-1.c: Add novector pragma.
* gcc.dg/vect/pr96783-2.c: Add novector pragma.
* gcc.dg/vect/pr97081-2.c: Add novector pragma.
* gcc.dg/vect/pr97558-2.c: Add novector pragma.
* gcc.dg/vect/pr97678.c: Add novector pragma.
* gcc.dg/vect/section-anchors-pr27770.c: Add novector pragma.
* gcc.dg/vect/section-anchors-vect-69.c: Add novector pragma.
* gcc.dg/vect/slp-1.c: Add novector pragma.
* gcc.dg/vect/slp-10.c: Add novector pragma.
* gcc.dg/vect/slp-11a.c: Add novector pragma.
* gcc.dg/vect/slp-11b.c: Add novector pragma.
* gcc.dg/vect/slp-11c.c: Add novector pragma.
* gcc.dg/vect/slp-12a.c: Add novector pragma.
* gcc.dg/vect/slp-12b.c: Add novector pragma.
* gcc.dg/vect/slp-12c.c: Add novector pragma.
* gcc.dg/vect/slp-13-big-array.c: Add novector pragma.
* gcc.dg/vect/slp-13.c: Add novector pragma.
* gcc.dg/vect/slp-14.c: Add novector pragma.
* gcc.dg/vect/slp-15.c: Add novector pragma.
* gcc.dg/vect/slp-16.c: Add novector pragma.
* gcc.dg/vect/slp-17.c: Add novector pragma.
* gcc.dg/vect/slp-18.c: Add novector pragma.
* gcc.dg/vect/slp-19a.c: Add novector pragma.
* gcc.dg/vect/slp-19b.c: Add novector pragma.
* gcc.dg/vect/slp-19c.c: Add novector pragma.
* gcc.dg/vect/slp-2.c: Add novector pragma.
* gcc.dg/vect/slp-20.c: Add novector pragma.
* gcc.dg/vect/slp-21.c: Add novector pragma.
* gcc.dg/vect/slp-22.c: Add novector pragma.
* gcc.dg/vect/slp-23.c: Add novector pragma.
* gcc.dg/vect/slp-24-big-array.c: Add novector pragma.
* gcc.dg/vect/slp-24.c: Add novector pragma.
* gcc.dg/vect/slp-25.c: Add novector pragma.
* gcc.dg/vect/slp-26.c: Add novector pragma.
* gcc.dg/vect/slp-28.c: Add novector pragma.
* gcc.dg/vect/slp-3-big-array.c: Add novector pragma.
* gcc.dg/vect/slp-3.c: Add novector pragma.
* gcc.dg/vect/slp-33.c: Add novector pragma.
* gcc.dg/vect/slp-34-big-array.c: Add novector pragma.
* gcc.dg/vect/slp-34.c: Add novector pragma.
* gcc.dg/vect/slp-35.c: Add novector pragma.
* gcc.dg/vect/slp-37.c: Add novector pragma.
* gcc.dg/vect/slp-4-big-array.c: Add novector pragma.
* gcc.dg/vect/slp-4.c: Add novector pragma.
* gcc.dg/vect/slp-41.c: Add novector pragma.
* gcc.dg/vect/slp-43.c: Add novector pragma.
* gcc.dg/vect/slp-45.c: Add novector pragma.
* gcc.dg/vect/slp-46.c: Add novector pragma.
* gcc.dg/vect/slp-47.c: Add novector pragma.
* gcc.dg/vect/slp-48.c: Add novector pragma.
* gcc.dg/vect/slp-49.c: Add novector pragma.
* gcc.dg/vect/slp-5.c: Add novector pragma.
* gcc.dg/vect/slp-6.c: Add novector pragma.
* gcc.dg/vect/slp-7.c: Add novector pragma.
* gcc.dg/vect/slp-8.c: Add novector pragma.
* gcc.dg/vect/slp-9.c: Add novector pragma.
* gcc.dg/vect/slp-cond-1.c: Add novector pragma.
* gcc.dg/vect/slp-cond-2-big-array.c: Add novector pragma.
* gcc.dg/vect/slp-cond-2.c: Add novector pragma.
* gcc.dg/vect/slp-cond-3.c: Add novector pragma.
* gcc.dg/vect/slp-cond-4.c: Add novector pragma.
* gcc.dg/vect/slp-cond-5.c: Add novector pragma.
* gcc.dg/vect/slp-multitypes-1.c: Add novector pragma.
* gcc.dg/vect/slp-multitypes-10.c: Add novector pragma.
* gcc.dg/vect/slp-multitypes-11-big-array.c: Add novector pragma.
* gcc.dg/vect/slp-multitypes-11.c: Add novector pragma.
* gcc.dg/vect/slp-multitypes-12.c: Add novector pragma.
* gcc.dg/vect/slp-multitypes-2.c: Add novector pragma.
* gcc.dg/vect/slp-multitypes-3.c: Add novector pragma.
* gcc.dg/vect/slp-multitypes-4.c: Add novector pragma.
* gcc.dg/vect/slp-multitypes-5.c: Add novector pragma.
* gcc.dg/vect/slp-multitypes-6.c: Add novector pragma.
* gcc.dg/vect/slp-multitypes-7.c: Add novector pragma.
* gcc.dg/vect/slp-multitypes-8.c: Add novector pragma.
* gcc.dg/vect/slp-multitypes-9.c: Add novector pragma.
* gcc.dg/vect/slp-perm-1.c: Add novector pragma.
* gcc.dg/vect/slp-perm-10.c: Add novector pragma.
* gcc.dg/vect/slp-perm-11.c: Add novector pragma.
* gcc.dg/vect/slp-perm-12.c: Add novector pragma.
* gcc.dg/vect/slp-perm-2.c: Add novector pragma.
* gcc.dg/vect/slp-perm-3.c: Add novector pragma.
* gcc.dg/vect/slp-perm-4.c: Add novector pragma.
* gcc.dg/vect/slp-perm-5.c: Add novector pragma.
* gcc.dg/vect/slp-perm-6.c: Add novector pragma.
* gcc.dg/vect/slp-perm-7.c: Add novector pragma.
* gcc.dg/vect/slp-perm-8.c: Add novector pragma.
* gcc.dg/vect/slp-perm-9.c: Add novector pragma.
* gcc.dg/vect/slp-widen-mult-half.c: Add novector pragma.
* gcc.dg/vect/slp-widen-mult-s16.c: Add novector pragma.
* gcc.dg/vect/slp-widen-mult-u8.c: Add novector pragma.
* gcc.dg/vect/vect-100.c: Add novector pragma.
* gcc.dg/vect/vect-103.c: Add novector pragma.
* gcc.dg/vect/vect-104.c: Add novector pragma.
* gcc.dg/vect/vect-105-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-105.c: Add novector pragma.
* gcc.dg/vect/vect-106.c: Add novector pragma.
* gcc.dg/vect/vect-107.c: Add novector pragma.
* gcc.dg/vect/vect-108.c: Add novector pragma.
* gcc.dg/vect/vect-109.c: Add novector pragma.
* gcc.dg/vect/vect-11.c: Add novector pragma.
* gcc.dg/vect/vect-110.c: Add novector pragma.
* gcc.dg/vect/vect-113.c: Add novector pragma.
* gcc.dg/vect/vect-114.c: Add novector pragma.
* gcc.dg/vect/vect-115.c: Add novector pragma.
* gcc.dg/vect/vect-116.c: Add novector pragma.
* gcc.dg/vect/vect-117.c: Add novector pragma.
* gcc.dg/vect/vect-11a.c: Add novector pragma.
* gcc.dg/vect/vect-12.c: Add novector pragma.
* gcc.dg/vect/vect-122.c: Add novector pragma.
* gcc.dg/vect/vect-124.c: Add novector pragma.
* gcc.dg/vect/vect-13.c: Add novector pragma.
* gcc.dg/vect/vect-14.c: Add novector pragma.
* gcc.dg/vect/vect-15-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-15.c: Add novector pragma.
* gcc.dg/vect/vect-17.c: Add novector pragma.
* gcc.dg/vect/vect-18.c: Add novector pragma.
* gcc.dg/vect/vect-19.c: Add novector pragma.
* gcc.dg/vect/vect-2-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-2.c: Add novector pragma.
* gcc.dg/vect/vect-20.c: Add novector pragma.
* gcc.dg/vect/vect-21.c: Add novector pragma.
* gcc.dg/vect/vect-22.c: Add novector pragma.
* gcc.dg/vect/vect-23.c: Add novector pragma.
* gcc.dg/vect/vect-24.c: Add novector pragma.
* gcc.dg/vect/vect-25.c: Add novector pragma.
* gcc.dg/vect/vect-26.c: Add novector pragma.
* gcc.dg/vect/vect-27.c: Add novector pragma.
* gcc.dg/vect/vect-28.c: Add novector pragma.
* gcc.dg/vect/vect-29.c: Add novector pragma.
* gcc.dg/vect/vect-3.c: Add novector pragma.
* gcc.dg/vect/vect-30.c: Add novector pragma.
* gcc.dg/vect/vect-31-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-31.c: Add novector pragma.
* gcc.dg/vect/vect-32-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-32.c: Add novector pragma.
* gcc.dg/vect/vect-33-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-33.c: Add novector pragma.
* gcc.dg/vect/vect-34-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-34.c: Add novector pragma.
* gcc.dg/vect/vect-35-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-35.c: Add novector pragma.
* gcc.dg/vect/vect-36-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-36.c: Add novector pragma.
* gcc.dg/vect/vect-38.c: Add novector pragma.
* gcc.dg/vect/vect-4.c: Add novector pragma.
* gcc.dg/vect/vect-40.c: Add novector pragma.
* gcc.dg/vect/vect-42.c: Add novector pragma.
* gcc.dg/vect/vect-44.c: Add novector pragma.
* gcc.dg/vect/vect-46.c: Add novector pragma.
* gcc.dg/vect/vect-48.c: Add novector pragma.
* gcc.dg/vect/vect-5.c: Add novector pragma.
* gcc.dg/vect/vect-50.c: Add novector pragma.
* gcc.dg/vect/vect-52.c: Add novector pragma.
* gcc.dg/vect/vect-54.c: Add novector pragma.
* gcc.dg/vect/vect-56.c: Add novector pragma.
* gcc.dg/vect/vect-58.c: Add novector pragma.
* gcc.dg/vect/vect-6-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-6.c: Add novector pragma.
* gcc.dg/vect/vect-60.c: Add novector pragma.
* gcc.dg/vect/vect-62.c: Add novector pragma.
* gcc.dg/vect/vect-63.c: Add novector pragma.
* gcc.dg/vect/vect-64.c: Add novector pragma.
* gcc.dg/vect/vect-65.c: Add novector pragma.
* gcc.dg/vect/vect-66.c: Add novector pragma.
* gcc.dg/vect/vect-67.c: Add novector pragma.
* gcc.dg/vect/vect-68.c: Add novector pragma.
* gcc.dg/vect/vect-7.c: Add novector pragma.
* gcc.dg/vect/vect-70.c: Add novector pragma.
* gcc.dg/vect/vect-71.c: Add novector pragma.
* gcc.dg/vect/vect-72.c: Add novector pragma.
* gcc.dg/vect/vect-73-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-73.c: Add novector pragma.
* gcc.dg/vect/vect-74-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-74.c: Add novector pragma.
* gcc.dg/vect/vect-75-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-75.c: Add novector pragma.
* gcc.dg/vect/vect-76-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-76.c: Add novector pragma.
* gcc.dg/vect/vect-77-alignchecks.c: Add novector pragma.
* gcc.dg/vect/vect-77-global.c: Add novector pragma.
* gcc.dg/vect/vect-77.c: Add novector pragma.
* gcc.dg/vect/vect-78-alignchecks.c: Add novector pragma.
* gcc.dg/vect/vect-78-global.c: Add novector pragma.
* gcc.dg/vect/vect-78.c: Add novector pragma.
* gcc.dg/vect/vect-8.c: Add novector pragma.
* gcc.dg/vect/vect-80-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-80.c: Add novector pragma.
* gcc.dg/vect/vect-82.c: Add novector pragma.
* gcc.dg/vect/vect-82_64.c: Add novector pragma.
* gcc.dg/vect/vect-83.c: Add novector pragma.
* gcc.dg/vect/vect-83_64.c: Add novector pragma.
* gcc.dg/vect/vect-85-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-85.c: Add novector pragma.
* gcc.dg/vect/vect-86.c: Add novector pragma.
* gcc.dg/vect/vect-87.c: Add novector pragma.
* gcc.dg/vect/vect-88.c: Add novector pragma.
* gcc.dg/vect/vect-89-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-89.c: Add novector pragma.
* gcc.dg/vect/vect-9.c: Add novector pragma.
* gcc.dg/vect/vect-92.c: Add novector pragma.
* gcc.dg/vect/vect-93.c: Add novector pragma.
* gcc.dg/vect/vect-95.c: Add novector pragma.
* gcc.dg/vect/vect-96.c: Add novector pragma.
* gcc.dg/vect/vect-97-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-97.c: Add novector pragma.
* gcc.dg/vect/vect-98-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-98.c: Add novector pragma.
* gcc.dg/vect/vect-99.c: Add novector pragma.
* gcc.dg/vect/vect-alias-check-10.c: Add novector pragma.
* gcc.dg/vect/vect-alias-check-11.c: Add novector pragma.
* gcc.dg/vect/vect-alias-check-12.c: Add novector pragma.
* gcc.dg/vect/vect-alias-check-14.c: Add novector pragma.
* gcc.dg/vect/vect-alias-check-15.c: Add novector pragma.
* gcc.dg/vect/vect-alias-check-16.c: Add novector pragma.
* gcc.dg/vect/vect-alias-check-18.c: Add novector pragma.
* gcc.dg/vect/vect-alias-check-19.c: Add novector pragma.
* gcc.dg/vect/vect-alias-check-20.c: Add novector pragma.
* gcc.dg/vect/vect-alias-check-8.c: Add novector pragma.
* gcc.dg/vect/vect-alias-check-9.c: Add novector pragma.
* gcc.dg/vect/vect-align-1.c: Add novector pragma.
* gcc.dg/vect/vect-align-2.c: Add novector pragma.
* gcc.dg/vect/vect-all-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-all.c: Add novector pragma.
* gcc.dg/vect/vect-avg-1.c: Add novector pragma.
* gcc.dg/vect/vect-avg-11.c: Add novector pragma.
* gcc.dg/vect/vect-avg-15.c: Add novector pragma.
* gcc.dg/vect/vect-avg-16.c: Add novector pragma.
* gcc.dg/vect/vect-avg-5.c: Add novector pragma.
* gcc.dg/vect/vect-bitfield-write-1.c: Add novector pragma.
* gcc.dg/vect/vect-bitfield-write-2.c: Add novector pragma.
* gcc.dg/vect/vect-bitfield-write-3.c: Add novector pragma.
* gcc.dg/vect/vect-bitfield-write-4.c: Add novector pragma.
* gcc.dg/vect/vect-bitfield-write-5.c: Add novector pragma.
* gcc.dg/vect/vect-bool-cmp.c: Add novector pragma.
* gcc.dg/vect/vect-bswap16.c: Add novector pragma.
* gcc.dg/vect/vect-bswap32.c: Add novector pragma.
* gcc.dg/vect/vect-bswap64.c: Add novector pragma.
* gcc.dg/vect/vect-complex-1.c: Add novector pragma.
* gcc.dg/vect/vect-complex-2.c: Add novector pragma.
* gcc.dg/vect/vect-complex-4.c: Add novector pragma.
* gcc.dg/vect/vect-cond-1.c: Add novector pragma.
* gcc.dg/vect/vect-cond-10.c: Add novector pragma.
* gcc.dg/vect/vect-cond-11.c: Add novector pragma.
* gcc.dg/vect/vect-cond-3.c: Add novector pragma.
* gcc.dg/vect/vect-cond-4.c: Add novector pragma.
* gcc.dg/vect/vect-cond-5.c: Add novector pragma.
* gcc.dg/vect/vect-cond-6.c: Add novector pragma.
* gcc.dg/vect/vect-cond-7.c: Add novector pragma.
* gcc.dg/vect/vect-cond-8.c: Add novector pragma.
* gcc.dg/vect/vect-cond-9.c: Add novector pragma.
* gcc.dg/vect/vect-cond-arith-1.c: Add novector pragma.
* gcc.dg/vect/vect-cond-arith-3.c: Add novector pragma.
* gcc.dg/vect/vect-cond-arith-4.c: Add novector pragma.
* gcc.dg/vect/vect-cond-arith-5.c: Add novector pragma.
* gcc.dg/vect/vect-cond-arith-6.c: Add novector pragma.
* gcc.dg/vect/vect-cond-arith-7.c: Add novector pragma.
* gcc.dg/vect/vect-cselim-1.c: Add novector pragma.
* gcc.dg/vect/vect-cselim-2.c: Add novector pragma.
* gcc.dg/vect/vect-div-bitmask-4.c: Add novector pragma.
* gcc.dg/vect/vect-div-bitmask-5.c: Add novector pragma.
* gcc.dg/vect/vect-div-bitmask.h: Add novector pragma.
* gcc.dg/vect/vect-double-reduc-1.c: Add novector pragma.
* gcc.dg/vect/vect-double-reduc-2.c: Add novector pragma.
* gcc.dg/vect/vect-double-reduc-3.c: Add novector pragma.
* gcc.dg/vect/vect-double-reduc-4.c: Add novector pragma.
* gcc.dg/vect/vect-double-reduc-5.c: Add novector pragma.
* gcc.dg/vect/vect-double-reduc-6-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-double-reduc-6.c: Add novector pragma.
* gcc.dg/vect/vect-double-reduc-7.c: Add novector pragma.
* gcc.dg/vect/vect-float-extend-1.c: Add novector pragma.
* gcc.dg/vect/vect-float-truncate-1.c: Add novector pragma.
* gcc.dg/vect/vect-floatint-conversion-1.c: Add novector pragma.
* gcc.dg/vect/vect-floatint-conversion-2.c: Add novector pragma.
* gcc.dg/vect/vect-fma-1.c: Add novector pragma.
* gcc.dg/vect/vect-gather-1.c: Add novector pragma.
* gcc.dg/vect/vect-gather-3.c: Add novector pragma.
* gcc.dg/vect/vect-ifcvt-11.c: Add novector pragma.
* gcc.dg/vect/vect-ifcvt-16.c: Add novector pragma.
* gcc.dg/vect/vect-ifcvt-17.c: Add novector pragma.
* gcc.dg/vect/vect-ifcvt-2.c: Add novector pragma.
* gcc.dg/vect/vect-ifcvt-3.c: Add novector pragma.
* gcc.dg/vect/vect-ifcvt-4.c: Add novector pragma.
* gcc.dg/vect/vect-ifcvt-5.c: Add novector pragma.
* gcc.dg/vect/vect-ifcvt-6.c: Add novector pragma.
* gcc.dg/vect/vect-ifcvt-7.c: Add novector pragma.
* gcc.dg/vect/vect-ifcvt-9.c: Add novector pragma.
* gcc.dg/vect/vect-intfloat-conversion-1.c: Add novector pragma.
* gcc.dg/vect/vect-intfloat-conversion-2.c: Add novector pragma.
* gcc.dg/vect/vect-intfloat-conversion-3.c: Add novector pragma.
* gcc.dg/vect/vect-intfloat-conversion-4a.c: Add novector pragma.
* gcc.dg/vect/vect-intfloat-conversion-4b.c: Add novector pragma.
* gcc.dg/vect/vect-iv-1.c: Add novector pragma.
* gcc.dg/vect/vect-iv-10.c: Add novector pragma.
* gcc.dg/vect/vect-iv-2.c: Add novector pragma.
* gcc.dg/vect/vect-iv-3.c: Add novector pragma.
* gcc.dg/vect/vect-iv-4.c: Add novector pragma.
* gcc.dg/vect/vect-iv-5.c: Add novector pragma.
* gcc.dg/vect/vect-iv-6.c: Add novector pragma.
* gcc.dg/vect/vect-iv-7.c: Add novector pragma.
* gcc.dg/vect/vect-iv-8-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-iv-8.c: Add novector pragma.
* gcc.dg/vect/vect-iv-8a-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-iv-8a.c: Add novector pragma.
* gcc.dg/vect/vect-live-1.c: Add novector pragma.
* gcc.dg/vect/vect-live-2.c: Add novector pragma.
* gcc.dg/vect/vect-live-3.c: Add novector pragma.
* gcc.dg/vect/vect-live-4.c: Add novector pragma.
* gcc.dg/vect/vect-live-5.c: Add novector pragma.
* gcc.dg/vect/vect-live-slp-1.c: Add novector pragma.
* gcc.dg/vect/vect-live-slp-2.c: Add novector pragma.
* gcc.dg/vect/vect-live-slp-3.c: Add novector pragma.
* gcc.dg/vect/vect-mask-load-1.c: Add novector pragma.
* gcc.dg/vect/vect-mask-loadstore-1.c: Add novector pragma.
* gcc.dg/vect/vect-mulhrs-1.c: Add novector pragma.
* gcc.dg/vect/vect-mult-const-pattern-1.c: Add novector pragma.
* gcc.dg/vect/vect-mult-const-pattern-2.c: Add novector pragma.
* gcc.dg/vect/vect-multitypes-1.c: Add novector pragma.
* gcc.dg/vect/vect-multitypes-10.c: Add novector pragma.
* gcc.dg/vect/vect-multitypes-11.c: Add novector pragma.
* gcc.dg/vect/vect-multitypes-12.c: Add novector pragma.
* gcc.dg/vect/vect-multitypes-13.c: Add novector pragma.
* gcc.dg/vect/vect-multitypes-14.c: Add novector pragma.
* gcc.dg/vect/vect-multitypes-16.c: Add novector pragma.
* gcc.dg/vect/vect-multitypes-17.c: Add novector pragma.
* gcc.dg/vect/vect-multitypes-2.c: Add novector pragma.
* gcc.dg/vect/vect-multitypes-3.c: Add novector pragma.
* gcc.dg/vect/vect-multitypes-4.c: Add novector pragma.
* gcc.dg/vect/vect-multitypes-5.c: Add novector pragma.
* gcc.dg/vect/vect-multitypes-6.c: Add novector pragma.
* gcc.dg/vect/vect-multitypes-8.c: Add novector pragma.
* gcc.dg/vect/vect-multitypes-9.c: Add novector pragma.
* gcc.dg/vect/vect-nb-iter-ub-1.c: Add novector pragma.
* gcc.dg/vect/vect-nb-iter-ub-2.c: Add novector pragma.
* gcc.dg/vect/vect-nb-iter-ub-3.c: Add novector pragma.
* gcc.dg/vect/vect-neg-store-1.c: Add novector pragma.
* gcc.dg/vect/vect-neg-store-2.c: Add novector pragma.
* gcc.dg/vect/vect-nest-cycle-1.c: Add novector pragma.
* gcc.dg/vect/vect-nest-cycle-2.c: Add novector pragma.
* gcc.dg/vect/vect-nest-cycle-3.c: Add novector pragma.
* gcc.dg/vect/vect-outer-2-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-outer-2.c: Add novector pragma.
* gcc.dg/vect/vect-outer-2a-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-outer-2a.c: Add novector pragma.
* gcc.dg/vect/vect-outer-2b.c: Add novector pragma.
* gcc.dg/vect/vect-outer-2c-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-outer-2c.c: Add novector pragma.
* gcc.dg/vect/vect-outer-2d.c: Add novector pragma.
* gcc.dg/vect/vect-outer-3-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-outer-3.c: Add novector pragma.
* gcc.dg/vect/vect-outer-3a-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-outer-3a.c: Add novector pragma.
* gcc.dg/vect/vect-outer-3b.c: Add novector pragma.
* gcc.dg/vect/vect-outer-3c.c: Add novector pragma.
* gcc.dg/vect/vect-outer-4.c: Add novector pragma.
* gcc.dg/vect/vect-outer-4d-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-outer-4d.c: Add novector pragma.
* gcc.dg/vect/vect-outer-5.c: Add novector pragma.
* gcc.dg/vect/vect-outer-6.c: Add novector pragma.
* gcc.dg/vect/vect-outer-fir-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-outer-fir-lb-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-outer-fir-lb.c: Add novector pragma.
* gcc.dg/vect/vect-outer-fir.c: Add novector pragma.
* gcc.dg/vect/vect-outer-simd-1.c: Add novector pragma.
* gcc.dg/vect/vect-outer-simd-2.c: Add novector pragma.
* gcc.dg/vect/vect-outer-simd-3.c: Add novector pragma.
* gcc.dg/vect/vect-outer-slp-2.c: Add novector pragma.
* gcc.dg/vect/vect-outer-slp-3.c: Add novector pragma.
* gcc.dg/vect/vect-over-widen-1-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-over-widen-1.c: Add novector pragma.
* gcc.dg/vect/vect-over-widen-11.c: Add novector pragma.
* gcc.dg/vect/vect-over-widen-13.c: Add novector pragma.
* gcc.dg/vect/vect-over-widen-15.c: Add novector pragma.
* gcc.dg/vect/vect-over-widen-17.c: Add novector pragma.
* gcc.dg/vect/vect-over-widen-18.c: Add novector pragma.
* gcc.dg/vect/vect-over-widen-19.c: Add novector pragma.
* gcc.dg/vect/vect-over-widen-2-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-over-widen-2.c: Add novector pragma.
* gcc.dg/vect/vect-over-widen-20.c: Add novector pragma.
* gcc.dg/vect/vect-over-widen-21.c: Add novector pragma.
* gcc.dg/vect/vect-over-widen-22.c: Add novector pragma.
* gcc.dg/vect/vect-over-widen-3-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-over-widen-3.c: Add novector pragma.
* gcc.dg/vect/vect-over-widen-4-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-over-widen-4.c: Add novector pragma.
* gcc.dg/vect/vect-over-widen-5.c: Add novector pragma.
* gcc.dg/vect/vect-over-widen-7.c: Add novector pragma.
* gcc.dg/vect/vect-over-widen-9.c: Add novector pragma.
* gcc.dg/vect/vect-peel-1-src.c: Add novector pragma.
* gcc.dg/vect/vect-peel-2-src.c: Add novector pragma.
* gcc.dg/vect/vect-peel-4-src.c: Add novector pragma.
* gcc.dg/vect/vect-recurr-1.c: Add novector pragma.
* gcc.dg/vect/vect-recurr-2.c: Add novector pragma.
* gcc.dg/vect/vect-recurr-3.c: Add novector pragma.
* gcc.dg/vect/vect-recurr-4.c: Add novector pragma.
* gcc.dg/vect/vect-recurr-5.c: Add novector pragma.
* gcc.dg/vect/vect-recurr-6.c: Add novector pragma.
* gcc.dg/vect/vect-sdiv-pow2-1.c: Add novector pragma.
* gcc.dg/vect/vect-sdivmod-1.c: Add novector pragma.
* gcc.dg/vect/vect-shift-1.c: Add novector pragma.
* gcc.dg/vect/vect-shift-3.c: Add novector pragma.
* gcc.dg/vect/vect-shift-4.c: Add novector pragma.
* gcc.dg/vect/vect-simd-1.c: Add novector pragma.
* gcc.dg/vect/vect-simd-10.c: Add novector pragma.
* gcc.dg/vect/vect-simd-11.c: Add novector pragma.
* gcc.dg/vect/vect-simd-12.c: Add novector pragma.
* gcc.dg/vect/vect-simd-13.c: Add novector pragma.
* gcc.dg/vect/vect-simd-14.c: Add novector pragma.
* gcc.dg/vect/vect-simd-15.c: Add novector pragma.
* gcc.dg/vect/vect-simd-16.c: Add novector pragma.
* gcc.dg/vect/vect-simd-17.c: Add novector pragma.
* gcc.dg/vect/vect-simd-18.c: Add novector pragma.
* gcc.dg/vect/vect-simd-19.c: Add novector pragma.
* gcc.dg/vect/vect-simd-20.c: Add novector pragma.
* gcc.dg/vect/vect-simd-8.c: Add novector pragma.
* gcc.dg/vect/vect-simd-9.c: Add novector pragma.
* gcc.dg/vect/vect-simd-clone-1.c: Add novector pragma.
* gcc.dg/vect/vect-simd-clone-10.c: Add novector pragma.
* gcc.dg/vect/vect-simd-clone-11.c: Add novector pragma.
* gcc.dg/vect/vect-simd-clone-15.c: Add novector pragma.
* gcc.dg/vect/vect-simd-clone-2.c: Add novector pragma.
* gcc.dg/vect/vect-simd-clone-3.c: Add novector pragma.
* gcc.dg/vect/vect-simd-clone-4.c: Add novector pragma.
* gcc.dg/vect/vect-simd-clone-5.c: Add novector pragma.
* gcc.dg/vect/vect-simd-clone-6.c: Add novector pragma.
* gcc.dg/vect/vect-simd-clone-7.c: Add novector pragma.
* gcc.dg/vect/vect-simd-clone-8.c: Add novector pragma.
* gcc.dg/vect/vect-simd-clone-9.c: Add novector pragma.
* gcc.dg/vect/vect-strided-a-mult.c: Add novector pragma.
* gcc.dg/vect/vect-strided-a-u16-i2.c: Add novector pragma.
* gcc.dg/vect/vect-strided-a-u16-i4.c: Add novector pragma.
* gcc.dg/vect/vect-strided-a-u16-mult.c: Add novector pragma.
* gcc.dg/vect/vect-strided-a-u32-mult.c: Add novector pragma.
* gcc.dg/vect/vect-strided-a-u8-i2-gap.c: Add novector pragma.
* gcc.dg/vect/vect-strided-a-u8-i8-gap2-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-strided-a-u8-i8-gap2.c: Add novector pragma.
* gcc.dg/vect/vect-strided-a-u8-i8-gap7-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-strided-a-u8-i8-gap7.c: Add novector pragma.
* gcc.dg/vect/vect-strided-float.c: Add novector pragma.
* gcc.dg/vect/vect-strided-mult-char-ls.c: Add novector pragma.
* gcc.dg/vect/vect-strided-mult.c: Add novector pragma.
* gcc.dg/vect/vect-strided-same-dr.c: Add novector pragma.
* gcc.dg/vect/vect-strided-shift-1.c: Add novector pragma.
* gcc.dg/vect/vect-strided-store-a-u8-i2.c: Add novector pragma.
* gcc.dg/vect/vect-strided-store-u16-i4.c: Add novector pragma.
* gcc.dg/vect/vect-strided-store-u32-i2.c: Add novector pragma.
* gcc.dg/vect/vect-strided-store.c: Add novector pragma.
* gcc.dg/vect/vect-strided-u16-i2.c: Add novector pragma.
* gcc.dg/vect/vect-strided-u16-i3.c: Add novector pragma.
* gcc.dg/vect/vect-strided-u16-i4.c: Add novector pragma.
* gcc.dg/vect/vect-strided-u32-i4.c: Add novector pragma.
* gcc.dg/vect/vect-strided-u32-i8.c: Add novector pragma.
* gcc.dg/vect/vect-strided-u32-mult.c: Add novector pragma.
* gcc.dg/vect/vect-strided-u8-i2-gap.c: Add novector pragma.
* gcc.dg/vect/vect-strided-u8-i2.c: Add novector pragma.
* gcc.dg/vect/vect-strided-u8-i8-gap2-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-strided-u8-i8-gap2.c: Add novector pragma.
* gcc.dg/vect/vect-strided-u8-i8-gap4-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-strided-u8-i8-gap4-unknown.c: Add novector pragma.
* gcc.dg/vect/vect-strided-u8-i8-gap4.c: Add novector pragma.
* gcc.dg/vect/vect-strided-u8-i8-gap7-big-array.c: Add novector pragma.
* gcc.dg/vect/vect-strided-u8-i8-gap7.c: Add novector pragma.
* gcc.dg/vect/vect-strided-u8-i8.c: Add novector pragma.
* gcc.dg/vect/vect-vfa-01.c: Add novector pragma.
* gcc.dg/vect/vect-vfa-02.c: Add novector pragma.
* gcc.dg/vect/vect-vfa-03.c: Add novector pragma.
* gcc.dg/vect/vect-vfa-04.c: Add novector pragma.
* gcc.dg/vect/vect-vfa-slp.c: Add novector pragma.
* gcc.dg/vect/vect-widen-mult-1.c: Add novector pragma.
* gcc.dg/vect/vect-widen-mult-const-s16.c: Add novector pragma.
* gcc.dg/vect/vect-widen-mult-const-u16.c: Add novector pragma.
* gcc.dg/vect/vect-widen-mult-half-u8.c: Add novector pragma.
* gcc.dg/vect/vect-widen-mult-half.c: Add novector pragma.
* gcc.dg/vect/vect-widen-mult-s16.c: Add novector pragma.
* gcc.dg/vect/vect-widen-mult-s8.c: Add novector pragma.
* gcc.dg/vect/vect-widen-mult-u16.c: Add novector pragma.
* gcc.dg/vect/vect-widen-mult-u8-s16-s32.c: Add novector pragma.
* gcc.dg/vect/vect-widen-mult-u8-u32.c: Add novector pragma.
* gcc.dg/vect/vect-widen-mult-u8.c: Add novector pragma.
* gcc.dg/vect/vect-widen-shift-s16.c: Add novector pragma.
* gcc.dg/vect/vect-widen-shift-s8.c: Add novector pragma.
* gcc.dg/vect/vect-widen-shift-u16.c: Add novector pragma.
* gcc.dg/vect/vect-widen-shift-u8.c: Add novector pragma.
* gcc.dg/vect/wrapv-vect-7.c: Add novector pragma.

23 months agofrontend: Add novector C pragma
Tamar Christina [Fri, 4 Aug 2023 12:51:16 +0000 (13:51 +0100)] 
frontend: Add novector C pragma

FORTRAN currently has a pragma NOVECTOR for indicating that vectorization should
not be applied to a particular loop.

ICC/ICX also has such a pragma for C and C++ called #pragma novector.

As part of this patch series I need a way to easily turn off vectorization of
particular loops, particularly for testsuite reasons.

This patch proposes a #pragma GCC novector that does the same for C
as gfortan does for FORTRAN and what ICX/ICX does for C.

I added only some basic tests here, but the next patch in the series uses this
in the testsuite in about ~800 tests.

gcc/c-family/ChangeLog:

* c-pragma.h (enum pragma_kind): Add PRAGMA_NOVECTOR.
* c-pragma.cc (init_pragma): Use it.

gcc/c/ChangeLog:

* c-parser.cc (c_parser_while_statement, c_parser_do_statement,
c_parser_for_statement, c_parser_statement_after_labels,
c_parse_pragma_novector, c_parser_pragma): Wire through novector and
default to false.

gcc/testsuite/ChangeLog:

* gcc.dg/vect/vect-novector-pragma.c: New test.

23 months agofrontend: Add novector C++ pragma
Tamar Christina [Fri, 4 Aug 2023 12:50:53 +0000 (13:50 +0100)] 
frontend: Add novector C++ pragma

FORTRAN currently has a pragma NOVECTOR for indicating that vectorization should
not be applied to a particular loop.

ICC/ICX also has such a pragma for C and C++ called #pragma novector.

As part of this patch series I need a way to easily turn off vectorization of
particular loops, particularly for testsuite reasons.

This patch proposes a #pragma GCC novector that does the same for C++
as gfortan does for FORTRAN and what ICX/ICX does for C++.

I added only some basic tests here, but the next patch in the series uses this
in the testsuite in about ~800 tests.

gcc/cp/ChangeLog:

* cp-tree.h (RANGE_FOR_NOVECTOR): New.
(cp_convert_range_for, finish_while_stmt_cond, finish_do_stmt,
finish_for_cond): Add novector param.
* init.cc (build_vec_init): Default novector to false.
* method.cc (build_comparison_op): Likewise.
* parser.cc (cp_parser_statement): Likewise.
(cp_parser_for, cp_parser_c_for, cp_parser_range_for,
cp_convert_range_for, cp_parser_iteration_statement,
cp_parser_omp_for_loop, cp_parser_pragma): Support novector.
(cp_parser_pragma_novector): New.
* pt.cc (tsubst_expr): Likewise.
* semantics.cc (finish_while_stmt_cond, finish_do_stmt,
finish_for_cond): Likewise.

gcc/ChangeLog:

* doc/extend.texi: Document it.

gcc/testsuite/ChangeLog:

* g++.dg/vect/vect.exp (support vect- prefix).
* g++.dg/vect/vect-novector-pragma.cc: New test.

23 months agoAArch64: Undo vec_widen_<sur>shiftl optabs [PR106346]
Tamar Christina [Fri, 4 Aug 2023 12:49:23 +0000 (13:49 +0100)] 
AArch64: Undo vec_widen_<sur>shiftl optabs [PR106346]

In GCC 11 we implemented the vectorizer optab for widening left shifts,
however this optab is only supported for uniform shift constants.

At the moment GCC still has two loop vectorization strategy (classical loop and
SLP based loop vec) and the optab is implemented as a scalar pattern.

This means that when we apply it to a non-uniform constant inside a loop we only
find out during SLP build that the constants aren't uniform.  At this point it's
too late and we lose SLP entirely.

Over the years I've tried various options but none of it works well:

1. Dissolving patterns during SLP built (problematic, also dissolves them for
non-slp).
2. Optionally ignoring patterns for SLP build (problematic, ends up interfearing
with relevancy detection).
3. Relaxing contraint on SLP build to allow non-constant values and dissolving
them after SLP build using an SLP pattern.  (problematic, ends up breaking
shift reassociation).

As a result we've concluded that for now this pattern should just be removed
and formed during RTL.

The plan is to move this to an SLP only pattern once we remove classical loop
vectorization support from GCC, at which time we can also properly support SVE's
Top and Bottom variants.

This removes the optab and reworks the RTL to recognize both the vector variant
and the intrinsics variant.  Also just simplifies all these patterns.

gcc/ChangeLog:

PR target/106346
* config/aarch64/aarch64-simd.md (vec_widen_<sur>shiftl_lo_<mode>,
vec_widen_<sur>shiftl_hi_<mode>): Remove.
(aarch64_<sur>shll<mode>_internal): Renamed to...
(aarch64_<su>shll<mode>): .. This.
(aarch64_<sur>shll2<mode>_internal): Renamed to...
(aarch64_<su>shll2<mode>): .. This.
(aarch64_<sur>shll_n<mode>, aarch64_<sur>shll2_n<mode>): Re-use new
optabs.
* config/aarch64/constraints.md (D2, DL): New.
* config/aarch64/predicates.md (aarch64_simd_shll_imm_vec): New.

gcc/testsuite/ChangeLog:

PR target/106346
* gcc.target/aarch64/pr98772.c: Adjust assembly.
* gcc.target/aarch64/vect-widen-shift.c: New test.

23 months agogensupport: Don't segfault on empty attrs list
Tamar Christina [Fri, 4 Aug 2023 12:48:56 +0000 (13:48 +0100)] 
gensupport: Don't segfault on empty attrs list

Currently we segfault when len == 0 for an attribute list.

essentially [cons: =0, 1, 2, 3; attrs: ] segfaults but should be equivalent to
[cons: =0, 1, 2, 3] and [cons: =0, 1, 2, 3; attrs:].  This fixes it by just
returning early and leaving it to the validators whether this should error out
or not.

gcc/ChangeLog:

* gensupport.cc (conlist): Support length 0 attribute.

23 months agoAArch64: update costing for combining vector conditionals
Tamar Christina [Fri, 4 Aug 2023 12:48:35 +0000 (13:48 +0100)] 
AArch64: update costing for combining vector conditionals

boolean comparisons have different cost depending on the mode. e.g.
for SVE, a && b doesn't require an additional instruction when a or b
is predicated by combining the predicate of the one operation into the
second one.  At the moment though we only fuse compares so this update
requires one of the operands to be a comparison.

Scalars also don't require this because the non-ifcvt variant is a series of
branches where following the branch sequences themselves are natural ANDs.

Advanced SIMD however does require an actual AND to combine the boolean values.

As such this patch discounts Scalar and SVE boolean operation latency and
throughput.

With this patch comparison heavy code prefers SVE as it should, especially in
cases with SVE VL == Advanced SIMD VL where previously the SVE prologue costs
would tip it towards Advanced SIMD.

gcc/ChangeLog:

* config/aarch64/aarch64.cc (aarch64_bool_compound_p): New.
(aarch64_adjust_stmt_cost, aarch64_vector_costs::count_ops): Use it.

23 months agoAArch64: update costing for MLA by invariant
Tamar Christina [Fri, 4 Aug 2023 12:46:36 +0000 (13:46 +0100)] 
AArch64: update costing for MLA by invariant

When determining issue rates we currently discount non-constant MLA accumulators
for Advanced SIMD but don't do it for the latency.

This means the costs for Advanced SIMD with a constant accumulator are wrong and
results in us costing SVE and Advanced SIMD the same.  This can cauze us to
vectorize with Advanced SIMD instead of SVE in some cases.

This patch adds the same discount for SVE and Scalar as we do for issue rate.

This gives a 5% improvement in fotonik3d_r in SPECCPU 2017 on large
Neoverse cores.

gcc/ChangeLog:

* config/aarch64/aarch64.cc (aarch64_multiply_add_p): Update handling
of constants.
(aarch64_adjust_stmt_cost): Use it.
(aarch64_vector_costs::count_ops): Likewise.
(aarch64_vector_costs::add_stmt_cost): Pass vinfo to
aarch64_adjust_stmt_cost.

23 months agotree-optimization/110838 - vectorization of widened right shifts
Richard Biener [Fri, 4 Aug 2023 10:11:45 +0000 (12:11 +0200)] 
tree-optimization/110838 - vectorization of widened right shifts

The following fixes a problem with my last attempt of avoiding
out-of-bound shift values for vectorized right shifts of widened
operands.  Instead of truncating the shift amount with a bitwise
and we actually need to saturate it to the target precision.

The following does that and adds test coverage for the constant
and invariant but variable case that would previously have failed.

PR tree-optimization/110838
* tree-vect-patterns.cc (vect_recog_over_widening_pattern):
Fix right-shift value sanitizing.  Properly emit external
def mangling in the preheader rather than in the pattern
def sequence where it will fail vectorizing.

* gcc.dg/vect/pr110838.c: New testcase.

23 months agomid-end: Use integral time intervals in timevar.cc
Matthew Malcomson [Fri, 4 Aug 2023 10:26:47 +0000 (11:26 +0100)] 
mid-end: Use integral time intervals in timevar.cc

On some AArch64 bootstrapped builds, we were getting a flaky test
because the floating point operations in `get_time` were being fused
with the floating point operations in `timevar_accumulate`.

This meant that the rounding behaviour of our multiplication with
`ticks_to_msec` was different when used in `timer::start` and when
performed in `timer::stop`.  These extra inaccuracies led to the
testcase `g++.dg/ext/timevar1.C` being flaky on some hardware.

------------------------------
Avoiding the inlining which was agreed to be undesirable.  Three
alternative approaches:
1) Use `-ffp-contract=on` to avoid this particular optimisation.
2) Adjusting the code so that the "tolerance" is always of the order of
   a "tick".
3) Recording times and elapsed differences in integral values.
   - Could be in terms of a standard measurement (e.g. nanoseconds or
     microseconds).
   - Could be in terms of whatever integral value ("ticks" /
     seconds&microseconds / "clock ticks") is returned from the syscall
     chosen at configure time.

While `-ffp-contract=on` removes the problem that I bumped into, there
has been a similar bug on x86 that was to do with a different floating
point problem that also happens after `get_time` and
`timevar_accumulate` both being inlined into the same function.  Hence
it seems worth choosing a different approach.

Of the two other solutions, recording measurements in integral values
seems the most robust against slightly "off" measurements being
presented to the user -- even though it could avoid the ICE that creates
a flaky test.

I considered storing time in whatever units our syscall returns and
normalising them at the time we print out rather than normalising them
to nanoseconds at the point we record our "current time".  The logic
being that normalisation could have some rounding affect (e.g. if
TICKS_PER_SECOND is 3) that would be taken into account in calculations.

I decided against it in order to give the values recorded in
`timevar_time_def` some interpretive value so it's easier to read the
code.  Compared to the small rounding that would represent a tiny amount
of time and AIUI can not trigger the same kind of ICE's as we are
attempting to fix, said interpretive value seems more valuable.

Recording time in microseconds seemed reasonable since all obvious
values for ticks and `getrusage` are at microsecond granularity or less
precise.  That said, since TICKS_PER_SECOND and CLOCKS_PER_SEC are both
variables given to use by the host system I was not sure of that enough
to make this decision.

------------------------------
timer::all_zero is ignoring rows which are inconsequential to the user
and would be printed out as all zeros.  Since upon printing rows we
convert to the same double value and print out the same precision as
before, we return true/false based on the same amount of time as before.

timer::print_row casts to a floating point measurement in units of
seconds as was printed out before.

timer::validate_phases -- I'm printing out nanoseconds here rather than
floating point seconds since this is an error message for when things
have "gone wrong" printing out the actual nanoseconds that have been
recorded seems like the best approach.
N.b. since we now print out nanoseconds instead of floating point value
the padding requirements are different.  Originally we were padding to
24 characters and printing 18 decimal places.  This looked odd with the
now visually smaller values getting printed.  I judged 13 characters
(corresponding to 2 hours) to be a reasonable point at which our
alignment could start to degrade and this provides a more compact output
for the majority of cases (checked by triggering the error case via
GDB).

------------------------------
N.b. I use a literal 1000000000 for "NANOSEC_PER_SEC".  I believe this
would fit in an integer on all hosts that GCC supports, but am not
certain there are not strange integer sizes we support hence am pointing
it out for special attention during review.

------------------------------
No expected change in generated code.
Bootstrapped and regtested on AArch64 with no regressions.

Hope this is acceptable -- I had originally planned to use
`-ffp-contract` as agreed until I saw mention of the old x86 bug in the
same area which was not to do with floating point contraction of
operations (PR 99903).

gcc/ChangeLog:

PR middle-end/110316
PR middle-end/9903
* timevar.cc (NANOSEC_PER_SEC, TICKS_TO_NANOSEC,
CLOCKS_TO_NANOSEC, nanosec_to_floating_sec, percent_of): New.
(TICKS_TO_MSEC, CLOCKS_TO_MSEC): Remove these macros.
(timer::validate_phases): Use integral arithmetic to check
validity.
(timer::print_row, timer::print): Convert from integral
nanoseconds to floating point seconds before printing.
(timer::all_zero): Change limit to nanosec count instead of
fractional count of seconds.
(make_json_for_timevar_time_def): Convert from integral
nanoseconds to floating point seconds before recording.
* timevar.h (struct timevar_time_def): Update all measurements
to use uint64_t nanoseconds rather than seconds stored in a
double.

23 months agotree-optimization/110838 - less aggressively fold out-of-bound shifts
Richard Biener [Fri, 4 Aug 2023 09:24:49 +0000 (11:24 +0200)] 
tree-optimization/110838 - less aggressively fold out-of-bound shifts

The following adjusts the shift simplification patterns to avoid
touching out-of-bound shift value arithmetic right shifts of
possibly negative values.  While simplifying those to zero isn't
wrong it's violating the principle of least surprise.

PR tree-optimization/110838
* match.pd (([rl]shift @0 out-of-bounds) -> zero): Restrict
the arithmetic right-shift case to non-negative operands.

23 months agoRevert "RISC-V: Support RVV VFMACC rounding mode intrinsic API"
Pan Li [Fri, 4 Aug 2023 09:11:26 +0000 (17:11 +0800)] 
Revert "RISC-V: Support RVV VFMACC rounding mode intrinsic API"

This reverts commit 51e5a5cefb11d8a7b2216e866abcc225ba16d127.

23 months agoRevert "RISC-V: Support RVV VFNMACC rounding mode intrinsic API"
Pan Li [Fri, 4 Aug 2023 09:11:12 +0000 (17:11 +0800)] 
Revert "RISC-V: Support RVV VFNMACC rounding mode intrinsic API"

This reverts commit 62d9c1dd8eb1152d8fbe0e1df101b99c9141417a.

23 months agoRevert "RISC-V: Support RVV VFMSAC rounding mode intrinsic API"
Pan Li [Fri, 4 Aug 2023 09:10:49 +0000 (17:10 +0800)] 
Revert "RISC-V: Support RVV VFMSAC rounding mode intrinsic API"

This reverts commit dccd7e8a7215f3f2e295e11b20680d3add08cd7e.

23 months agoRevert "RISC-V: Support RVV VFNMSAC rounding mode intrinsic API"
Pan Li [Fri, 4 Aug 2023 09:10:29 +0000 (17:10 +0800)] 
Revert "RISC-V: Support RVV VFNMSAC rounding mode intrinsic API"

This reverts commit 236ec7aac051a062dc961b3c1482925893ee6e21.

23 months agoAVR: Add some more devices: AVR16DD*, AVR32DD*, AVR64DD*, AVR64EA*, ATtiny42*, ATtiny...
Georg-Johann Lay [Fri, 4 Aug 2023 08:24:39 +0000 (10:24 +0200)] 
AVR: Add some more devices: AVR16DD*, AVR32DD*, AVR64DD*, AVR64EA*, ATtiny42*, ATtiny82*, ATtiny162*, ATtiny322*, ATtiny10*.

gcc/
* config/avr/avr-mcus.def (avr64dd14, avr64dd20, avr64dd28, avr64dd32)
(avr64ea28, avr64ea32, avr64ea48, attiny424, attiny426, attiny427)
(attiny824, attiny826, attiny827, attiny1624, attiny1626, attiny1627)
(attiny3224, attiny3226, attiny3227, avr16dd14, avr16dd20, avr16dd28)
(avr16dd32, avr32dd14, avr32dd20, avr32dd28, avr32dd32)
(attiny102, attiny104): New devices.
* doc/avr-mmcu.texi: Regenerate.

23 months agoFix some minor typos in avr-mcus.def.
Georg-Johann Lay [Fri, 4 Aug 2023 07:51:11 +0000 (09:51 +0200)] 
Fix some minor typos in avr-mcus.def.

gcc/
* config/avr/avr-mcus.def (avr128d*, avr64d*): Fix their FLASH_SIZE
and PM_OFFSET entries.

23 months agoFix PR 110874: infinite loop in gimple_bitwise_inverted_equal_p with fre
Andrew Pinski [Wed, 2 Aug 2023 21:49:00 +0000 (14:49 -0700)] 
Fix PR 110874: infinite loop in gimple_bitwise_inverted_equal_p with fre

This changes gimple_bitwise_inverted_equal_p to use a 2 different match patterns
to try to match bit_not wrapped with a possible nop_convert and a comparison
also wrapped with a possible nop_convert. This is to avoid being recursive.

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

gcc/ChangeLog:

PR tree-optimization/110874
* gimple-match-head.cc (gimple_bit_not_with_nop): New declaration.
(gimple_maybe_cmp): Likewise.
(gimple_bitwise_inverted_equal_p): Rewrite to use gimple_bit_not_with_nop
and gimple_maybe_cmp instead of being recursive.
* match.pd (bit_not_with_nop): New match pattern.
(maybe_cmp): Likewise.

gcc/testsuite/ChangeLog:

PR tree-optimization/110874
* gcc.c-torture/compile/pr110874-a.c: New test.

23 months agomatch.pd: Canonicalize (signed x << c) >> c [PR101955]
Drew Ross [Fri, 4 Aug 2023 07:08:05 +0000 (09:08 +0200)] 
match.pd: Canonicalize (signed x << c) >> c [PR101955]

Canonicalizes (signed x << c) >> c into the lowest
precision(type) - c bits of x IF those bits have a mode precision or a
precision of 1. Also combines this rule with (unsigned x << c) >> c -> x &
((unsigned)-1 >> c) to prevent duplicate pattern.

PR middle-end/101955
* match.pd ((signed x << c) >> c): New canonicalization.

* gcc.dg/pr101955.c: New test.

23 months agoRISC-V: Support RVV VFNMSAC rounding mode intrinsic API
Pan Li [Fri, 4 Aug 2023 03:25:13 +0000 (11:25 +0800)] 
RISC-V: Support RVV VFNMSAC rounding mode intrinsic API

This patch would like to support the rounding mode API for the
VFNMSAC for the below samples.

* __riscv_vfnmsac_vv_f32m1_rm
* __riscv_vfnmsac_vv_f32m1_rm_m
* __riscv_vfnmsac_vf_f32m1_rm
* __riscv_vfnmsac_vf_f32m1_rm_m

Signed-off-by: Pan Li <pan2.li@intel.com>
gcc/ChangeLog:

* config/riscv/riscv-vector-builtins-bases.cc
(class vfnmsac_frm): New class for vfnmsac frm.
(vfnmsac_frm_obj): New declaration.
(BASE): Ditto.
* config/riscv/riscv-vector-builtins-bases.h: Ditto.
* config/riscv/riscv-vector-builtins-functions.def
(vfnmsac_frm): New function definition.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/base/float-point-single-negate-multiply-sub.c:
New test.

23 months agoRISC-V: Support RVV VFMSAC rounding mode intrinsic API
Pan Li [Fri, 4 Aug 2023 02:55:09 +0000 (10:55 +0800)] 
RISC-V: Support RVV VFMSAC rounding mode intrinsic API

This patch would like to support the rounding mode API for the
VFMSAC for the below samples.

* __riscv_vfmsac_vv_f32m1_rm
* __riscv_vfmsac_vv_f32m1_rm_m
* __riscv_vfmsac_vf_f32m1_rm
* __riscv_vfmsac_vf_f32m1_rm_m

Signed-off-by: Pan Li <pan2.li@intel.com>
gcc/ChangeLog:

* config/riscv/riscv-vector-builtins-bases.cc
(class vfmsac_frm): New class for vfmsac frm.
(vfmsac_frm_obj): New declaration.
(BASE): Ditto.
* config/riscv/riscv-vector-builtins-bases.h: Ditto.
* config/riscv/riscv-vector-builtins-functions.def
(vfmsac_frm): New function definition.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/base/float-point-single-multiply-sub.c: New test.

23 months agoRISC-V: Support RVV VFNMACC rounding mode intrinsic API
Pan Li [Fri, 4 Aug 2023 02:17:35 +0000 (10:17 +0800)] 
RISC-V: Support RVV VFNMACC rounding mode intrinsic API

This patch would like to support the rounding mode API for the
VFNMACC for the below samples.

* __riscv_vfnmacc_vv_f32m1_rm
* __riscv_vfnmacc_vv_f32m1_rm_m
* __riscv_vfnmacc_vf_f32m1_rm
* __riscv_vfnmacc_vf_f32m1_rm_m

Signed-off-by: Pan Li <pan2.li@intel.com>
gcc/ChangeLog:

* config/riscv/riscv-vector-builtins-bases.cc
(class vfnmacc_frm): New class for vfnmacc.
(vfnmacc_frm_obj): New declaration.
(BASE): Ditto.
* config/riscv/riscv-vector-builtins-bases.h: Ditto.
* config/riscv/riscv-vector-builtins-functions.def
(vfnmacc_frm): New function definition.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/base/float-point-single-negate-multiply-add.c:
New test.

23 months agoAArch64: Avoid the ICE on empty reduction definition in info_for_reduction [PR110625]
Hao Liu [Fri, 4 Aug 2023 02:32:52 +0000 (10:32 +0800)] 
AArch64: Avoid the ICE on empty reduction definition in info_for_reduction [PR110625]

Fix the assertion failure on empty reduction define in info_for_reduction.
Even a stmt is live, it may still have empty reduction define.  Check the
reduction definition instead of live info before calling info_for_reduction.

gcc/ChangeLog:

PR target/110625
* config/aarch64/aarch64.cc (aarch64_force_single_cycle): check
STMT_VINFO_REDUC_DEF to avoid failures in info_for_reduction.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/pr110625_3.c: New testcase.

23 months agoRISC-V: Support RVV VFMACC rounding mode intrinsic API
Pan Li [Thu, 3 Aug 2023 14:32:58 +0000 (22:32 +0800)] 
RISC-V: Support RVV VFMACC rounding mode intrinsic API

This patch would like to support the rounding mode API for the
VFMACC for the below samples.

* __riscv_vfmacc_vv_f32m1_rm
* __riscv_vfmacc_vv_f32m1_rm_m
* __riscv_vfmacc_vf_f32m1_rm
* __riscv_vfmacc_vf_f32m1_rm_m

Signed-off-by: Pan Li <pan2.li@intel.com>
gcc/ChangeLog:

* config/riscv/riscv-vector-builtins-bases.cc
(class vfmacc_frm): New class for vfmacc frm.
(vfmacc_frm_obj): New declaration.
(BASE): Ditto.
* config/riscv/riscv-vector-builtins-bases.h: Ditto.
* config/riscv/riscv-vector-builtins-functions.def
(vfmacc_frm): New function definition.
* config/riscv/riscv-vector-builtins.cc
(function_expander::use_ternop_insn): Add frm operand support.
* config/riscv/vector.md: Add vfmuladd to frm_mode.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/base/float-point-single-multiply-add.c: New test.