From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59979 invoked by alias); 27 Jan 2020 10:16:48 -0000 Mailing-List: contact gcc-cvs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-cvs-owner@gcc.gnu.org Received: (qmail 17489 invoked by uid 10008); 27 Jan 2020 10:14:41 -0000 Date: Mon, 27 Jan 2020 10:17:00 -0000 Message-ID: <20200127101441.17488.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/marxin/heads/PR93274-make-resolver-static-v2)] i386: Fix up *{add, sub}v4_doubleword patterns (PR target/93412) X-Act-Checkin: gcc X-Git-Author: Jakub Jelinek X-Git-Refname: refs/users/marxin/heads/PR93274-make-resolver-static-v2 X-Git-Oldrev: 322db86f4b4df1261308e8a02e69018d9cea98e9 X-Git-Newrev: a9947bac0799b0c91e21b7c612b80cd0b54016f0 X-SW-Source: 2020-01/txt/msg04251.txt.bz2 https://gcc.gnu.org/g:a9947bac0799b0c91e21b7c612b80cd0b54016f0 commit a9947bac0799b0c91e21b7c612b80cd0b54016f0 Author: Jakub Jelinek Date: Sun Jan 26 12:12:36 2020 +0100 i386: Fix up *{add,sub}v4_doubleword patterns (PR target/93412) In the *{add,sub}v4_doubleword patterns, we don't really want to see a VOIDmode last operand, because it then means invalid RTL (sign_extend:{TI,POI} (const_int ...)) or so, and therefore something we don't really handle in the splitter either. We have *{add,sub}v4_doubleword_1 pattern for those and that is what combine will match, the problem in this testcase is just that it was only RA that propagated the constant into the instruction. In the similar *{add,sub}v4 patterns, we make sure not to accept VOIDmode operand and similarly to these have _1 suffixed variant that allows constants. 2020-01-26 Jakub Jelinek PR target/93412 * config/i386/i386.md (*addv4_doubleword, *subv4_doubleword): Use nonimmediate_operand instead of x86_64_hilo_general_operand and drop from constraint of last operand. * gcc.dg/pr93412.c: New test. Diff: --- gcc/ChangeLog | 5 +++++ gcc/config/i386/i386.md | 4 ++-- gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/gcc.dg/pr93412.c | 15 +++++++++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index db62a7a..420a124 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2020-01-26 Jakub Jelinek + PR target/93412 + * config/i386/i386.md (*addv4_doubleword, *subv4_doubleword): + Use nonimmediate_operand instead of x86_64_hilo_general_operand and + drop from constraint of last operand. + PR target/93430 * config/i386/sse.md (*avx_vperm_broadcast_): Disallow for TARGET_AVX2 and V4DFmode not in the split condition, but in the diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 98d452a..6e9c9bd 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -6135,7 +6135,7 @@ (sign_extend: (match_operand: 1 "nonimmediate_operand" "%0,0")) (sign_extend: - (match_operand: 2 "x86_64_hilo_general_operand" "r,o"))) + (match_operand: 2 "nonimmediate_operand" "r,o"))) (sign_extend: (plus: (match_dup 1) (match_dup 2))))) (set (match_operand: 0 "nonimmediate_operand" "=ro,r") @@ -6644,7 +6644,7 @@ (sign_extend: (match_operand: 1 "nonimmediate_operand" "0,0")) (sign_extend: - (match_operand: 2 "x86_64_hilo_general_operand" "r,o"))) + (match_operand: 2 "nonimmediate_operand" "r,o"))) (sign_extend: (minus: (match_dup 1) (match_dup 2))))) (set (match_operand: 0 "nonimmediate_operand" "=ro,r") diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 860d56d..0cbd048 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2020-01-26 Jakub Jelinek + PR target/93412 + * gcc.dg/pr93412.c: New test. + PR target/93430 * gcc.dg/pr93430.c: New test. * gcc.target/i386/avx2-pr93430.c: New test. diff --git a/gcc/testsuite/gcc.dg/pr93412.c b/gcc/testsuite/gcc.dg/pr93412.c new file mode 100644 index 0000000..ba82ae1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr93412.c @@ -0,0 +1,15 @@ +/* PR target/93412 */ +/* { dg-do compile { target int128 } } */ +/* { dg-options "-Og" } */ + +unsigned char a; +int b; +unsigned c; + +int +foo (int e, int f, int g, int h, int k, int i, short j) +{ + b = __builtin_add_overflow (a, 0, &c); + b = __builtin_add_overflow_p (b, a, (unsigned __int128) 0) ? b : 0; + return e + f + g + a + h + k + i + j + c; +}