[PATCH] Constant fold VIEW_CONVERT_EXPR (take 2)

Richard Henderson rth@redhat.com
Wed Apr 12 21:49:00 GMT 2006


On Wed, Apr 12, 2006 at 08:01:56AM -0600, Roger Sayle wrote:
> + native_encode_expr (tree expr, unsigned char *ptr, int len)

I think this should be split into native_encode_{int,real,...}
with native_encode_expr calling them.  Use a switch.  At present
the function is on the "too big" side.

> + native_interpret_expr (tree type, unsigned char *ptr, int len)

Likewise.

>         if (TREE_CODE (op0) == VIEW_CONVERT_EXPR)
> ! 	return fold_build1 (VIEW_CONVERT_EXPR, type, TREE_OPERAND (op0, 0));
> !       if (TREE_CODE (op0) == INTEGER_CST
> ! 	  || TREE_CODE (op0) == REAL_CST
> ! 	  || TREE_CODE (op0) == COMPLEX_CST
> ! 	  || TREE_CODE (op0) == VECTOR_CST)
> ! 	return fold_view_convert_expr (type, op0);

Why are you encoding this information here?  You should be able
to just call this function and get your null.


r~



More information about the Gcc-patches mailing list