Commit f85242f0 by Roger Sayle Committed by Roger Sayle

fold-const.c (fold_unary): Optimize away a VIEW_CONVERT_EXPR to the same type as it's operand.


	* fold-const.c (fold_unary) <VIEW_CONVERT_EXPR>: Optimize away a
	VIEW_CONVERT_EXPR to the same type as it's operand.

From-SVN: r120945
parent 63d71dea
2007-01-18 Roger Sayle <roger@eyesopen.com>
* fold-const.c (fold_unary) <VIEW_CONVERT_EXPR>: Optimize away a
VIEW_CONVERT_EXPR to the same type as it's operand.
2007-01-18 David Edelsohn <edelsohn@gnu.org> 2007-01-18 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/darwin-ldouble.c: Only build _SOFT_FLOAT if * config/rs6000/darwin-ldouble.c: Only build _SOFT_FLOAT if
......
...@@ -7573,6 +7573,8 @@ fold_unary (enum tree_code code, tree type, tree op0) ...@@ -7573,6 +7573,8 @@ fold_unary (enum tree_code code, tree type, tree op0)
return tem ? tem : NULL_TREE; return tem ? tem : NULL_TREE;
case VIEW_CONVERT_EXPR: case VIEW_CONVERT_EXPR:
if (TREE_TYPE (op0) == type)
return op0;
if (TREE_CODE (op0) == VIEW_CONVERT_EXPR) if (TREE_CODE (op0) == VIEW_CONVERT_EXPR)
return fold_build1 (VIEW_CONVERT_EXPR, type, TREE_OPERAND (op0, 0)); return fold_build1 (VIEW_CONVERT_EXPR, type, TREE_OPERAND (op0, 0));
return fold_view_convert_expr (type, op0); return fold_view_convert_expr (type, op0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment