Go to file
Ilya Leoshkevich 882c3f17b6 Change EQ_ATTR_ALT to support up to 64 alternatives
On S/390 there is a need to support more than 32 instruction
alternatives per define_insn.  Currently this is not explicitly
prohibited or unsupported: MAX_RECOG_ALTERNATIVES is equal 35, and,
futhermore, the related code uses uint64_t for bitmaps in most places.

However, genattrtab contains the logic to convert (eq_attr "attribute"
"value") RTXs to (eq_attr_alt bitmap) RTXs, where bitmap contains
alternatives, whose "attribute" has the corresponding "value".
Unfortunately, bitmap is only 32 bits.

When adding the 33rd alternative, this led to (eq_attr "type" "larl")
becoming (eq_attr_alt -1050625 1), where -1050625 == 0xffeff7ff.  The
cleared bits 12, 21 and 32 correspond to two existing and one newly
added insn of type "larl".  compute_alternative_mask sign extended this
to 0xffffffffffeff7ff, which contained non-existent alternatives, and
this made simplify_test_exp fail with "invalid alternative specified".

I'm not sure why it didn't fail the same way before, since the top bit,
which led to sign extension, should have been set even with 32
alternatives.  Maybe simplify_test_exp was not called for "type"
attribute for some reason?

This patch widens EQ_ATTR_ALT bitmap to 64 bits, making it possible to
gracefully handle up to 64 alternatives.  It eliminates the problem with
the 33rd alternative on S/390.

gcc/ChangeLog:

2018-09-24  Ilya Leoshkevich  <iii@linux.ibm.com>

	* genattrtab.c (mk_attr_alt): Use alternative_mask.
	(attr_rtx_1): Adjust caching to match the new EQ_ATTR_ALT field
        types.
	(check_attr_test): Use alternative_mask.
	(get_attr_value): Likewise.
	(compute_alternative_mask): Use alternative_mask and XWINT.
	(make_alternative_compare): Use alternative_mask.
	(attr_alt_subset_p): Use XWINT.
	(attr_alt_subset_of_compl_p): Likewise.
	(attr_alt_intersection): Use alternative_mask and XWINT.
	(attr_alt_union): Likewise.
	(attr_alt_complement): Use HOST_WIDE_INT and XWINT.
        (mk_attr_alt): Use alternative_mask and HOST_WIDE_INT.
	(simplify_test_exp): Use alternative_mask and XWINT.
	(write_test_expr): Use alternative_mask and XWINT, adjust bit
        number calculation to support 64 bits.  Generate code that
        checks 64-bit masks.
	(main): Use alternative_mask.
	* rtl.def (EQ_ATTR_ALT): Change field types from ii to ww.

From-SVN: r264537
2018-09-24 15:01:57 +00:00
config Replace 8 spaces with a tabular in ChangeLog files. 2018-08-27 14:04:23 +00:00
contrib Replace 8 spaces with a tabular in ChangeLog files. 2018-08-27 14:04:23 +00:00
fixincludes fixincludes: vxworks: remove unnecessary parentheses in ioctl wrapper macro 2018-09-03 13:26:45 +00:00
gcc Change EQ_ATTR_ALT to support up to 64 alternatives 2018-09-24 15:01:57 +00:00
gnattools
gotools go/build, cmd/go: update to match recent changes to gc 2018-05-09 21:49:47 +00:00
include Replace 8 spaces with a tabular in ChangeLog files. 2018-08-27 14:04:23 +00:00
INSTALL
intl libgnuintl.h (_INTL_MAY_RETURN_STRING_ARG, [...]): Backport changes from upstream gettext. 2018-09-18 22:08:49 -06:00
libada Replace 8 spaces with a tabular in ChangeLog files. 2018-08-27 14:04:23 +00:00
libatomic Replace 8 spaces with a tabular in ChangeLog files. 2018-08-27 14:04:23 +00:00
libbacktrace Replace 8 spaces with a tabular in ChangeLog files. 2018-08-27 14:04:23 +00:00
libcc1
libcpp Add range_idx param to range_label::get_text 2018-09-17 23:32:12 +00:00
libdecnumber Replace 8 spaces with a tabular in ChangeLog files. 2018-08-27 14:04:23 +00:00
libffi Replace 8 spaces with a tabular in ChangeLog files. 2018-08-27 14:04:23 +00:00
libgcc Leverage cacheTextUpdate for __clear_cache on VxWorks 2018-09-21 13:09:51 +00:00
libgfortran Use vectored writes when reporting errors and warnings. 2018-09-21 21:12:59 +03:00
libgo cmd/go: correct gccgo buildid file on ARM 2018-09-14 19:42:01 +00:00
libgomp [nvptx] Remove use of CUDA unified memory in libgomp 2018-09-18 08:41:54 -07:00
libhsail-rt [BRIGFE] phsa-specific optimizations 2018-05-04 19:43:57 +00:00
libiberty Replace 8 spaces with a tabular in ChangeLog files. 2018-08-27 14:04:23 +00:00
libitm Remove nfs bogon 2018-08-03 14:53:48 -06:00
libobjc Replace 8 spaces with a tabular in ChangeLog files. 2018-08-27 14:04:23 +00:00
liboffloadmic
libquadmath
libsanitizer Replace 8 spaces with a tabular in ChangeLog files. 2018-08-27 14:04:23 +00:00
libssp Replace 8 spaces with a tabular in ChangeLog files. 2018-08-27 14:04:23 +00:00
libstdc++-v3 policy_data_structures_biblio.xml: Update link to "Priority Queues and the STL". 2018-09-24 11:14:36 +00:00
libvtv Replace 8 spaces with a tabular in ChangeLog files. 2018-08-27 14:04:23 +00:00
lto-plugin Replace 8 spaces with a tabular in ChangeLog files. 2018-08-27 14:04:23 +00:00
maintainer-scripts re PR other/85622 (gcc-8.1.0/NEWS says it's not released yet) 2018-05-03 11:29:39 +02:00
zlib Allow building of the zlib component when the building takes place in the source directory. 2018-06-19 11:49:08 +00:00
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ChangeLog Add self to maintainers list. 2018-09-13 16:11:29 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess Update config.guess and config.sub 2018-07-06 05:57:35 +00:00
config.rpath
config.sub Update config.sub 2018-07-06 06:22:08 +00:00
configure Introduce @unless/@endunless and postbootstrap Makefile targets 2018-06-30 02:47:29 +00:00
configure.ac Introduce @unless/@endunless and postbootstrap Makefile targets 2018-06-30 02:47:29 +00:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4 libtool.m4: Sort output of 'find' to enable deterministic builds. 2018-07-05 13:13:45 -06:00
lt~obsolete.m4
ltgcc.m4
ltmain.sh libtool.m4: Sort output of 'find' to enable deterministic builds. 2018-07-05 13:13:45 -06:00
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS Add self to maintainers list. 2018-09-13 16:11:29 +00:00
Makefile.def Makefile.def (fortran): Add check-target-libgomp-fortran. 2018-06-18 22:01:58 +00:00
Makefile.in Introduce @unless/@endunless and postbootstrap Makefile targets 2018-06-30 02:47:29 +00:00
Makefile.tpl Introduce @unless/@endunless and postbootstrap Makefile targets 2018-06-30 02:47:29 +00:00
missing
mkdep
mkinstalldirs
move-if-change
README
symlink-tree
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.