------- Comment #8 from jsjodin at gcc dot gnu dot org  2007-12-13 01:56 -------
(In reply to comment #7)
> >+static tree get_generic_type_node_from_size(int size)
> 
> This function needs lots of improvement because the size of the modes is based
> on UNIT_BIT_SIZE (I think that is the macro name) and really you can go from a
> size to a mode and then to a tree type.
> 
> Note this patch really fixes my bug (PR 32964) if PRE is extended to handle
> this too.
> 
Yes I rewrote the patch to always use the first member of a union that match a
specific size. When the expression was extracted (queried from VN function) a
VIEW_CONVERT_EXPR would be insterted if the expected type did not match the
stored expression type. This caused some problems (assertions) in the compiler
that I have not been able to track down yet, although it fixed both my test
cases and for constants it doesn't cause any problems since the expression gets
folded. To avoid introducing VIEW_CONVERT_EXPR it may be possible to return an
expression (from VN) that refers to a union member with a matching type
instead. It would mean that the value number would be the same, but the
returned expression might be different. 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34043

Reply via email to