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: [C++ PATCH] Fix static_cast overflow handling (PR c++/23056)(take 2)


Jakub Jelinek wrote:
On Mon, Sep 05, 2005 at 02:30:23PM +0200, Giovanni Bajo wrote:

Ok to commit for HEAD/4.0 (4.0/4.1 regression) if bootstrap/regtesting
succeeds?

Surely you can factor out the new code into a function, to avoid duplication?

This is OK, with a minor change:


+/* Ignore any integer overflow caused by the static cast of ORIG
+   to EXPR.  */
+
+static tree
+ignore_static_cast_overflows (tree expr, tree orig)

Let's call this "ignore_overflows" and change the comment to say:


/* If EXPR is an INTEGER_CST and ORIG is an arithmetic constant, return a version of EXPR that has TREE_OVERFLOW and/or TREE_CONSTANT_OVERFLOW set iff they are set in ORIG. Otherwise, return EXPR unchanged. */

Thanks,

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304


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