This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/27116] [4.2 Regression] Incorrect integer division (wrong sign).
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jun 2006 14:56:45 -0000
- Subject: [Bug middle-end/27116] [4.2 Regression] Incorrect integer division (wrong sign).
- References: <bug-27116-12512@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #22 from rguenth at gcc dot gnu dot org 2006-06-16 14:56 -------
Subject: Bug 27116
Author: rguenth
Date: Fri Jun 16 14:56:34 2006
New Revision: 114723
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114723
Log:
2006-06-16 Richard Guenther <rguenther@suse.de>
PR middle-end/27116
* fold-const.c (negate_expr_p): Do not introduce undefined
overflow in negating INTEGER_CSTs.
(fold_negate_expr): Rename from negate_expr. Revert last
change for folding BIT_NOT_EXPR. Change semantics to
return NULL_TREE for non-simplified negations. Do not
strip type conversions and unify type handling.
(negate_expr): New function, wrap around fold_negate_expr
but ensure building a tree always. Strip type conversions
here, fold to result type.
(fold_unary): Use fold_negate_expr for folding NEGATE_EXPR.
* gcc.dg/pr15785-1.c: Revert last change.
* gcc.dg/torture/pr27116-2.c: New testcase.
Added:
trunk/gcc/testsuite/gcc.dg/torture/pr27116-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/pr15785-1.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27116