From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 729 invoked by alias); 16 Jun 2014 06:51:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 712 invoked by uid 89); 16 Jun 2014 06:51:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mailout4.w1.samsung.com Received: from mailout4.w1.samsung.com (HELO mailout4.w1.samsung.com) (210.118.77.14) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (DES-CBC3-SHA encrypted) ESMTPS; Mon, 16 Jun 2014 06:51:56 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N790023R1Q82H20@mailout4.w1.samsung.com>; Mon, 16 Jun 2014 07:51:44 +0100 (BST) Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 86.06.27902.6049E935; Mon, 16 Jun 2014 07:51:50 +0100 (BST) Received: from mzakirovPC ([106.109.129.103]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N7900HDF1QDBQ70@eusync3.samsung.com>; Mon, 16 Jun 2014 07:51:50 +0100 (BST) From: Marat Zakirov To: gcc-patches@gcc.gnu.org Cc: 'Konstantin Serebryany' , 'Jakub Jelinek' , 'Slava Garbuzov' , Gribov Yury , 'Marat Zakirov' Subject: [PATCH][PING] Fix for PR 61422 Date: Mon, 16 Jun 2014 06:51:00 -0000 Message-id: <000801cf892f$734d7cc0$59e87640$@samsung.com> MIME-version: 1.0 Content-type: multipart/mixed; boundary="----=_NextPart_000_0009_01CF8950.FA5F1CC0" X-SW-Source: 2014-06/txt/msg01216.txt.bz2 This is a multipart message in MIME format. ------=_NextPart_000_0009_01CF8950.FA5F1CC0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-length: 501 -----Original Message----- From: Marat Zakirov [mailto:m.zakirov@samsung.com] Sent: Friday, June 06, 2014 3:43 PM To: 'gcc-patches@gcc.gnu.org' Cc: 'Konstantin Serebryany'; 'Jakub Jelinek'; 'Slava Garbuzov'; Gribov Yury; 'Marat Zakirov' Subject: [PATCH] Fix for PR 61422 Hi all, Here's a patch for PR 61422 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61422). It fixes false positive on 16 byte access in ffmpeg standard library opus file NLSF_del_dec_quant.c. Reg. tested on x64. --Marat ------=_NextPart_000_0009_01CF8950.FA5F1CC0 Content-Type: application/octet-stream; name="PR61422.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="PR61422.diff" Content-length: 2209 gcc/ChangeLog:=0A= =0A= 2014-06-06 Marat Zakirov =0A= =0A= PR sanitizer/61422=0A= * asan.c (build_check_stmt): Fixed check for unaligned accesses.=0A= =0A= gcc/testsuite/ChangeLog:=0A= =0A= 2014-06-06 Marat Zakirov =0A= =0A= PR sanitizer/61422=0A= * c-c++-common/asan/data-align.c: New test.=0A= =0A= =0A= diff --git a/gcc/asan.c b/gcc/asan.c=0A= index 5021338..73bffdc 100644=0A= --- a/gcc/asan.c=0A= +++ b/gcc/asan.c=0A= @@ -1517,8 +1517,6 @@ build_check_stmt (location_t location, tree base, gim= ple_stmt_iterator *iter,=0A= basic_block then_bb, else_bb;=0A= tree t, base_addr, shadow;=0A= gimple g;=0A= - tree shadow_ptr_type =3D shadow_ptr_types[size_in_bytes =3D=3D 16 ? 1 : = 0];=0A= - tree shadow_type =3D TREE_TYPE (shadow_ptr_type);=0A= tree uintptr_type=0A= =3D build_nonstandard_integer_type (TYPE_PRECISION (TREE_TYPE (base)),= 1);=0A= tree base_ssa =3D base;=0A= @@ -1535,6 +1533,9 @@ build_check_stmt (location_t location, tree base, gim= ple_stmt_iterator *iter,=0A= slow_p =3D true;=0A= }=0A= =20=0A= + tree shadow_ptr_type =3D shadow_ptr_types[real_size_in_bytes =3D=3D 16 ?= 1 : 0];=0A= + tree shadow_type =3D TREE_TYPE (shadow_ptr_type);=0A= +=0A= /* Get an iterator on the point where we can add the condition=0A= statement for the instrumentation. */=0A= gsi =3D create_cond_insert_point (iter, before_p,=0A= diff --git a/gcc/testsuite/c-c++-common/asan/data-align.c b/gcc/testsuite/c= -c++-common/asan/data-align.c=0A= new file mode 100644=0A= index 0000000..f99f9f2=0A= --- /dev/null=0A= +++ b/gcc/testsuite/c-c++-common/asan/data-align.c=0A= @@ -0,0 +1,21 @@=0A= +/* { dg-do run } */=0A= +=0A= +struct S { char c[16]; } __attribute__((packed));=0A= +=0A= +__attribute__((noinline, noclone)) struct S=0A= +foo (struct S *p)=0A= +{=0A= + asm volatile ("" : : "r" (p) : "memory");=0A= + return *p;=0A= +}=0A= +=0A= +int=0A= +main ()=0A= +{=0A= + struct S a __attribute__((aligned (16)));=0A= + struct S b __attribute__((aligned (16)));=0A= + __builtin_memset (&b, 0, sizeof b);=0A= + a =3D foo (&b);=0A= + asm volatile ("" : : "m" (a), "m" (b));=0A= + return 0;=0A= +}=0A= ------=_NextPart_000_0009_01CF8950.FA5F1CC0--