https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92328
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Guenther <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:01e9f1812c72c940172700971179d7726b7a3050 commit r10-6107-g01e9f1812c72c940172700971179d7726b7a3050 Author: Richard Biener <rguent...@suse.de> Date: Tue Jan 21 10:37:18 2020 +0100 tree-optimization/92328 fix value-number with bogus type We were actually value-numbering two entities with different type the same rather than just having the same representation in the hashtable. The following fixes that by wrapping the value in a to be inserted VIEW_CONVERT_EXPR. 2020-01-21 Richard Biener <rguent...@suse.de> PR tree-optimization/92328 * tree-ssa-sccvn.c (vn_reference_lookup_3): Preserve type when value-numbering same-sized store by inserting a VIEW_CONVERT_EXPR. (eliminate_dom_walker::eliminate_stmt): When eliminating a redundant store handle bit-reinterpretation of the same value. * gcc.dg/torture/pr92328.c: New testcase.