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

gcc/gcc ChangeLog fold-const.c


CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	sayle@gcc.gnu.org	2003-10-11 21:15:09

Modified files:
	gcc            : ChangeLog fold-const.c 

Log message:
	* fold-const.c (negate_mathfn_p): New function to determine whether
	a built-in mathematical function is sign preserving, f(-x) == -f(x).
	Add support for BUILT_IN_ASIN, BUILT_IN_ASINF and BUILT_IN_ASINL.
	(tree_swap_operands_p): Change API to take an additional argument
	indicating that the swapped operands evaluate in reverse order.
	Canonicalize VAR_DECLs and PARM_DECLs last if we can, i.e. neither
	operand side-effects or we don't care about flag_evaluation_order.
	(reorder_operands_p): New function to check whether its safe to
	evaluate the given operands in reverse order.
	(negate_expr_p):  We can always negate integer constants unless
	we honor -ftrapv and the signed type would overflow.  Only allow
	-(A-B) into B-A if reorder_operands_p says that its OK.  Allow
	negation of COMPLEX_CST if both real and imaginary parts can be
	negated.  Allow negation through floating point extensions and
	sign-preserving built-in functions.
	(negate_expr):  Move the code to negate integers from "fold" to
	here.  Always negate integer constants unless we honor -ftrapv
	and the signed type would overflow.  Always negate real constants
	unless we honor -ftrapping-math.  Only convert -(A-B) into B-A
	if allowed by reorder_operands_p.  Add support for COMPLEX_CST.
	Optimize negation through floating point extensions and
	sign-preserving built-in functions (as defined by negate_mathfn_p).
	(fold): Adjust calls to tree_swap_operands_p.
	(fold <NEGATE_EXPR>): Move the remaining negation optimizations
	to negate_expr_p/negate_expr.
	(fold <MINUS_EXPR>): Use reorder_operands_p to check whether we're
	allowed to convert (-A) - B into (-B) - A.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.1387&r2=2.1388
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fold-const.c.diff?cvsroot=gcc&r1=1.312&r2=1.313


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