+2015-09-21 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/spu/spu.c (spu_expand_insv): Avoid undefined behavior.
+
2015-09-21 Richard Biener <rguenther@suse.de>
* passes.c (rest_of_decl_compilation): Do not call
{
HOST_WIDE_INT width = INTVAL (ops[1]);
HOST_WIDE_INT start = INTVAL (ops[2]);
- HOST_WIDE_INT maskbits;
+ unsigned HOST_WIDE_INT maskbits;
machine_mode dst_mode;
rtx dst = ops[0], src = ops[3];
int dst_size;
switch (dst_size)
{
case 32:
- maskbits = (-1ll << (32 - width - start));
+ maskbits = (~(unsigned HOST_WIDE_INT)0 << (32 - width - start));
if (start)
- maskbits += (1ll << (32 - start));
+ maskbits += ((unsigned HOST_WIDE_INT)1 << (32 - start));
emit_move_insn (mask, GEN_INT (maskbits));
break;
case 64:
- maskbits = (-1ll << (64 - width - start));
+ maskbits = (~(unsigned HOST_WIDE_INT)0 << (64 - width - start));
if (start)
- maskbits += (1ll << (64 - start));
+ maskbits += ((unsigned HOST_WIDE_INT)1 << (64 - start));
emit_move_insn (mask, GEN_INT (maskbits));
break;
case 128: