public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/46288] New: ICE: SIGSEGV in walk_gimple_op (gimple.c:2857) with -O -fno-tree-dce and __builtin_expect()
@ 2010-11-03 13:49 zsojka at seznam dot cz
  2010-11-03 15:19 ` [Bug tree-optimization/46288] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: zsojka at seznam dot cz @ 2010-11-03 13:49 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: ICE: SIGSEGV in walk_gimple_op (gimple.c:2857) with -O
                    -fno-tree-dce and __builtin_expect()
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz


----- testcase.c -----
void foo (int i)
{
  __builtin_expect (i, i);
}
----------------------

Valgrind output (4.6 and 4.5):
$ gcc -O -fno-tree-dce testcase.c
==12204== Invalid read of size 8
==12204==    at 0x6E6CF6: walk_gimple_op (gimple.c:2857)
==12204==    by 0x89C342: verify_stmts (tree-cfg.c:4143)
==12204==    by 0x9B943C: verify_ssa (tree-ssa.c:878)
==12204==    by 0x794CCC: execute_function_todo (passes.c:1248)
==12204==    by 0x79536E: execute_todo (passes.c:1277)
==12204==    by 0x7979D9: execute_one_pass (passes.c:1583)
==12204==    by 0x797C04: execute_pass_list (passes.c:1615)
==12204==    by 0x797C16: execute_pass_list (passes.c:1616)
==12204==    by 0x8E3FD5: tree_rest_of_compilation (tree-optimize.c:422)
==12204==    by 0xAB0C31: cgraph_expand_function (cgraphunit.c:1494)
==12204==    by 0xAB31F9: cgraph_optimize (cgraphunit.c:1553)
==12204==    by 0xAB3759: cgraph_finalize_compilation_unit (cgraphunit.c:1016)
==12204==  Address 0x10 is not stack'd, malloc'd or (recently) free'd
==12204== 
testcase.c: In function 'foo':
testcase.c:1:6: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Compiler output (4.4):
$ gcc -O -fno-tree-dce testcase.c
testcase.c: In function 'foo':
testcase.c:1: internal compiler error: in gimple_assign_set_lhs, at
gimple.h:1687
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Tested revisions:
r166218 - crash
4.5 r165781 - crash
4.4 r165781 - different crash


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

* [Bug tree-optimization/46288] ICE: SIGSEGV in walk_gimple_op (gimple.c:2857) with -O -fno-tree-dce and __builtin_expect()
  2010-11-03 13:49 [Bug tree-optimization/46288] New: ICE: SIGSEGV in walk_gimple_op (gimple.c:2857) with -O -fno-tree-dce and __builtin_expect() zsojka at seznam dot cz
@ 2010-11-03 15:19 ` rguenth at gcc dot gnu.org
  2010-11-03 16:59 ` rguenth at gcc dot gnu.org
  2010-11-03 16:59 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-03 15:19 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2010.11.03 15:18:58
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-11-03 15:18:58 UTC ---
(gdb) call debug_gimple_stmt (stmt)
 = D.2683_3;

err ...

I have a fix.


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

* [Bug tree-optimization/46288] ICE: SIGSEGV in walk_gimple_op (gimple.c:2857) with -O -fno-tree-dce and __builtin_expect()
  2010-11-03 13:49 [Bug tree-optimization/46288] New: ICE: SIGSEGV in walk_gimple_op (gimple.c:2857) with -O -fno-tree-dce and __builtin_expect() zsojka at seznam dot cz
  2010-11-03 15:19 ` [Bug tree-optimization/46288] " rguenth at gcc dot gnu.org
@ 2010-11-03 16:59 ` rguenth at gcc dot gnu.org
  2010-11-03 16:59 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-03 16:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-11-03 16:58:57 UTC ---
Author: rguenth
Date: Wed Nov  3 16:58:50 2010
New Revision: 166258

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166258
Log:
2010-11-03  Richard Guenther  <rguenther@suse.de>

    PR middle-end/46288
    * predict.c (strip_predict_hints): Simply DCE builtin expect if
    the result is unused.

    * gcc.dg/pr46288.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/pr46288.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/predict.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug tree-optimization/46288] ICE: SIGSEGV in walk_gimple_op (gimple.c:2857) with -O -fno-tree-dce and __builtin_expect()
  2010-11-03 13:49 [Bug tree-optimization/46288] New: ICE: SIGSEGV in walk_gimple_op (gimple.c:2857) with -O -fno-tree-dce and __builtin_expect() zsojka at seznam dot cz
  2010-11-03 15:19 ` [Bug tree-optimization/46288] " rguenth at gcc dot gnu.org
  2010-11-03 16:59 ` rguenth at gcc dot gnu.org
@ 2010-11-03 16:59 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-03 16:59 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.6.0

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-11-03 16:59:23 UTC ---
Fixed for 4.6.


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

end of thread, other threads:[~2010-11-03 16:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-03 13:49 [Bug tree-optimization/46288] New: ICE: SIGSEGV in walk_gimple_op (gimple.c:2857) with -O -fno-tree-dce and __builtin_expect() zsojka at seznam dot cz
2010-11-03 15:19 ` [Bug tree-optimization/46288] " rguenth at gcc dot gnu.org
2010-11-03 16:59 ` rguenth at gcc dot gnu.org
2010-11-03 16:59 ` rguenth 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).