diff options
author | Bernd Schmidt <bernds_cb1@t-online.de> | 2019-11-24 13:08:27 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2019-11-24 13:08:27 +0000 |
commit | cc2ccbcedd20d4d800b5e1a79c98f2c3ad6c9bf2 (patch) | |
tree | b259e841ea59fe7572ca4902447d6abfa60aeb94 /gcc | |
parent | 74bc2a43ce3708829a6aeb0a10e27bc5b753f8ce (diff) | |
download | gcc-cc2ccbcedd20d4d800b5e1a79c98f2c3ad6c9bf2.zip gcc-cc2ccbcedd20d4d800b5e1a79c98f2c3ad6c9bf2.tar.gz gcc-cc2ccbcedd20d4d800b5e1a79c98f2c3ad6c9bf2.tar.bz2 |
Fix ix86 rtx costs for the pr30315 testcase (PR target/30315)
* config/i386/i386.c (ix86_rtx_costs): Handle care of a PLUS in a
COMPARE, representing an overflow detection.
From-SVN: r278654
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f26529c..cd4b96d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-11-24 Bernd Schmidt <bernds_cb1@t-online.de> + + * config/i386/i386.c (ix86_rtx_costs): Handle care of a PLUS in a + COMPARE, representing an overflow detection. + 2019-11-23 Jan Hubicka <hubicka@ucw.cz> * cif-code.def (MAX_INLINE_INSNS_SINGLE_O2_LIMIT): Remove. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 780ebb8..04cbbd5 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -19501,6 +19501,15 @@ ix86_rtx_costs (rtx x, machine_mode mode, int outer_code_i, int opno, return true; } + if (GET_CODE (XEXP (x, 0)) == PLUS + && rtx_equal_p (XEXP (XEXP (x, 0), 0), XEXP (x, 1))) + { + /* This is an overflow detection, count it as a normal compare. */ + *total = rtx_cost (XEXP (x, 0), GET_MODE (XEXP (x, 0)), + COMPARE, 0, speed); + return true; + } + /* The embedded comparison operand is completely free. */ if (!general_operand (XEXP (x, 0), GET_MODE (XEXP (x, 0))) && XEXP (x, 1) == const0_rtx) |