Commit 54c43004 by Richard Biener Committed by Richard Biener

re PR c++/82084 (ICE: constructing wstring with -O3)

2017-09-05  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82084
	* fold-const.c (can_native_encode_string_p): Handle wide characters.

From-SVN: r251711
parent d3b080bc
2017-09-05 Richard Biener <rguenther@suse.de> 2017-09-05 Richard Biener <rguenther@suse.de>
PR tree-optimization/82084
* fold-const.c (can_native_encode_string_p): Handle wide characters.
2017-09-05 Richard Biener <rguenther@suse.de>
PR tree-optimization/82102 PR tree-optimization/82102
* tree-ssa-pre.c (fini_eliminate): Check if lhs is NULL. * tree-ssa-pre.c (fini_eliminate): Check if lhs is NULL.
......
...@@ -7489,10 +7489,11 @@ can_native_encode_string_p (const_tree expr) ...@@ -7489,10 +7489,11 @@ can_native_encode_string_p (const_tree expr)
{ {
tree type = TREE_TYPE (expr); tree type = TREE_TYPE (expr);
if (TREE_CODE (type) != ARRAY_TYPE /* Wide-char strings are encoded in target byte-order so native
encoding them is trivial. */
if (BITS_PER_UNIT != CHAR_BIT
|| TREE_CODE (type) != ARRAY_TYPE
|| TREE_CODE (TREE_TYPE (type)) != INTEGER_TYPE || TREE_CODE (TREE_TYPE (type)) != INTEGER_TYPE
|| (GET_MODE_BITSIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (type)))
!= BITS_PER_UNIT)
|| !tree_fits_shwi_p (TYPE_SIZE_UNIT (type))) || !tree_fits_shwi_p (TYPE_SIZE_UNIT (type)))
return false; return false;
return true; return true;
......
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