From patchwork Sat Aug 30 22:35:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 384514 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 94488140175 for ; Sun, 31 Aug 2014 08:35:55 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=a68v0c1conyHOb//sj58rwaCDFfRU7mz+ElS+poESjZsI1 EXXDEKp31dFJSGlm6bd2WPF0OpsG3mkeC5TZt/m3sChycxzv1s0tuTfIqnSWveCn kVTd2jOf7yGqw4Cdl6+xuOQnpR2AzEXoVoR03Ca1eVClFf8uixFK/Ja+xnC4U= 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 :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=ILnGHq2w4OMKbDQ+bkEEmuQ58gQ=; b=HvxS9KQZA8DigYdEJzrt LiFO/dE+OYhc7ahaoqv1HhgyRZaqAMiRE4xWNEiiG10HLPfYVoy8cPYzhPmuxaFr Y1wVirFHJpkx64/0lXjv4lrqQphnoQD8rKXScv+kaoMFyNzQKVahbcg2Q0eXlgP+ 8/jr1YpunuJE3o0rXuZqMcs= Received: (qmail 9611 invoked by alias); 30 Aug 2014 22:35:46 -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 9481 invoked by uid 89); 30 Aug 2014 22:35:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-la0-f51.google.com Received: from mail-la0-f51.google.com (HELO mail-la0-f51.google.com) (209.85.215.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 30 Aug 2014 22:35:39 +0000 Received: by mail-la0-f51.google.com with SMTP id gl10so4379989lab.10 for ; Sat, 30 Aug 2014 15:35:35 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.112.33.74 with SMTP id p10mr18287848lbi.0.1409438135242; Sat, 30 Aug 2014 15:35:35 -0700 (PDT) Received: by 10.25.23.204 with HTTP; Sat, 30 Aug 2014 15:35:35 -0700 (PDT) Date: Sat, 30 Aug 2014 15:35:35 -0700 Message-ID: Subject: [Comitted] Add testcase for some miscompile in older versions of GCC From: Andrew Pinski To: GCC Patches X-IsSubscribed: yes Hi, In some versions of GCC with AARCH64 backported, I got a miscompile of a shift that involved a load which had a post increment of the address. This adds the testcase I created for that case. Comitted after a quick test on x86_64-linux-gnu of the testcase. I had meant to commit this two days which is why the testcase is dated two days ago. Thanks, Andrew Pinski ChangeLog: * gcc.c-torture/execute/20140828-1.c: New testcase. Index: gcc.c-torture/execute/20140828-1.c =================================================================== --- gcc.c-torture/execute/20140828-1.c (revision 0) +++ gcc.c-torture/execute/20140828-1.c (revision 0) @@ -0,0 +1,22 @@ +short *f(short *a, int b, int *d) __attribute__((noinline,noclone)); + +short *f(short *a, int b, int *d) +{ + short c = *a; + a++; + c = b << c; + *d = c; + return a; +} + +int main(void) +{ + int d; + short a[2]; + a[0] = 0; + if (f(a, 1, &d) != &a[1]) + __builtin_abort (); + if (d != 1) + __builtin_abort (); + return 0; +}