gcc/gcc/config/sh
Joseph Myers 52caeae857 Limit SH strncmp inline expansion (PR target/78460).
GCC mainline built for sh4-linux-gnu runs out of memory building a
glibc test, which calls strncmp with very large constant size
argument, resulting in the SH inline strncmp expansion trying to
inline a fully unrolled expansion of strncmp for that size.

This patch limits that fully unrolled expansion to the case of less
than 32 bytes.  This is explicitly *not* trying to be optimal in any
way (very likely a lower threshold makes sense), just to limit enough
to avoid the out-of-memory issue in the glibc testsuite.

I have *not* run the GCC testsuite for SH.  I have verified that this
allows the glibc testsuite to build OK, with both GCC mainline and GCC
7 branch (and that the included test builds quickly with patched GCC,
runs out of memory with unpatched GCC).

	PR target/78460
	PR target/67712
gcc:
	* config/sh/sh-mem.cc (sh_expand_cmpnstr): Only unroll for
	constant count if that count is less than 32.

gcc/testsuite:
	* gcc.c-torture/compile/string-large-1.c: New test.

From-SVN: r251109
2017-08-16 00:43:11 +01:00
..
constraints.md Update copyright years. 2017-01-01 13:07:43 +01:00
divcost-analysis Update copyright years. 2017-01-01 13:07:43 +01:00
divtab-sh4-300.c Update copyright years. 2017-01-01 13:07:43 +01:00
divtab-sh4.c Update copyright years. 2017-01-01 13:07:43 +01:00
divtab.c Update copyright years. 2017-01-01 13:07:43 +01:00
elf.h Update copyright years. 2017-01-01 13:07:43 +01:00
embed-elf.h Update copyright years. 2017-01-01 13:07:43 +01:00
iterators.md Update copyright years. 2017-01-01 13:07:43 +01:00
linux.h Update copyright years. 2017-01-01 13:07:43 +01:00
little.h Update copyright years. 2017-01-01 13:07:43 +01:00
netbsd-elf.h Update copyright years. 2017-01-01 13:07:43 +01:00
newlib.h Update copyright years. 2017-01-01 13:07:43 +01:00
predicates.md Update copyright years. 2017-01-01 13:07:43 +01:00
rtems.h [RTEMS] Add GCC Runtime Library Exception 2017-07-26 08:31:09 +00:00
rtemself.h [RTEMS] Add GCC Runtime Library Exception 2017-07-26 08:31:09 +00:00
sh-c.c Update copyright years. 2017-01-01 13:07:43 +01:00
sh-mem.cc Limit SH strncmp inline expansion (PR target/78460). 2017-08-16 00:43:11 +01:00
sh-modes.def Update copyright years. 2017-01-01 13:07:43 +01:00
sh-protos.h Update copyright years. 2017-01-01 13:07:43 +01:00
sh.c Fix numerous typos in comments 2017-04-03 23:30:56 +01:00
sh.h Update copyright years. 2017-01-01 13:07:43 +01:00
sh.md sh: Fixes for RTL checking 2017-02-24 23:42:49 +01:00
sh.opt Update copyright years. 2017-01-01 13:07:43 +01:00
sh1.md Update copyright years. 2017-01-01 13:07:43 +01:00
sh4-300.md Update copyright years. 2017-01-01 13:07:43 +01:00
sh4.md Update copyright years. 2017-01-01 13:07:43 +01:00
sh4a.md Update copyright years. 2017-01-01 13:07:43 +01:00
sh_optimize_sett_clrt.cc Update copyright years. 2017-01-01 13:07:43 +01:00
sh_treg_combine.cc Update copyright years. 2017-01-01 13:07:43 +01:00
superh.h re PR translation/79019 (translatable string typo in cif-code.def:141) 2017-01-09 22:48:33 +01:00
superh.opt
sync.md Update copyright years. 2017-01-01 13:07:43 +01:00
t-linux t-linux (DEFAULT_ENDIAN, [...]): Remove. 2015-03-26 07:40:44 +00:00
t-rtems
t-sh Update copyright years. 2017-01-01 13:07:43 +01:00
t-vxworks
vxworks.h Update copyright years. 2017-01-01 13:07:43 +01:00