From afc9595cf9564a0aadb0350b928b4e0469b01b20 Mon Sep 17 00:00:00 2001 From: angie Date: Fri, 27 Jan 2023 12:07:44 -0300 Subject: [PATCH] Fix incorrect emitted `subu` instead of `addu`. From https://github.com/pmret/gcc-papermario/commit/1c2496114eef228715cafd473f28da7771548804 --- .github/workflows/build.yml | 2 +- .gitignore | 7 +++++++ gcc/cse.c | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 96c2aac..e8134ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: if: matrix.TARGET.OS == 'ubuntu-20.04' run: | sudo apt-get update - sudo apt-get install -y build-essential bison file gperf gcc gcc-multilib + sudo apt-get install -y build-essential bison file gperf gcc gcc-multilib autoconf - name: Configure for mips shell: bash run: | diff --git a/.gitignore b/.gitignore index 6aa69e0..c9b4849 100644 --- a/.gitignore +++ b/.gitignore @@ -135,3 +135,10 @@ gcc/tree-check.h gcc/unprotoize gcc/xgcc gcc/xlimits.h + +gcc/autom4te.cache/requests +gcc/autom4te.cache/output.* +gcc/autom4te.cache/traces.* +gcc/config.in~ +gcc/config.bak +gcc/configure~ diff --git a/gcc/cse.c b/gcc/cse.c index cfcc4fa..3c00b10 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -5602,7 +5602,7 @@ fold_rtx (x, insn) hence not save anything) or be incorrect. */ if (const_arg1 != 0 && GET_CODE (const_arg1) == CONST_INT && INTVAL (const_arg1) < 0 - && - INTVAL (const_arg1) >= 0 + && (-INTVAL (const_arg1) >> 0x1f) >= 0 && GET_CODE (folded_arg1) == REG) { rtx new_const = GEN_INT (- INTVAL (const_arg1));