From: Kyrylo Tkachov Date: Tue, 10 Apr 2018 13:05:24 +0000 (+0000) Subject: [AArch64] PR target/84748: Mark *compare_cstore_insn as clobbering CC reg X-Git-Tag: releases/gcc-6.5.0~392 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68d980fc30076a1bd9a4e631fd226c020a95c142;p=thirdparty%2Fgcc.git [AArch64] PR target/84748: Mark *compare_cstore_insn as clobbering CC reg Backport from mainline 2018-03-08 Kyrylo Tkachov PR target/84748 * config/aarch64/aarch64.md (*compare_cstore_insn): Mark pattern as clobbering CC_REGNUM. * gcc.c-torture/execute/pr84748.c: New test. From-SVN: r259271 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2186cef8198e..4b5ee7cd8f4b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2018-04-10 Kyrylo Tkachov + + Backport from mainline + 2018-03-08 Kyrylo Tkachov + + PR target/84748 + * config/aarch64/aarch64.md (*compare_cstore_insn): Mark pattern + as clobbering CC_REGNUM. + 2018-04-06 Eric Botcazou PR target/85196 diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 2c9f48cb79e5..d0517f9cd02a 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -3081,7 +3081,8 @@ (define_insn_and_split "*compare_cstore_insn" [(set (match_operand:GPI 0 "register_operand" "=r") (EQL:GPI (match_operand:GPI 1 "register_operand" "r") - (match_operand:GPI 2 "aarch64_imm24" "n")))] + (match_operand:GPI 2 "aarch64_imm24" "n"))) + (clobber (reg:CC CC_REGNUM))] "!aarch64_move_imm (INTVAL (operands[2]), mode) && !aarch64_plus_operand (operands[2], mode) && !reload_completed" diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4101bf9e3b07..955b32d233ba 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2018-04-10 Kyrylo Tkachov + + Backport from mainline + 2018-03-08 Kyrylo Tkachov + + PR target/84748 + * gcc.c-torture/execute/pr84748.c: New test. + 2018-04-06 Eric Botcazou * g++.dg/opt/pr85196.C: New test. diff --git a/gcc/testsuite/gcc.c-torture/execute/pr84748.c b/gcc/testsuite/gcc.c-torture/execute/pr84748.c new file mode 100644 index 000000000000..9572ab285c66 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr84748.c @@ -0,0 +1,34 @@ +/* { dg-require-effective-target int128 } */ + +typedef unsigned __int128 u128; + +int a, c, d; +u128 b; + +unsigned long long g0, g1; + +void +store (unsigned long long a0, unsigned long long a1) +{ + g0 = a0; + g1 = a1; +} + +void +foo (void) +{ + b += a; + c = d != 84347; + b /= c; + u128 x = b; + store (x >> 0, x >> 64); +} + +int +main (void) +{ + foo (); + if (g0 != 0 || g1 != 0) + __builtin_abort (); + return 0; +}