This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/29186] optimzation breaks floating point exception flag reading
- 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: 19 Nov 2006 12:14:38 -0000
- Subject: [Bug c/29186] optimzation breaks floating point exception flag reading
- References: <bug-29186-1882@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #19 from rguenth at gcc dot gnu dot org 2006-11-19 12:14 -------
The problem is that the division is in no ways special to optimizers. One
possibility I see would be to introduce either a builtin function or a new
tree-code to access the exception flags. Of course the fact that flags are
supposed to accumulate doesn't help to simplify things here...
It would be the frontends task to emit compound expressions. Like instead
of
D.2529 = x / y;
emit
{ D.2529 = x / y; __builtin_update_except (D.2529); }
(note that __builtin_update_except has to be subject to read/write global
memory to support exception flow across the call-graph).
I bet it's a mess to optimize this stuff correctly without some "clever"
hacks. Like
{ D.2529 = x / y; *__builtin_flags = __builtin_update_except (D.2529,
*__builtin_flags); }
where we can then make __builtin_update_except const [ideally *__builtin_flags
would just be a special alias tag used and clobbered by the various
exception functions]
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29186