public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/56330] New: [4.8 Regression] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address
@ 2013-02-14 21:51 zsojka at seznam dot cz
  2013-02-14 22:03 ` [Bug sanitizer/56330] " mpolacek at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: zsojka at seznam dot cz @ 2013-02-14 21:51 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56330

             Bug #: 56330
           Summary: [4.8 Regression] ICE: verify_gimple failed: gimple_bb
                    (stmt) is set to a wrong basic block with
                    -fsanitize=address
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz
                CC: dodji@gcc.gnu.org, dvyukov@gcc.gnu.org,
                    jakub@gcc.gnu.org, kcc@gcc.gnu.org


Created attachment 29456
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29456
autoreduced testcase

I am not sure if this should be marked as a regression - the code doesn't
compile in 4.7, but used to older revisions of 4.8.

Compiler output:
$ gcc -fsanitize=address testcase.c         
testcase.c: In function 'foo':
testcase.c:10:1: error: gimple_bb (stmt) is set to a wrong basic block
 foo (void)
 ^
__builtin_memcmp (&s.a, &empty, 200);

testcase.c:10:1: error: gimple_bb (stmt) is set to a wrong basic block
return;

testcase.c:10:1: internal compiler error: verify_gimple failed
0xa528bc verify_gimple_in_cfg(function*)
        /mnt/svn/gcc-trunk/gcc/tree-cfg.c:4727
0x93f177 execute_function_todo
        /mnt/svn/gcc-trunk/gcc/passes.c:1970
0x93fa97 execute_todo
        /mnt/svn/gcc-trunk/gcc/passes.c:1999
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

Tested revisions:
r196044 - crash
r195931 - OK


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug sanitizer/56330] [4.8 Regression] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address
  2013-02-14 21:51 [Bug sanitizer/56330] New: [4.8 Regression] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address zsojka at seznam dot cz
@ 2013-02-14 22:03 ` mpolacek at gcc dot gnu.org
  2013-02-14 22:23 ` [Bug sanitizer/56330] " steven at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-02-14 22:03 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56330

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-02-14
                 CC|                            |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |4.8.0
     Ever Confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> 2013-02-14 22:03:06 UTC ---
Confirmed.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug sanitizer/56330] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address
  2013-02-14 21:51 [Bug sanitizer/56330] New: [4.8 Regression] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address zsojka at seznam dot cz
  2013-02-14 22:03 ` [Bug sanitizer/56330] " mpolacek at gcc dot gnu.org
@ 2013-02-14 22:23 ` steven at gcc dot gnu.org
  2013-02-14 22:34 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: steven at gcc dot gnu.org @ 2013-02-14 22:23 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56330

Steven Bosscher <steven at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.8 Regression] ICE:       |ICE: verify_gimple failed:
                   |verify_gimple failed:       |gimple_bb (stmt) is set to
                   |gimple_bb (stmt) is set to  |a wrong basic block with
                   |a wrong basic block with    |-fsanitize=address
                   |-fsanitize=address          |

--- Comment #2 from Steven Bosscher <steven at gcc dot gnu.org> 2013-02-14 22:22:57 UTC ---
A regression is when something worked in an older GCC release but
does not work anymore. ASAN is new in GCC 4.8 so this bug is not
a regression.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug sanitizer/56330] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address
  2013-02-14 21:51 [Bug sanitizer/56330] New: [4.8 Regression] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address zsojka at seznam dot cz
  2013-02-14 22:03 ` [Bug sanitizer/56330] " mpolacek at gcc dot gnu.org
  2013-02-14 22:23 ` [Bug sanitizer/56330] " steven at gcc dot gnu.org
@ 2013-02-14 22:34 ` jakub at gcc dot gnu.org
  2013-02-15  9:09 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-14 22:34 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56330

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-14 22:34:01 UTC ---
Started with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196008


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug sanitizer/56330] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address
  2013-02-14 21:51 [Bug sanitizer/56330] New: [4.8 Regression] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2013-02-14 22:34 ` jakub at gcc dot gnu.org
@ 2013-02-15  9:09 ` jakub at gcc dot gnu.org
  2013-02-15 10:59 ` dodji at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-15  9:09 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56330

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-15 09:09:28 UTC ---
Created attachment 29462
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29462
gcc48-pr56330.patch

Lightly tested fix.  Better testsuite coverage is desirable.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug sanitizer/56330] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address
  2013-02-14 21:51 [Bug sanitizer/56330] New: [4.8 Regression] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2013-02-15  9:09 ` jakub at gcc dot gnu.org
