Go to file
Maciej W. Rozycki f2a5346244 VAX/testsuite: Remove notsi comparison elimination regressions
Remove fallout from commit 0bd675183d ("match.pd: Add ~(X - Y) -> ~X
+ Y simplification [PR96685]") and paper over the regression caused as
it is not the matter of the test cases affected.

Previously assembly like this:

	.text
	.align 1
.globl eq_notsi
	.type	eq_notsi, @function
eq_notsi:
	.word 0	# 35	[c=0]  procedure_entry_mask
	subl2 $4,%sp	# 46	[c=32]  *addsi3
	mcoml 4(%ap),%r0	# 32	[c=16]  *one_cmplsi2_ccz
	jeql .L1		# 34	[c=26]  *branch_ccz
	addl2 $2,%r0	# 31	[c=32]  *addsi3
.L1:
	ret		# 40	[c=0]  return
	.size	eq_notsi, .-eq_notsi

was produced.  Now this:

	.text
	.align 1
.globl eq_notsi
	.type	eq_notsi, @function
eq_notsi:
	.word 0	# 36	[c=0]  procedure_entry_mask
	subl2 $4,%sp	# 48	[c=32]  *addsi3
	movl 4(%ap),%r0	# 33	[c=16]  *movsi_2
	cmpl %r0,$-1	# 34	[c=8]  *cmpsi_ccz/1
	jeql .L3		# 35	[c=26]  *branch_ccz
	subl3 %r0,$1,%r0	# 32	[c=32]  *subsi3/1
	ret		# 27	[c=0]  return
.L3:
	clrl %r0		# 31	[c=2]  *movsi_2
	ret		# 41	[c=0]  return
	.size	eq_notsi, .-eq_notsi

is, which cannot work with post-reload comparison elimination, due to
the comparison against -1 rather than 0.

Use subtraction from a constant then rather than addition as the former
operation is not transformed, removing these regressions:

FAIL: gcc.target/vax/cmpelim-eq-notsi.c   -O1   scan-rtl-dump-times cmpelim "deleting insn with uid" 1
FAIL: gcc.target/vax/cmpelim-eq-notsi.c   -O1   scan-assembler-not \t(bit|cmpz?|tst).
FAIL: gcc.target/vax/cmpelim-eq-notsi.c   -O1   scan-assembler one_cmplsi[^ ]*_ccz(/[0-9]+)?\n
FAIL: gcc.target/vax/cmpelim-lt-notsi.c   -O1   scan-rtl-dump-times cmpelim "deleting insn with uid" 1
FAIL: gcc.target/vax/cmpelim-lt-notsi.c   -O1   scan-assembler-not \t(bit|cmpz?|tst).
FAIL: gcc.target/vax/cmpelim-lt-notsi.c   -O1   scan-assembler one_cmplsi[^ ]*_ccn(/[0-9]+)?\n

and likewise across some of the other the optimization levels verified.

The LE variant appears unaffected as the new transformation produces
slightly different although still suboptimal code:

	.text
	.align 1
.globl le_notsi
	.type	le_notsi, @function
le_notsi:
	.word 0	# 27	[c=0]  procedure_entry_mask
	subl2 $4,%sp	# 34	[c=32]  *addsi3
	movl 4(%ap),%r1	# 23	[c=16]  *movsi_2
	mcoml %r1,%r0	# 24	[c=8]  *one_cmplsi2_ccnz
	jleq .L1		# 26	[c=26]  *branch_ccnz
	subl3 %r1,$1,%r0	# 22	[c=32]  *subsi3/1
.L1:
	ret		# 32	[c=0]  return
	.size	le_notsi, .-le_notsi

but update the test case too, for consistency with the other two.

	gcc/testsuite/
	* gcc.target/vax/cmpelim-eq-notsi.c: Use subtraction from a
	constant then rather than addition.
	* gcc.target/vax/cmpelim-le-notsi.c: Likewise.
	* gcc.target/vax/cmpelim-lt-notsi.c: Likewise.
2021-01-09 16:30:51 +00:00
c++tools Daily bump. 2021-01-06 00:16:55 +00:00
config Daily bump. 2021-01-06 00:16:55 +00:00
contrib Daily bump. 2021-01-07 00:16:19 +00:00
fixincludes
gcc VAX/testsuite: Remove notsi comparison elimination regressions 2021-01-09 16:30:51 +00:00
gnattools
gotools Daily bump. 2020-12-31 00:16:29 +00:00
include Update copyright years. 2021-01-04 10:26:59 +01:00
INSTALL
intl
libada Update copyright years. 2021-01-04 10:26:59 +01:00
libatomic Daily bump. 2021-01-06 00:16:55 +00:00
libbacktrace Daily bump. 2021-01-06 00:16:55 +00:00
libcc1 Daily bump. 2021-01-06 00:16:55 +00:00
libcody Daily bump. 2021-01-07 00:16:19 +00:00
libcpp Daily bump. 2021-01-08 00:16:23 +00:00
libdecnumber Update copyright years. 2021-01-04 10:26:59 +01:00
libffi Daily bump. 2021-01-06 00:16:55 +00:00
libgcc Update copyright years. 2021-01-04 10:26:59 +01:00
libgfortran Daily bump. 2021-01-06 00:16:55 +00:00
libgo Update GNU/Hurd configure support 2021-01-05 16:04:14 -07:00
libgomp Daily bump. 2021-01-06 00:16:55 +00:00
libhsail-rt Daily bump. 2021-01-06 00:16:55 +00:00
libiberty Daily bump. 2021-01-05 00:16:42 +00:00
libitm Daily bump. 2021-01-06 00:16:55 +00:00
libobjc Daily bump. 2021-01-06 00:16:55 +00:00
liboffloadmic Daily bump. 2021-01-06 00:16:55 +00:00
libphobos Daily bump. 2021-01-06 00:16:55 +00:00
libquadmath Daily bump. 2021-01-06 00:16:55 +00:00
libsanitizer Daily bump. 2021-01-06 00:16:55 +00:00
libssp Daily bump. 2021-01-06 00:16:55 +00:00
libstdc++-v3 Daily bump. 2021-01-09 00:16:22 +00:00
libvtv Daily bump. 2021-01-06 00:16:55 +00:00
lto-plugin Daily bump. 2021-01-06 00:16:55 +00:00
maintainer-scripts
zlib Daily bump. 2021-01-06 00:16:55 +00:00
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2021-01-07 00:16:19 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure
configure.ac
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4 Update GNU/Hurd configure support 2021-01-05 16:04:14 -07:00
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS MAINTAINERS: Update my email address. 2021-01-04 17:37:54 +01:00
Makefile.def sync libctf toplevel from binutils-gdb 2021-01-07 09:28:58 +10:30
Makefile.in sync libctf toplevel from binutils-gdb 2021-01-07 09:28:58 +10:30
Makefile.tpl
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
symlink-tree
test-driver
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.