From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11162 invoked by alias); 16 Feb 2013 09:33:28 -0000 Received: (qmail 10432 invoked by uid 55); 16 Feb 2013 09:33:02 -0000 From: "dodji at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/56330] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address Date: Sat, 16 Feb 2013 09:33:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: dodji at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dodji at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-02/txt/msg01691.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56330 --- Comment #8 from Dodji Seketeli 2013-02-16 09:33:01 UTC --- Author: dodji Date: Sat Feb 16 09:32:56 2013 New Revision: 196102 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196102 Log: [asan] Fix for PR asan/56330 gcc/ * asan.c (get_mem_refs_of_builtin_call): White space and style cleanup. (instrument_mem_region_access): Do not forget to always put instrumentation of the of 'base' and 'base + len' in a "if (len != 0) statement, even for cases where either 'base' or 'base + len' are not instrumented -- because they have been previously instrumented. Simplify the logic by putting all the statements instrument 'base + len' inside a sequence, and then insert that sequence right before the current insertion point. Then, to instrument 'base + len', just get an iterator on that statement. And do not forget to update the pointer to iterator the function received as argument. gcc/testsuite/ * c-c++-common/asan/no-redundant-instrumentation-4.c: New test file. * c-c++-common/asan/no-redundant-instrumentation-5.c: Likewise. * c-c++-common/asan/no-redundant-instrumentation-6.c: Likewise. * c-c++-common/asan/no-redundant-instrumentation-7.c: Likewise. * c-c++-common/asan/no-redundant-instrumentation-8.c: Likewise. * c-c++-common/asan/pr56330.c: Likewise. * c-c++-common/asan/no-redundant-instrumentation-1.c (test1): Ensure the size argument of __builtin_memcpy is a constant. Added: trunk/gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-4.c trunk/gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-5.c trunk/gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-6.c trunk/gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-7.c trunk/gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-8.c trunk/gcc/testsuite/c-c++-common/asan/pr56330.c Modified: trunk/gcc/ChangeLog trunk/gcc/asan.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-1.c