From patchwork Wed May 20 20:00:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 474624 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 053C6140D5D for ; Thu, 21 May 2015 06:01:24 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=z+bMWGkV; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 986F291EBA; Wed, 20 May 2015 20:01:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4c6C1OUSEK9Q; Wed, 20 May 2015 20:01:20 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 3CAB491EB5; Wed, 20 May 2015 20:01:20 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 7342E1C22C5 for ; Wed, 20 May 2015 20:01:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 995B295415 for ; Wed, 20 May 2015 20:01:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aPBZvltSNNMS for ; Wed, 20 May 2015 20:01:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by hemlock.osuosl.org (Postfix) with ESMTPS id 05179873FA for ; Wed, 20 May 2015 20:01:16 +0000 (UTC) Received: by lbbuc2 with SMTP id uc2so2755216lbb.2 for ; Wed, 20 May 2015 13:01:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=VtfdSKsN4gJYx2RzPEKh5NwMW6DcB93b9rFqQR0SXz8=; b=z+bMWGkVWG/KHlNZpXJG1MipNYpni0sQi/I2Ve3LiOVV/3Rs3b0YC575qn9FPrhZ6Q AnTVGApqQWxZYUT8EK4GUE+gIQEh2DfM6gcLPwzJIXk+Uu9JOlWNbmh8cAQ+Z2/8B5w/ ZI9pNkqF1XHv7GddzMDkEEVHS0Emr3Wd6e/PxfjlwZksh8nnpz3UIhWbYBUwQAffr2T/ EN0pKmg/B+fLdwkPgV/+EJFCqEHXIOXMAlea+ek6ERbWUMUEgb+6rELpH2Vo5ikJDGis 759n64QfsZzmgpjp26/d9jFwAMFBU+CWumdWwVaxfuZFAl+skL4yHdE2ofa+JBErmdUR hf8A== X-Received: by 10.153.6.6 with SMTP id cq6mr1233199lad.13.1432152073846; Wed, 20 May 2015 13:01:13 -0700 (PDT) Received: from octofox.metropolis ([5.19.183.212]) by mx.google.com with ESMTPSA id ej5sm4813690lad.5.2015.05.20.13.01.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 May 2015 13:01:13 -0700 (PDT) From: Max Filippov To: buildroot@uclibc.org Date: Wed, 20 May 2015 23:00:37 +0300 Message-Id: <1432152037-6346-1-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 1.8.1.4 Cc: Thomas Petazzoni Subject: [Buildroot] [PATCH] gcc: fix PR 65730 (ICE on xtensa cores w/o hardware multiplication) X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Max Filippov --- package/gcc/4.7.4/111-pr65730.patch | 37 +++++++++++++++++++++++++++++++++++++ package/gcc/4.8.4/111-pr65730.patch | 37 +++++++++++++++++++++++++++++++++++++ package/gcc/4.9.2/111-pr65730.patch | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 package/gcc/4.7.4/111-pr65730.patch create mode 100644 package/gcc/4.8.4/111-pr65730.patch create mode 100644 package/gcc/4.9.2/111-pr65730.patch diff --git a/package/gcc/4.7.4/111-pr65730.patch b/package/gcc/4.7.4/111-pr65730.patch new file mode 100644 index 0000000..f195e30 --- /dev/null +++ b/package/gcc/4.7.4/111-pr65730.patch @@ -0,0 +1,37 @@ +From b9a7775674d91c7af8043a83211ffeaa576327d7 Mon Sep 17 00:00:00 2001 +From: Max Filippov +Date: Fri, 10 Apr 2015 17:46:30 +0300 +Subject: [PATCH] Fix PR target/65730 + +2015-05-20 Max Filippov +gcc/ + * config/xtensa/xtensa.c (init_alignment_context): Replace MULT + by BITS_PER_UNIT with ASHIFT by exact_log2 (BITS_PER_UNIT). + +Signed-off-by: Max Filippov +--- +Backported from: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223452 +Changes to ChangeLog are dropped. + + gcc/config/xtensa/xtensa.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c +index eb039ba..7296e36 100644 +--- a/gcc/config/xtensa/xtensa.c ++++ b/gcc/config/xtensa/xtensa.c +@@ -1461,8 +1461,9 @@ init_alignment_context (struct alignment_context *ac, rtx mem) + if (ac->shift != NULL_RTX) + { + /* Shift is the byte count, but we need the bitcount. */ +- ac->shift = expand_simple_binop (SImode, MULT, ac->shift, +- GEN_INT (BITS_PER_UNIT), ++ gcc_assert (exact_log2 (BITS_PER_UNIT) >= 0); ++ ac->shift = expand_simple_binop (SImode, ASHIFT, ac->shift, ++ GEN_INT (exact_log2 (BITS_PER_UNIT)), + NULL_RTX, 1, OPTAB_DIRECT); + ac->modemask = expand_simple_binop (SImode, ASHIFT, + GEN_INT (GET_MODE_MASK (mode)), +-- +1.8.1.4 + diff --git a/package/gcc/4.8.4/111-pr65730.patch b/package/gcc/4.8.4/111-pr65730.patch new file mode 100644 index 0000000..f195e30 --- /dev/null +++ b/package/gcc/4.8.4/111-pr65730.patch @@ -0,0 +1,37 @@ +From b9a7775674d91c7af8043a83211ffeaa576327d7 Mon Sep 17 00:00:00 2001 +From: Max Filippov +Date: Fri, 10 Apr 2015 17:46:30 +0300 +Subject: [PATCH] Fix PR target/65730 + +2015-05-20 Max Filippov +gcc/ + * config/xtensa/xtensa.c (init_alignment_context): Replace MULT + by BITS_PER_UNIT with ASHIFT by exact_log2 (BITS_PER_UNIT). + +Signed-off-by: Max Filippov +--- +Backported from: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223452 +Changes to ChangeLog are dropped. + + gcc/config/xtensa/xtensa.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c +index eb039ba..7296e36 100644 +--- a/gcc/config/xtensa/xtensa.c ++++ b/gcc/config/xtensa/xtensa.c +@@ -1461,8 +1461,9 @@ init_alignment_context (struct alignment_context *ac, rtx mem) + if (ac->shift != NULL_RTX) + { + /* Shift is the byte count, but we need the bitcount. */ +- ac->shift = expand_simple_binop (SImode, MULT, ac->shift, +- GEN_INT (BITS_PER_UNIT), ++ gcc_assert (exact_log2 (BITS_PER_UNIT) >= 0); ++ ac->shift = expand_simple_binop (SImode, ASHIFT, ac->shift, ++ GEN_INT (exact_log2 (BITS_PER_UNIT)), + NULL_RTX, 1, OPTAB_DIRECT); + ac->modemask = expand_simple_binop (SImode, ASHIFT, + GEN_INT (GET_MODE_MASK (mode)), +-- +1.8.1.4 + diff --git a/package/gcc/4.9.2/111-pr65730.patch b/package/gcc/4.9.2/111-pr65730.patch new file mode 100644 index 0000000..f195e30 --- /dev/null +++ b/package/gcc/4.9.2/111-pr65730.patch @@ -0,0 +1,37 @@ +From b9a7775674d91c7af8043a83211ffeaa576327d7 Mon Sep 17 00:00:00 2001 +From: Max Filippov +Date: Fri, 10 Apr 2015 17:46:30 +0300 +Subject: [PATCH] Fix PR target/65730 + +2015-05-20 Max Filippov +gcc/ + * config/xtensa/xtensa.c (init_alignment_context): Replace MULT + by BITS_PER_UNIT with ASHIFT by exact_log2 (BITS_PER_UNIT). + +Signed-off-by: Max Filippov +--- +Backported from: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223452 +Changes to ChangeLog are dropped. + + gcc/config/xtensa/xtensa.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c +index eb039ba..7296e36 100644 +--- a/gcc/config/xtensa/xtensa.c ++++ b/gcc/config/xtensa/xtensa.c +@@ -1461,8 +1461,9 @@ init_alignment_context (struct alignment_context *ac, rtx mem) + if (ac->shift != NULL_RTX) + { + /* Shift is the byte count, but we need the bitcount. */ +- ac->shift = expand_simple_binop (SImode, MULT, ac->shift, +- GEN_INT (BITS_PER_UNIT), ++ gcc_assert (exact_log2 (BITS_PER_UNIT) >= 0); ++ ac->shift = expand_simple_binop (SImode, ASHIFT, ac->shift, ++ GEN_INT (exact_log2 (BITS_PER_UNIT)), + NULL_RTX, 1, OPTAB_DIRECT); + ac->modemask = expand_simple_binop (SImode, ASHIFT, + GEN_INT (GET_MODE_MASK (mode)), +-- +1.8.1.4 +