From patchwork Fri Jul 27 13:09:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jozef Lawrynowicz X-Patchwork-Id: 950172 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-482528-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mittosystems.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="EEF6rk+S"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mittosystems.com header.i=@mittosystems.com header.b="eX7rMdlZ"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41cTnb2wQ6z9ryl for ; Fri, 27 Jul 2018 23:09:22 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=swmyCfhG1JjdtvCBvDqQTmkUP+W6cRR3ZMRsrqMYHI36o2VCWB Fmu2HOX10UCsSB4R5mQ78S6gqK5aMM/uSz9KNp8pZKmxXdibFTuBqFueEjtSXalk pDRamkdoi18oi/Vi5VlNthFAO8Oz8cTpsXZSz5qvLenS2IPLzxHeGoMHo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=cf5Oo6I702b6WQ6n2W8nNYILDLU=; b=EEF6rk+SPy+998zX3baX mmXKnxwIytdBrTlRve1450mX5MXbfaVorPxwE/WrcBQ0dcSDHuFfitxMz04hARew t13VImER+qyVddTSCZECdfIMH1kXZc0QTlxMbHHKRAD6FeV0azLoaet0ETKej6a9 yaTzN35oHbcXsySafvls/Xo= Received: (qmail 102417 invoked by alias); 27 Jul 2018 13:09:15 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 102404 invoked by uid 89); 27 Jul 2018 13:09:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=dgskipif, dg-skip-if, HX-Received:sk:j7-v6mr, bitsize X-HELO: mail-wm0-f49.google.com Received: from mail-wm0-f49.google.com (HELO mail-wm0-f49.google.com) (74.125.82.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 27 Jul 2018 13:09:13 +0000 Received: by mail-wm0-f49.google.com with SMTP id c14-v6so5204744wmb.4 for ; Fri, 27 Jul 2018 06:09:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mittosystems.com; s=google; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=FjUsbJ4Zq5wjzr6hAMxMHQL/0sTK6FEuJZ4A/O32bGc=; b=eX7rMdlZjnP23N0HOETaVOIkyYr4jTlpTWoTc9X4/GQ5oE7lPU5H/bPpDw/Z5WJzM7 WILD4EoDvG79B4qpZ0QS+XhLE1sz7gWYzDCcnU4TyBTKrg2+Z2r5qUrcl+nmuiyn1KI5 W70as1SP+ZiCLU96pOqJccJdsJqFDNwG/Tn7pqTTuWaH0qIZcggH72OKIc404ZRcRy0p 1jTkfsGU9zWdQyGxmHopPu7zY1b+IJeJ9nFpEi/a0xFMSjtDRh+s4rVhALIYY7aC9WEK ReF6Z9A+2TDnWSWClt5McsafFAZ1zPY6ZUr2pKXaMVjuWqUK2sTuoIeHVdzNP+YJKevB DYRA== Received: from ?IPv6:2a00:23c5:e05:e600:cd83:48c6:4286:92e5? ([2a00:23c5:e05:e600:cd83:48c6:4286:92e5]) by smtp.gmail.com with ESMTPSA id a14-v6sm4092927wmb.44.2018.07.27.06.09.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 06:09:10 -0700 (PDT) To: gcc-patches@gcc.gnu.org From: Jozef Lawrynowicz Subject: [PATCH] [MSP430] Fix PR/86662 Message-ID: <63bcb59a-99fe-12c6-0042-41741ed7043f@mittosystems.com> Date: Fri, 27 Jul 2018 14:09:09 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 X-IsSubscribed: yes As reported in PR/86662, use of __int20 in a program built with -mlarge and -flto causes a segfault for msp430 due to endless recursion in gimple_get_alias_set. The attached patch fixes this. The segfault can be observed on the gcc-7 and gcc-8 branches, and on trunk. The testcase works in gcc-6 Successfully boostrapped and regtested on x86_64-pc-linux-gnu and msp430-elf. This fixes many LTO C and C++ tests for msp430 when the testsuite is invoked with the -mlarge target flag. Ok for gcc-7-branch, gcc-8-branch, and trunk? From 01f8e76dbf50265ae9a3f5f665d27ac8cf811b0c Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz Date: Tue, 24 Jul 2018 23:24:41 +0100 Subject: [PATCH][MSP430] Fix PR86662 2018-07-27 Jozef Lawrynowicz PR target/86662 * gcc/tree.c (build_common_tree_nodes): Initialize integer_types array with all enabled __intN types. * gcc/testsuite/gcc.target/msp430/pr86662.c: New test. --- gcc/testsuite/gcc.target/msp430/pr86662.c | 13 +++++++++++++ gcc/tree.c | 3 +-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/msp430/pr86662.c diff --git a/gcc/testsuite/gcc.target/msp430/pr86662.c b/gcc/testsuite/gcc.target/msp430/pr86662.c new file mode 100644 index 0000000..1144b3e --- /dev/null +++ b/gcc/testsuite/gcc.target/msp430/pr86662.c @@ -0,0 +1,13 @@ +/* PR/86662 */ + +/* { dg-do link } */ +/* -nostdlib prevents link errors due to mismatched code models for + libgloss objects. */ +/* { dg-options "-mlarge -flto -nostdlib" } */ +/* { dg-skip-if "" { *-*-* } { "-mcpu=msp430" } } */ + +int main(void) +{ + __int20 n = 5; + return 0; +} diff --git a/gcc/tree.c b/gcc/tree.c index bace9c8..54384ad 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -9802,8 +9802,7 @@ build_common_tree_nodes (bool signed_char) int_n_trees[i].signed_type = make_signed_type (int_n_data[i].bitsize); int_n_trees[i].unsigned_type = make_unsigned_type (int_n_data[i].bitsize); - if (int_n_data[i].bitsize > LONG_LONG_TYPE_SIZE - && int_n_enabled_p[i]) + if (int_n_enabled_p[i]) { integer_types[itk_intN_0 + i * 2] = int_n_trees[i].signed_type; integer_types[itk_unsigned_intN_0 + i * 2] = int_n_trees[i].unsigned_type; -- 2.7.4