Commit c4362b60 by Jeff Law Committed by Jeff Law

[PATCH] Fix undefined behaviour in cris port

[PATCH] Fix undefined behaviour in cris port
	* config/cris/cris.md (asrandb): Fix left shift undefined
	behaviour.
	(asrandw): Likewise.

From-SVN: r228163
parent 01a8b92d
2015-09-26 Jeff Law <law@redhat.com>
* config/cris/cris.md (asrandb): Fix left shift undefined
behaviour.
(asrandw): Likewise.
2015-09-25 Vladimir Makarov <vmakarov@redhat.com> 2015-09-25 Vladimir Makarov <vmakarov@redhat.com>
PR target/61578 PR target/61578
...@@ -4634,7 +4634,8 @@ ...@@ -4634,7 +4634,8 @@
&& INTVAL (operands[1]) > 23 && INTVAL (operands[1]) > 23
/* Check that the and-operation enables us to use logical-shift. */ /* Check that the and-operation enables us to use logical-shift. */
&& (INTVAL (operands[2]) && (INTVAL (operands[2])
& ((HOST_WIDE_INT) -1 << (32 - INTVAL (operands[1])))) == 0" & ((HOST_WIDE_INT) (HOST_WIDE_INT_M1U
<< (32 - INTVAL (operands[1]))))) == 0"
[(set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 1))) [(set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 1)))
(set (match_dup 3) (and:QI (match_dup 3) (match_dup 4)))] (set (match_dup 3) (and:QI (match_dup 3) (match_dup 4)))]
;; FIXME: CC0 is valid except for the M bit. ;; FIXME: CC0 is valid except for the M bit.
...@@ -4655,7 +4656,8 @@ ...@@ -4655,7 +4656,8 @@
&& INTVAL (operands[1]) > 15 && INTVAL (operands[1]) > 15
/* Check that the and-operation enables us to use logical-shift. */ /* Check that the and-operation enables us to use logical-shift. */
&& (INTVAL (operands[2]) && (INTVAL (operands[2])
& ((HOST_WIDE_INT) -1 << (32 - INTVAL (operands[1])))) == 0" & ((HOST_WIDE_INT) (HOST_WIDE_INT_M1U
<< (32 - INTVAL (operands[1]))))) == 0"
[(set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 1))) [(set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 1)))
(set (match_dup 3) (and:HI (match_dup 3) (match_dup 4)))] (set (match_dup 3) (and:HI (match_dup 3) (match_dup 4)))]
;; FIXME: CC0 is valid except for the M bit. ;; FIXME: CC0 is valid except for the M bit.
......
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