From patchwork Wed Nov 1 07:50:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 832865 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-465664-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="g0ZkEGGl"; 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 3yRgPH0Nmhz9sPs for ; Wed, 1 Nov 2017 18:50:17 +1100 (AEDT) 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:from:date:message-id:subject:to:content-type; q= dns; s=default; b=iF+lP1PkZ/iN5oqBRG8BaXaRO3K6AR1jgsI6N4lxG0KOKE eCNS91YGNWVsbob5FcEY2nZO1rS5HnUpUqYPHUvt0c8ctyzOxJTVfhZaXmVM5H+j GNXQ+qn5dXFtswjzU7vPsZi29nAel7c832EjzA7fbUu3deR1cpIaQIyyRFw8Q= 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:from:date:message-id:subject:to:content-type; s= default; bh=rqlHsAOwriKRrCTcJShOjkhXHCM=; b=g0ZkEGGlf8gWV7bPV0Bw JRhMnjkyo8/b0EqoGcoW4v7l4sYigrLYwZ4p3q7IXHz4oIKcmVN8ovjnVRKAiP3Q xj9vsYW7+LE9AjLSCv33ROmUszkabphNwWjrgI307SuuXf7dmAx+VdHah1imfTIw hccXD/25vHQ6hvFHA3fiNmA= Received: (qmail 62521 invoked by alias); 1 Nov 2017 07:50:07 -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 61631 invoked by uid 89); 1 Nov 2017 07:50:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=uros, HX-Received:Nov, HX-Received:Wed X-HELO: mail-io0-f169.google.com Received: from mail-io0-f169.google.com (HELO mail-io0-f169.google.com) (209.85.223.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 01 Nov 2017 07:50:05 +0000 Received: by mail-io0-f169.google.com with SMTP id 101so4299629ioj.3 for ; Wed, 01 Nov 2017 00:50:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=hfP7j3lhPeDA1bSbqa/yTeXucdfCXZrr96Kch+mktaA=; b=RXm5UZOM73MWRZalyD5jINZYhXAdPrbVCVJg6lcjTt4LXycBLSS1N5n3g0IDMK5WX5 /WC2ZtHVlaodLKPyTght5j+9RJoMrAaxAWMHYgF2Npy2xAQsPJeksGLLjqCjpjKioBFU 5x5ZFeiEceq1eLAr5cjY2hPl91B8WBHe8rncOU2aGncejOtuqLS2nb2DBP8h07GpKrnL glpasSNU+3NcU7M++gU6TdH4Dpfrp55MIpzhinWeBc+E6ZqM7w8Cnd2AoIYIsq1LgycV Nty3IRV4Gp++67WFx7GOJwNB2iQJjVRfcgFDzSx9YGwhJWDWqnbZK1jy5jaBkQ0ltL/s Arrw== X-Gm-Message-State: AMCzsaWuCaFqOGlrurZWYm074rupkx8mfyaq+AC88mBWxzYojpDMqyAU otiZkQVyB0tnELKvghelv6T1QURjDnMvHaHpRd709w== X-Google-Smtp-Source: ABhQp+QYbw5Kan+JrzZV2+uwM3tcBNn8WRghawniZ2uG+g7Vwd8nVpfeYGR2nyZVrqcL6mA0deCMq6gdmyd1KE3xi78= X-Received: by 10.36.87.2 with SMTP id u2mr6555256ita.151.1509522603642; Wed, 01 Nov 2017 00:50:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.74.18 with HTTP; Wed, 1 Nov 2017 00:50:03 -0700 (PDT) From: Uros Bizjak Date: Wed, 1 Nov 2017 08:50:03 +0100 Message-ID: Subject: [PATCH, testsuite, alpha]: Add testcase for glibc sqrt bug To: "gcc-patches@gcc.gnu.org" The testcase for an alpha glibc bug [1] that bit us again. 2017-11-01 Uros Bizjak * gcc.target/alpha/sqrt.c: New test. Tested on alphaev68-linux-gnu, committed to mainline SVN. [1] https://sourceware.org/ml/libc-alpha/2017-04/msg00256.html Uros. Index: gcc.target/alpha/sqrt.c =================================================================== --- gcc.target/alpha/sqrt.c (nonexistent) +++ gcc.target/alpha/sqrt.c (working copy) @@ -0,0 +1,25 @@ +/* glibc bug, https://sourceware.org/ml/libc-alpha/2017-04/msg00256.html + When using software completions, we have to prevent assembler to match + input and output operands of sqrtt/sqrtf insn. Fixed in glibc 2.26. */ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-builtin-sqrt -mieee" } */ + +double sqrt (double); + +static double +float64frombits (unsigned long b) +{ + union { unsigned long __b; double __d; } u = { .__b = b }; + return u.__d; +} + +int +main (void) +{ + double a = float64frombits (2); + + if (sqrt (a) != 3.1434555694052576e-162) + __builtin_abort (); + + return 0; +}