Commit 3d0b75de by Guozhi Wei Committed by Wei Guozhi

re PR target/62262 (aarch64 gcc generates invalid assembler)

	PR target/62262
	* config/aarch64/aarch64.md (*andim_ashift<mode>_bfiz): Check the shift
	amount before using it.

	* gcc.target/aarch64/pr62262.c: New test.

From-SVN: r214578
parent dcb7fae2
2014-08-27 Guozhi Wei <carrot@google.com>
PR target/62262
* config/aarch64/aarch64.md (*andim_ashift<mode>_bfiz): Check the shift
amount before using it.
2014-08-27 Richard Biener <rguenther@suse.de> 2014-08-27 Richard Biener <rguenther@suse.de>
* gimple-fold.c (get_maxval_strlen): Add overload wrapping * gimple-fold.c (get_maxval_strlen): Add overload wrapping
......
...@@ -3431,7 +3431,8 @@ ...@@ -3431,7 +3431,8 @@
(and:GPI (ashift:GPI (match_operand:GPI 1 "register_operand" "r") (and:GPI (ashift:GPI (match_operand:GPI 1 "register_operand" "r")
(match_operand 2 "const_int_operand" "n")) (match_operand 2 "const_int_operand" "n"))
(match_operand 3 "const_int_operand" "n")))] (match_operand 3 "const_int_operand" "n")))]
"exact_log2 ((INTVAL (operands[3]) >> INTVAL (operands[2])) + 1) >= 0 "(INTVAL (operands[2]) < (<GPI:sizen>))
&& exact_log2 ((INTVAL (operands[3]) >> INTVAL (operands[2])) + 1) >= 0
&& (INTVAL (operands[3]) & ((1 << INTVAL (operands[2])) - 1)) == 0" && (INTVAL (operands[3]) & ((1 << INTVAL (operands[2])) - 1)) == 0"
"ubfiz\\t%<w>0, %<w>1, %2, %P3" "ubfiz\\t%<w>0, %<w>1, %2, %P3"
[(set_attr "type" "bfm")] [(set_attr "type" "bfm")]
......
2014-08-27 Guozhi Wei <carrot@google.com>
PR target/62262
* gcc.target/aarch64/pr62262.c: New test.
2014-08-26 Joseph Myers <joseph@codesourcery.com> 2014-08-26 Joseph Myers <joseph@codesourcery.com>
PR target/60606 PR target/60606
......
/* { dg-do compile } */
/* { dg-options "-O2 -fprofile-use" } */
static inline int CLZ(int mask) {
return mask ? __builtin_clz(mask) : 32;
}
int foo(int value)
{
if (value == 0)
return 0;
int bias = CLZ(value);
value >>= bias;
int zeros = CLZ(value << 1);
value <<= zeros;
int packed = (unsigned)(value << 9) >> 9;
return packed;
}
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