This is the mail archive of the gcc-patches@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]

Re: i * i is nonnegative


On 03/19/2013 10:08 AM, Marc Glisse wrote:
Hello,

this patch extends the property that x*x is non-negative, which was
already known for floats, to integers with undefined overflow.

2013-03-19  Marc Glisse  <marc.glisse@inria.fr>

     PR tree-optimization/56355
gcc/
     * fold-const.c (tree_binary_nonnegative_warnv_p) <MULT_EXPR>:
     Also handle integers with undefined overflow.

gcc/testsuite/
     * gcc.dg/pr56355-1.c: New file.
Fine for the trunk. Though I would suggest waiting for http service & web archives to return before committing.

BTW, did you check if VRP creates a non-negative range for this case as well?

jeff


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