Go to file
Richard Sandiford 5ee31e57d2 PR 69400: Invalid 128-bit modulus result
As described in the PR, wi::divmod_internal was sign- rather than
zero-extending a modulus result in cases where the result has fewer
HWIs than the precision and the upper bit of the upper HWI was set.

This patch tries to make things more robust by getting wi_pack
to handle the canonicalisation step itself.

Tested on x86_64-linux-gnu.  I added tests to the wide-int
plugin since that seemed more direct.

gcc/
	PR tree-optimization/69400
	* wide-int.cc (wi_pack): Take the precision as argument and
	perform canonicalization here rather than in the callers.
	Use the main loop to handle all full-width HWIs.  Add a
	zero HWI if in_len isn't a full result.
	(wi::divmod_internal): Update accordingly.
	(wi::mul_internal): Likewise.  Simplify.

gcc/testsuite/
	PR tree-optimization/69400
	* gcc.dg/plugin/wide-int_plugin.c (test_wide_int_mod_trunc): New
	function.
	(plugin_init): Call it.
	* gcc.dg/torture/pr69400.c: New test.

From-SVN: r232817
2016-01-26 09:53:33 +00:00
INSTALL README: Do not mention CVS. 2014-10-12 15:05:28 +00:00
boehm-gc Testsuite: add dg-{begin|end}-multiline-output commands 2015-10-09 13:55:23 +00:00
config fix PR68343: disable fuse-*.c tests for isl 0.14 or earlier 2016-01-26 00:19:11 +00:00
contrib * uninclude: Fix third argument to gensub. 2016-01-19 22:00:17 +00:00
fixincludes inclhack.def (aix_stdio_inline): New fix. 2015-08-14 07:17:29 -04:00
gcc PR 69400: Invalid 128-bit modulus result 2016-01-26 09:53:33 +00:00
gnattools re PR ada/50048 ("cc1: note: obsolete option -I- used, please use -iquote instead" during bootstrap) 2015-12-06 18:44:56 +00:00
gotools re PR go/66147 (go fails to cross build) 2015-12-02 19:27:58 +00:00
include Merge of HSA 2016-01-19 11:35:10 +01:00
intl Makefile.def (libiconv): Define bootstrap=true. 2015-08-07 01:13:52 -04:00
libada Update copyright years. 2016-01-04 15:30:50 +01:00
libatomic Fix libatomic multilib parallel build (PR other/67627) 2016-01-06 14:51:35 +00:00
libbacktrace Update copyright years. 2016-01-04 15:30:50 +01:00
libcc1 hash-traits.h (free_ptr_hash): New class. 2015-06-25 17:06:24 +00:00
libcilkrts re PR target/66326 (Floating point exception with -mfpmath=387 and -fcilkplus.) 2015-11-09 10:12:34 +00:00
libcpp PR preprocessor/69177 and PR c++/68819: libcpp fallbacks and -Wmisleading-indentation 2016-01-14 19:10:17 +00:00
libdecnumber Update copyright years. 2016-01-04 15:30:50 +01:00
libffi re PR libffi/65441 (FAIL: libffi.call/float2.c -W -Wall -Wno-psabi (test for excess errors)) 2015-10-27 00:39:32 +00:00
libgcc re PR target/69444 (recent changes broke x64_64 -> powerpc crosscompiler build) 2016-01-25 22:37:08 +01:00
libgfortran re PR libfortran/68744 (FAIL: gfortran.dg/backtrace_1.f90 -O0 execution test) 2016-01-23 23:32:13 +00:00
libgo re PR go/68980 (ps -o cmd in gotest isn't portable) 2016-01-11 17:55:39 +00:00
libgomp re PR lto/69393 (ICE in dwarf2out_finish, at dwarf2out.c:27175 with LTO) 2016-01-25 09:31:47 +00:00
libiberty libiberty: {count,dup,write}argv: constify argv input slightly 2016-01-05 20:23:30 +00:00
libitm libitm: Fix HTM fastpath. 2016-01-22 16:13:06 +00:00
libjava gcc.c (process_command): Update copyright notice dates. 2016-01-04 14:03:35 +01:00
libmpx libtool-version: Remove. 2016-01-21 00:17:37 +00:00
libobjc Update copyright years. 2016-01-04 15:30:50 +01:00
liboffloadmic libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_run): Pass extra NULL to GOMP_OFFLOAD_async_run. 2016-01-20 13:40:22 +00:00
libquadmath gcc.c (process_command): Update copyright notice dates. 2016-01-04 14:03:35 +01:00
libsanitizer re PR sanitizer/68824 (libtsan is missing the __interceptor___tls_get_addr symbol without bumping the soname) 2016-01-19 13:45:54 +01:00
libssp libssp: Bump to automake 1.11.6 2015-05-13 11:12:39 +00:00
libstdc++-v3 Avoid including all of <random> in <algorithm> 2016-01-25 16:44:30 +00:00
libvtv configure.ac: Move AM_ENABLE_MULTILIB before GCC_LIBSTDCXX_RAW_CXX_FLAGS. 2015-12-02 18:18:51 +00:00
lto-plugin Fix usage of an uninitialized variable 2016-01-15 14:39:11 +00:00
maintainer-scripts update_version_svn: Add gcc-4_8-branch to IGNORE_BRANCHES. 2015-06-23 07:48:06 +00:00
zlib 2015-11-23 Matthias Klose <doko@ubuntu.com> 2015-11-23 20:27:57 +00:00
.dir-locals.el * .dir-locals.el: Add. 2013-10-16 18:25:31 +00:00
.gitignore Add clang-format config to contrib folder 2015-11-19 12:32:09 +00:00
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
ChangeLog fix PR68343: disable fuse-*.c tests for isl 0.14 or earlier 2016-01-26 00:19:11 +00:00
ChangeLog.jit Merger of dmalcolm/jit branch from git 2014-11-11 21:55:52 +00:00
ChangeLog.tree-ssa
MAINTAINERS Add myself to MAINTAINERS (Write After Approval) 2015-12-18 05:14:15 +00:00
Makefile.def re PR bootstrap/69134 (building a mips-cross compiler with in-tree mpfr-2.4.2 fails) 2016-01-12 15:13:02 +00:00
Makefile.in fix PR68343: disable fuse-*.c tests for isl 0.14 or earlier 2016-01-26 00:19:11 +00:00
Makefile.tpl fix PR68343: disable fuse-*.c tests for isl 0.14 or earlier 2016-01-26 00:19:11 +00:00
README * README: Document use of ranges of years in copyright notices. 2012-07-16 15:01:34 +01:00
compile Update from upstream Automake files. 2014-11-16 14:07:13 +00:00
config-ml.in re PR other/66259 (Combined gcc and binutils build from git-master fails, with gas/as-new not existing) 2015-07-24 12:20:44 -06:00
config.guess config.guess: Import version 2016-01-01. 2016-01-01 08:13:28 +11:00
config.rpath
config.sub config.guess: Import version 2016-01-01. 2016-01-01 08:13:28 +11:00
configure fix PR68343: disable fuse-*.c tests for isl 0.14 or earlier 2016-01-26 00:19:11 +00:00
configure.ac Enable LTO for DJGPP 2016-01-12 20:36:00 +02:00
depcomp Update from upstream Automake files. 2014-11-16 14:07:13 +00:00
install-sh Update from upstream Automake files. 2014-11-16 14:07:13 +00:00
libtool-ldflags re PR sanitizer/56781 (boostrap-asan failure: fixincl fails to link (missing -lasan)) 2014-04-17 14:23:28 +02:00
libtool.m4 * libtool.m4 (export_symbols_cmds) [AIX]: Add global TLS "L" symbols. 2015-11-26 08:20:59 -05:00
ltgcc.m4
ltmain.sh Ensure libgcc_s unwinder is always used on 64-bit Solaris 10+/x86 (PR target/59788) 2014-02-04 09:31:38 +00:00
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
missing Update from upstream Automake files. 2014-11-16 14:07:13 +00:00
mkdep
mkinstalldirs Update from upstream Automake files. 2014-11-16 14:07:13 +00:00
move-if-change Update move-if-change from gnulib 2014-11-16 16:12:44 +00:00
symlink-tree
ylwrap Update from upstream Automake files. 2014-11-16 14:07:13 +00:00

README

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.