[PATCH] Fix 78550 ICE with bit-field initialization

Nathan Sidwell nathan@acm.org
Thu Dec 8 16:38:00 GMT 2016


This patch fixes 78550, where we ICE in varasm as we discover a 
code-generating NOP_EXPR of an INTEGER_CST.  output_constructor 
(varasm.c) has a STRIP_NOPs, but that leaves the NOP alone, as it is 
truncating a regular QI mode operand to a 1 bit type.

That tree is generated in convert.c:
       /* If TYPE is an enumeral type or a type with a precision less
	 than the number of bits in its mode, do the conversion to the
	 type corresponding to its mode, then do a nop conversion
	 to TYPE.  */
....
	  return fold_build1_loc (dofold, loc, NOP_EXPR, type, ...);
	}
Fixed by changing it to maybe_fold_build1_loc.  Surrounding code uses 
that function.

ok?

nathan
-- 
Nathan Sidwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: init-78550.patch
Type: text/x-patch
Size: 1695 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161208/3727e6b3/attachment.bin>


More information about the Gcc-patches mailing list