This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/33258] guaranteed-true arithmetic test not optimized away depending on constant



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]