Commit d7b00a16 by Jeff Law Committed by Jeff Law

[PATCH] Fix undefined behavior in h8300 backend

	* config/h8300/h8300.md (andsi3_ashift_n_lower): Avoid undefined
	behavior.

	* gcc.target/h8300/andsi3_ashift_n_lower.c: New test.

From-SVN: r227978
parent bdaaa8b7
2015-09-21 Jeff Law <law@redhat.com>
* config/h8300/h8300.md (andsi3_ashift_n_lower): Avoid undefined
behavior.
2015-09-21 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> 2015-09-21 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* config/spu/spu.c (spu_expand_insv): Avoid undefined behavior. * config/spu/spu.c (spu_expand_insv): Avoid undefined behavior.
...@@ -3914,7 +3914,8 @@ ...@@ -3914,7 +3914,8 @@
(clobber (match_scratch:QI 4 "=X,&r"))] (clobber (match_scratch:QI 4 "=X,&r"))]
"(TARGET_H8300H || TARGET_H8300S) "(TARGET_H8300H || TARGET_H8300S)
&& INTVAL (operands[2]) <= 15 && INTVAL (operands[2]) <= 15
&& INTVAL (operands[3]) == ((-1 << INTVAL (operands[2])) & 0xffff)" && UINTVAL (operands[3]) == ((HOST_WIDE_INT_M1U << INTVAL (operands[2]))
& 0xffff)"
"#" "#"
"&& reload_completed" "&& reload_completed"
[(parallel [(set (match_dup 5) [(parallel [(set (match_dup 5)
......
2015-09-21 Jeff Law <law@redhat.com>
* gcc.target/h8300/andsi3_ashift_n_lower.c: New test.
2015-09-21 Ville Voutilainen <ville.voutilainen@gmail.com> 2015-09-21 Ville Voutilainen <ville.voutilainen@gmail.com>
Complete the implementation of N4230, Nested namespace definition. Complete the implementation of N4230, Nested namespace definition.
......
/* { dg-do compile } */
/* { dg-options "-mh -O2 -fomit-frame-pointer" } */
/* { dg-final { scan-assembler-times "extu" 1 } } */
unsigned long foo(unsigned long a)
{ return (a << 4) & 0xffff; }
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