This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/31130] [4.3 Regression] VRP no longer derives range for division after negation
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Mar 2007 06:11:59 -0000
- Subject: [Bug tree-optimization/31130] [4.3 Regression] VRP no longer derives range for division after negation
- References: <bug-31130-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from pinskia at gcc dot gnu dot org 2007-03-12 06:11 -------
How about:
extern void link_error ();
void foo (int a)
{
if (a < 0)
{
int y;
a *=-2;
y = a / 7;
if (y > 1 << 30)
link_error ();
}
}
int main()
{
return 0;
}
Also? Which is like the below testcase but is not just a = -a;
In fact it is weird to have:
extern void link_error ();
void foo (int a)
{
if (a < 0)
{
int y;
y = -a / 7;
if (y > 1 << 30)
link_error ();
}
}
Work and not the testcase in comment #0 to work :) In fact -Wstrict-overflow
does not even warn about the above testcase :), even though the transformation
between -a / 7 to a/-7 dependings on integer overflow being undefined. Looks
like someone missed a case in fold-const.c :). (note I added it so I
remembered about it).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31130