@ 2013-02-15 10:59 ` dodji at gcc dot gnu.org
  2013-02-15 19:47 ` dodji at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dodji at gcc dot gnu.org @ 2013-02-15 10:59 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56330

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |dodji at gcc dot gnu.org
                   |gnu.org                     |


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug sanitizer/56330] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address
  2013-02-14 21:51 [Bug sanitizer/56330] New: [4.8 Regression] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2013-02-15 10:59 ` dodji at gcc dot gnu.org
@ 2013-02-15 19:47 ` dodji at gcc dot gnu.org
  2013-02-15 19:57 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dodji at gcc dot gnu.org @ 2013-02-15 19:47 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56330

--- Comment #5 from Dodji Seketeli <dodji at gcc dot gnu.org> 2013-02-15 19:46:44 UTC ---
Created attachment 29477
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29477
Updated patch with cleanups explained in the ChangeLog

Thanks!

I have updated the patch to simplify the logic in instrument_mem_region_access
somewhat, especially the part that does the statement iterator decrementing
dance.

I have also added more regression tests.

What do you think?


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug sanitizer/56330] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address
  2013-02-14 21:51 [Bug sanitizer/56330] New: [4.8 Regression] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2013-02-15 19:47 ` dodji at gcc dot gnu.org
@ 2013-02-15 19:57 ` jakub at gcc dot gnu.org
  2013-02-16  9:30 ` dodji at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-15 19:57 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56330

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-15 19:57:39 UTC ---
This is ok for trunk if it passes bootstrap/regtest.  Please post it to
gcc-patches anyway though.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug sanitizer/56330] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address
  2013-02-14 21:51 [Bug sanitizer/56330] New: [4.8 Regression] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2013-02-15 19:57 ` jakub at gcc dot gnu.org
@ 2013-02-16  9:30 ` dodji at gcc dot gnu.org
  2013-02-16  9:33 ` dodji at gcc dot gnu.org
  2013-02-16  9:58 ` dodji at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: dodji at gcc dot gnu.org @ 2013-02-16  9:30 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56330

--- Comment #7 from Dodji Seketeli <dodji at gcc dot gnu.org> 2013-02-16 09:30:10 UTC ---
FWIW, I have posted the patch for this to
http://gcc.gnu.org/ml/gcc-patches/2013-02/msg00795.html


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug sanitizer/56330] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address
  2013-02-14 21:51 [Bug sanitizer/56330] New: [4.8 Regression] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address zsojka at seznam dot cz
                   ` (7 preceding siblings ...)
  2013-02-16  9:30 ` dodji at gcc dot gnu.org
@ 2013-02-16  9:33 ` dodji at gcc dot gnu.org
  2013-02-16  9:58 ` dodji at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: dodji at gcc dot gnu.org @ 2013-02-16  9:33 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56330

--- Comment #8 from Dodji Seketeli <dodji at gcc dot gnu.org> 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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug sanitizer/56330] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address
  2013-02-14 21:51 [Bug sanitizer/56330] New: [4.8 Regression] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address zsojka at seznam dot cz
                   ` (8 preceding siblings ...)
  2013-02-16  9:33 ` dodji at gcc dot gnu.org
@ 2013-02-16  9:58 ` dodji at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: dodji at gcc dot gnu.org @ 2013-02-16  9:58 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56330

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #9 from Dodji Seketeli <dodji at gcc dot gnu.org> 2013-02-16 09:58:22 UTC ---
This should now be fixed in trunk (4.8).


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-02-16  9:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-14 21:51 [Bug sanitizer/56330] New: [4.8 Regression] ICE: verify_gimple failed: gimple_bb (stmt) is set to a wrong basic block with -fsanitize=address zsojka at seznam dot cz
2013-02-14 22:03 ` [Bug sanitizer/56330] " mpolacek at gcc dot gnu.org
2013-02-14 22:23 ` [Bug sanitizer/56330] " steven at gcc dot gnu.org
2013-02-14 22:34 ` jakub at gcc dot gnu.org
2013-02-15  9:09 ` jakub at gcc dot gnu.org
2013-02-15 10:59 ` dodji at gcc dot gnu.org
2013-02-15 19:47 ` dodji at gcc dot gnu.org
2013-02-15 19:57 ` jakub at gcc dot gnu.org
2013-02-16  9:30 ` dodji at gcc dot gnu.org
2013-02-16  9:33 ` dodji at gcc dot gnu.org
2013-02-16  9:58 ` dodji at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).