This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/56917] -ftrapv detects a overflow wrongly.
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 18 Jun 2015 14:47:51 +0000
- Subject: [Bug middle-end/56917] -ftrapv detects a overflow wrongly.
- Auto-submitted: auto-generated
- References: <bug-56917-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56917
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Thu Jun 18 14:47:18 2015
New Revision: 224617
URL: https://gcc.gnu.org/viewcvs?rev=224617&root=gcc&view=rev
Log:
2015-06-18 Richard Biener <rguenther@suse.de>
Backport from mainline
2014-12-04 Marek Polacek <polacek@redhat.com>
PR middle-end/56917
* fold-const.c (fold_unary_loc): Perform the negation in A's type
when transforming ~ (A - 1) or ~ (A + -1) to -A.
* g++.dg/other/const4.C: New testcase.
Added:
branches/gcc-4_8-branch/gcc/testsuite/g++.dg/other/const4.C
Modified:
branches/gcc-4_8-branch/gcc/ChangeLog
branches/gcc-4_8-branch/gcc/fold-const.c
branches/gcc-4_8-branch/gcc/testsuite/ChangeLog