This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/8639: [3.2/3.3 regression] simple integer arithmetic expression broken
- From: bangerth at dealii dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, steveJepsen at netscape dot net
- Date: 19 Nov 2002 15:36:11 -0000
- Subject: Re: c/8639: [3.2/3.3 regression] simple integer arithmetic expression broken
- Reply-to: bangerth at dealii dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, steveJepsen at netscape dot net, gcc-gnats at gcc dot gnu dot org
Old Synopsis: simple integer arithmetic expression broken
New Synopsis: [3.2/3.3 regression] simple integer arithmetic expression broken
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Tue Nov 19 07:36:06 2002
State-Changed-Why:
Unless I am very blind, I think this reduced testcase
should indeed pass the assertion:
-------------------------
#include <assert.h>
int foo (int i) {
int r;
r = (80 - 4 * i) / 20;
assert (r == 3);
}
int main () {
foo(1);
}
-----------------------------
Unfortunately, it aborts, with all gccs since 3.0. It
passes with 2.95, though. Since this seems like a regression
to me, I raise the priority. Note that no optimization
flags are necessary to trigger this behavior. The same
happens with the C++ front end, by the way.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8639