From patchwork Sat Jan 11 23:42:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 23135 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8C4AA216DD for ; Sat, 11 Jan 2014 23:42:23 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id i4sf13834376oah.10 for ; Sat, 11 Jan 2014 15:42:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=5e+Eo2zTNdQJgicahWRAopRkKzAp2h/d5nOzqmfuKwY=; b=NLPAO81o9NLvvN+kfwCPowyAMTgv+rvl88DVH9qkM+t5EJ6qwsmYm/PSdaRBicjNem g0dkWcozJctaz+aW07J/prah/Qdp9yHT0MaYrsOftXWUPAv0jh1/XfuXlKoCLkHVvLcj UhQe57pCGyAckdp1xN+YiW9oZCn6DL1XhTZwc4vAlKo+bSKdbybaqehZl8o9bpt9DTX/ GpwDtPnF1lfSqjylUYF57wd/cwdJ4/luxeoYLhiDM8qq9f2h8PtsxRvhRPoqagKVMGou 8hZwUQ1yzV4It0QCngtt98zER2YYj9bdo0T+9g6FqF34bY1BUEYiv0rchl2q3jAkiQzN 6Vpw== X-Gm-Message-State: ALoCoQmOGZSzNKO7gQ436gDEEJvdmu4+nuiGK5banKz5/EyvSQk1OMT3Fx3MdaZoiXd6oVY9TjLg X-Received: by 10.182.66.137 with SMTP id f9mr6551374obt.3.1389483742422; Sat, 11 Jan 2014 15:42:22 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.120.164 with SMTP id ld4ls1892977qeb.51.gmail; Sat, 11 Jan 2014 15:42:22 -0800 (PST) X-Received: by 10.58.186.233 with SMTP id fn9mr95232vec.31.1389483742332; Sat, 11 Jan 2014 15:42:22 -0800 (PST) Received: from mail-vb0-f50.google.com (mail-vb0-f50.google.com [209.85.212.50]) by mx.google.com with ESMTPS id sz9si7918140vdc.71.2014.01.11.15.42.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 11 Jan 2014 15:42:22 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.50; Received: by mail-vb0-f50.google.com with SMTP id w18so4049260vbj.23 for ; Sat, 11 Jan 2014 15:42:22 -0800 (PST) X-Received: by 10.52.66.205 with SMTP id h13mr11219775vdt.11.1389483741979; Sat, 11 Jan 2014 15:42:21 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp45561ved; Sat, 11 Jan 2014 15:42:20 -0800 (PST) X-Received: by 10.66.136.71 with SMTP id py7mr21133520pab.2.1389483739963; Sat, 11 Jan 2014 15:42:19 -0800 (PST) Received: from mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) by mx.google.com with ESMTPS id ob10si11335690pbb.217.2014.01.11.15.42.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 11 Jan 2014 15:42:19 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.177 is neither permitted nor denied by best guess record for domain of kugan.vivekanandarajah@linaro.org) client-ip=209.85.192.177; Received: by mail-pd0-f177.google.com with SMTP id q10so5953646pdj.22 for ; Sat, 11 Jan 2014 15:42:19 -0800 (PST) X-Received: by 10.66.197.164 with SMTP id iv4mr21033982pac.18.1389483739394; Sat, 11 Jan 2014 15:42:19 -0800 (PST) Received: from [192.168.0.100] ([101.171.228.90]) by mx.google.com with ESMTPSA id lh13sm34665363pab.4.2014.01.11.15.42.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 11 Jan 2014 15:42:18 -0800 (PST) Message-ID: <52D1D6D6.2090301@linaro.org> Date: Sun, 12 Jan 2014 10:42:14 +1100 From: Kugan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Richard Earnshaw , Marcus Shawcroft , "patches@linaro.org" Subject: [AARCH64][PATCH] PR59695 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: kugan.vivekanandarajah@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Hi, aarch64_build_constant incorrectly truncates the immediate when constants are generated with MOVN. This causes coinor-osi tests to fail (tracked also in https://bugs.launchpad.net/gcc-linaro/+bug/1263576) Attached patch fixes this. Also attaching a reduced testcase that reproduces this. Tested on aarch64-none-linux-gnu with no new regressions. Is this OK for trunk? Thanks, Kugan gcc/ +2013-10-15 Matthew Gretton-Dann + Kugan Vivekanandarajah + + PR target/59588 + * config/aarch64/aarch64.c (aarch64_build_constant): Fix incorrect + truncation. + gcc/testsuite/ +2014-01-11 Matthew Gretton-Dann + Kugan Vivekanandarajah + + PR target/59695 + * g++.dg/pr59695.C: New file. + diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 3d32ea5..854666f 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -2486,7 +2486,7 @@ aarch64_build_constant (int regnum, HOST_WIDE_INT val) if (ncount < zcount) { emit_move_insn (gen_rtx_REG (Pmode, regnum), - GEN_INT ((~val) & 0xffff)); + GEN_INT (~((~val) & 0xffff))); tval = 0xffff; } else diff --git a/gcc/testsuite/g++.dg/pr59695.C b/gcc/testsuite/g++.dg/pr59695.C index e69de29..0da06cb 100644 --- a/gcc/testsuite/g++.dg/pr59695.C +++ b/gcc/testsuite/g++.dg/pr59695.C @@ -0,0 +1,125 @@ + +/* PR target/53055 */ +/* { dg-do run { target aarch64*-*-* } } */ +/* { dg-options "-O0" } */ + +#define DEFINE_VIRTUALS_FNS(i) virtual void xxx##i () {} \ + virtual void foo1_##i () {}\ + virtual void foo2_##i () {}\ + virtual void foo3_##i () {}\ + virtual void foo4_##i () {}\ + virtual void foo5_##i () {}\ + virtual void foo6_##i () {}\ + virtual void foo7_##i () {}\ + virtual void foo8_##i () {}\ + virtual void foo9_##i () {}\ + virtual void foo10_##i () {}\ + virtual void foo11_##i () {}\ + virtual void foo12_##i () {}\ + virtual void foo13_##i () {}\ + virtual void foo14_##i () {}\ + virtual void foo15_##i () {}\ + virtual void foo16_##i () {}\ + virtual void foo17_##i () {}\ + virtual void foo18_##i () {}\ + virtual void foo19_##i () {}\ + virtual void foo20_##i () {}\ + virtual void foo21_##i () {}\ + virtual void foo22_##i () {}\ + +class base_class_2 +{ + +public: + /* Define lots of virtual functions */ + DEFINE_VIRTUALS_FNS (1) + DEFINE_VIRTUALS_FNS (2) + DEFINE_VIRTUALS_FNS (3) + DEFINE_VIRTUALS_FNS (4) + DEFINE_VIRTUALS_FNS (5) + DEFINE_VIRTUALS_FNS (6) + DEFINE_VIRTUALS_FNS (7) + DEFINE_VIRTUALS_FNS (8) + DEFINE_VIRTUALS_FNS (9) + DEFINE_VIRTUALS_FNS (10) + DEFINE_VIRTUALS_FNS (11) + DEFINE_VIRTUALS_FNS (12) + DEFINE_VIRTUALS_FNS (13) + DEFINE_VIRTUALS_FNS (14) + DEFINE_VIRTUALS_FNS (15) + DEFINE_VIRTUALS_FNS (16) + DEFINE_VIRTUALS_FNS (17) + DEFINE_VIRTUALS_FNS (18) + DEFINE_VIRTUALS_FNS (19) + DEFINE_VIRTUALS_FNS (20) + + base_class_2(); + virtual ~base_class_2 (); +}; + +base_class_2::base_class_2() +{ +} + +base_class_2::~base_class_2 () +{ +} + +class base_class_1 +{ +public: + virtual ~base_class_1(); + base_class_1(); +}; + +base_class_1::base_class_1() +{ +} + +base_class_1::~base_class_1() +{ +} + +class base_Impl_class : + virtual public base_class_2, public base_class_1 +{ +public: + base_Impl_class (); + virtual ~base_Impl_class (); +}; + +base_Impl_class::base_Impl_class () +{ +} + +base_Impl_class::~base_Impl_class () +{ +} + + +class test_cls : public base_Impl_class +{ +public: + test_cls(); + virtual ~test_cls(); +}; + +test_cls::test_cls() +{ +} + +test_cls::~test_cls() +{ +} + +int main() +{ + test_cls *test = new test_cls; + base_class_2 *p1 = test; + + /* PR 53055 destructor thunk offsets are not setup + correctly resulting in crash. */ + delete p1; + return 0; +} +