From patchwork Mon Oct 8 16:16:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 190056 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 710AC2C0287 for ; Tue, 9 Oct 2012 03:17:10 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1350317831; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:From:Date:To:Subject:User-Agent:MIME-Version: Content-Type:Content-Transfer-Encoding:Message-ID:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=40PLdQVACOq9FRjoKE39ORYi/5w=; b=mEZB51b90m32BtZ+fEZr/d2OUU+RvEVunOmAGW5Ll/eTmEXRaVaRqW/r3aLUzU mRGK2mJHE7w/EYDsZ5e1uGXSp1SaOIyUPS97C+hpXas7W3wCLz2y8xTTebHVNZuN 0kCA8DObuZZZy6c0NvyNIqy/jOUT0ZbYQPhsH/2KbbfAc= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-M-MSG:Received:Received:Received:From:Date:To:Subject:User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID:X-EMS-Proccessed:X-EMS-STAMP:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=bznPUoPOSRqfjyCqzuY30QYgn1rRV3BGe5+Mxa/9HzU5qMUDll+r58Dvk9bmRe s0vTlwvga9EhHJi8PvAkyLm1l/FLEd4TwQUXSpk7nFTQMZ17EYI9RAsBCe0dtQi8 t665yeryz2TPug26SDzclhvF2KEM15pHYonOL+qDnm/7g=; Received: (qmail 3369 invoked by alias); 8 Oct 2012 16:17:00 -0000 Received: (qmail 3350 invoked by uid 22791); 8 Oct 2012 16:16:58 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from dns1.mips.com (HELO dns1.mips.com) (12.201.5.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 08 Oct 2012 16:16:52 +0000 Received: from mailgate1.mips.com (mailgate1.mips.com [12.201.5.111]) by dns1.mips.com (8.13.8/8.13.8) with ESMTP id q98GGo8B023656 for ; Mon, 8 Oct 2012 09:16:51 -0700 X-M-MSG: Received: from exchdb01.mips.com (unknown [192.168.36.84]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mailgate1.mips.com (Postfix) with ESMTP id 2EB1636465A for ; Mon, 8 Oct 2012 09:16:49 -0700 (PDT) Received: from ubuntu-sellcey.mips.com (192.168.65.53) by exchhub01.mips.com (192.168.36.84) with Microsoft SMTP Server id 14.1.270.1; Mon, 8 Oct 2012 09:16:46 -0700 Received: by ubuntu-sellcey.mips.com (sSMTP sendmail emulation); Mon, 08 Oct 2012 09:16:46 -0700 From: "Steve Ellcey " Date: Mon, 8 Oct 2012 09:16:46 -0700 To: Subject: [patch, mips, testsuite] Fix test to handle optimizations User-Agent: Heirloom mailx 12.4 7/29/08 MIME-Version: 1.0 Message-ID: <102e63ea-6b28-45cf-a75b-10d19561500e@EXCHHUB01.MIPS.com> X-EMS-Proccessed: 6LP3oGfGVdcdb8o1aBnt6w== X-EMS-STAMP: z6rkaOpuBvnrKb8iyNJiQw== 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 The gcc.target/mips/ext_ins.c was failing in little endian mode on MIPS because the compiler is smart enough now to see that 'c' is uninitialized and it can insert the field 'a' into 'c' with a shift and a full store instead of an insert because the store just overwrites unintialized data. I changed the code to force the compiler to preserve the other fields of 'c' and that makes it use the insert instruction in both big and little endian modes. Tested on mips-mti-elf. OK to checkin? Steve Ellcey sellcey@mips.com 2012-10-08 Steve Ellcey * gcc.target/ext_ins.c: Modify f2 to aviod uninitialized data. diff --git a/gcc/testsuite/gcc.target/mips/ext_ins.c b/gcc/testsuite/gcc.target/mips/ext_ins.c index f0169bc..36f0f3f 100644 --- a/gcc/testsuite/gcc.target/mips/ext_ins.c +++ b/gcc/testsuite/gcc.target/mips/ext_ins.c @@ -18,9 +18,8 @@ NOMIPS16 unsigned int f1 (struct A a) return a.j; } -NOMIPS16 void f2 (int i) +NOMIPS16 struct A f2 (struct A a, int i) { - struct A c; - c.j = i; - func (c); + a.j = i; + return a; }