This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/33258] guaranteed-true arithmetic test not optimized away depending on constant
- From: "raeburn at raeburn dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Sep 2007 01:43:15 -0000
- Subject: [Bug rtl-optimization/33258] guaranteed-true arithmetic test not optimized away depending on constant
- References: <bug-33258-11337@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from raeburn at raeburn dot org 2007-09-02 01:43 -------
After a little more experimentation, it appears that the signed-math cases that
do get optimized are those with positive divisors that are not powers of two.
If the divisors are powers of two (so that the operations can be done with
shifts and masks?), or are negative, then the test and abort call don't get
optimized away.
(There's an edge case with INT_MIN/-1 possibly yielding undefined results
without -fwrapv. I didn't test -1, but did test a handful of other negative
numbers, where the results should be fully defined.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33258