From patchwork Thu Apr 11 11:58:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Ivchenko X-Patchwork-Id: 235711 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 82C1E2C008D for ; Thu, 11 Apr 2013 21:58:20 +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=RtheHWOLETdgp9aNMawyDHJb999XV1+YORJszpQK/Zm89s qaD4iSMiL01VV1cJI4PuGpoLw6/hzlYuzkWtAKPoL/r+tGnkAvk7nPGycAOb3bLT R6BT0pTcgmD9081KWFI1CSDE6AsGx936bmIMQaMVTk1OHrpc5glNlmgt5hM6g= 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=YIm5YmdtVMaFoB59hxhT6z8LcDE=; b=kllPwLh9kUsiFSkQfKRM xeMgkFouMPQOVWE+LEdnBY/E8XjlZwWY9qeo983OCcF7oZZv4aERLDud3KUDu2cM BI9EcJa2vLF+Vxax9f8F2UYBF0h0hHw/aqe2m0wf32F6rbyAZohLkA4cedz21y7H h+BFTbWS9dtmDYqv99t218U= Received: (qmail 22384 invoked by alias); 11 Apr 2013 11:58:13 -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 22334 invoked by uid 89); 11 Apr 2013 11:58:13 -0000 X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_YE, TW_AV, TW_VP autolearn=no version=3.3.1 Received: from mail-pd0-f171.google.com (HELO mail-pd0-f171.google.com) (209.85.192.171) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 11 Apr 2013 11:58:12 +0000 Received: by mail-pd0-f171.google.com with SMTP id z10so824782pdj.30 for ; Thu, 11 Apr 2013 04:58:11 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.66.144.103 with SMTP id sl7mr9256610pab.55.1365681491257; Thu, 11 Apr 2013 04:58:11 -0700 (PDT) Received: by 10.68.82.37 with HTTP; Thu, 11 Apr 2013 04:58:11 -0700 (PDT) Date: Thu, 11 Apr 2013 15:58:11 +0400 Message-ID: Subject: [testsuite, i386] Reimplementing array comparison in avx2-vpop-check.h From: Alexander Ivchenko To: GCC Patches , Uros Bizjak Hi, Usually does not include but on bionic it is historically included. memcmp() reacts on a volatile argument differently, depending on whether is included or not. If it is included, then the compiler will generate a warning: warning: passing argument 2 of 'memcmp' discards 'volatile' qualifier from pointer target type [enabled by default] In avx2-vpop-check.h we compare two arrays using memcmp(), and since one of them is declared as volatile we have test-fails because of that warning. The following patch reimplements the comparison using just for-loop: is it OK? thanks, Alexander diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 943be90..9b08eb0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2013-04-11 Grigoriy Kraynov + + * gcc.target/i386/avx2-vpop-check.h: memcmp() replaced by for loop. + 2013-04-11 Paolo Carlini PR c++/54216 diff --git a/gcc/testsuite/gcc.target/i386/avx2-vpop-check.h b/gcc/testsuite/gcc.target/i386/avx2-vpop-check.h index 143b54da..921ed0b 100644 --- a/gcc/testsuite/gcc.target/i386/avx2-vpop-check.h +++ b/gcc/testsuite/gcc.target/i386/avx2-vpop-check.h @@ -47,7 +47,8 @@ avx2_test (void) gen_pop (); check_pop (); - if (memcmp (c, c_ref, SIZE * sizeof (TYPE))) - abort(); + for (i = 0; i < SIZE; ++i) + if (c[i] != c_ref[i]) + abort(); } }