This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/33615] New: Hoisting of potentially-throwing values for -fnon-call-exceptions
- From: "rsandifo at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Oct 2007 21:40:47 -0000
- Subject: [Bug tree-optimization/33615] New: Hoisting of potentially-throwing values for -fnon-call-exceptions
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
If the following C++ code is compiled with -fnon-call-exceptions,
the tree optimisers still hoist 1.0 / 0.0:
---------------------------------------------------------
extern volatile int y;
double
foo (double a, int x)
{
while (x--)
{
y++;
a += 1.0 / 0.0;
}
return a;
}
---------------------------------------------------------
Header copying ensures that 1.0 / 0.0 is only executed when the
incoming x is nonzero, but the division happens before the
assignment to "y".
At -O, the hoisting is done by LIM; at -O2, it's done be PRE.
--
Summary: Hoisting of potentially-throwing values for -fnon-call-
exceptions
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rsandifo at gcc dot gnu dot org
GCC build triplet: x86_64-linux-gnu
GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33615