public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/51211] New: ICE: SIGSEGV in execute_tm_mark (trans-mem.c:2242) with -fgnu-tm -O -freorder-blocks -ftracer --param hot-bb-frequency-fraction=1 and __transaction_atomic
@ 2011-11-18 17:42 zsojka at seznam dot cz
  2011-11-18 18:29 ` [Bug middle-end/51211] " patrick.marlier at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: zsojka at seznam dot cz @ 2011-11-18 17:42 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51211
           Summary: ICE: SIGSEGV in execute_tm_mark (trans-mem.c:2242)
                    with -fgnu-tm -O -freorder-blocks -ftracer --param
                    hot-bb-frequency-fraction=1 and __transaction_atomic
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz
                CC: amacleod@redhat.com, patrick.marlier@gmail.com
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu


Created attachment 25852
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25852
reduced testcase (from g++.dg/tm/nested-2.C)

Compiler output:
$ gcc -fgnu-tm -O -freorder-blocks -ftracer --param hot-bb-frequency-fraction=1
testcase.c
==11106== Invalid read of size 1
==11106==    at 0x9DFE6E: execute_tm_mark() (trans-mem.c:2242)
==11106==    by 0x8DF684: execute_one_pass(opt_pass*) (passes.c:2074)
==11106==    by 0x8DFA24: execute_pass_list(opt_pass*) (passes.c:2129)
==11106==    by 0x8DFA36: execute_pass_list(opt_pass*) (passes.c:2130)
==11106==    by 0xA4169D: tree_rest_of_compilation(tree_node*)
(tree-optimize.c:420)
==11106==    by 0x694D19: cgraph_expand_function(cgraph_node*)
(cgraphunit.c:1819)
==11106==    by 0x696ABB: cgraph_optimize() (cgraphunit.c:1886)
==11106==    by 0x697229: cgraph_finalize_compilation_unit()
(cgraphunit.c:1327)
==11106==    by 0x574EDF: c_write_global_declarations() (c-decl.c:10023)
==11106==    by 0x9D4923: toplev_main(int, char**) (toplev.c:581)
==11106==    by 0x674ED2C: (below main) (in /lib64/libc-2.12.2.so)
==11106==  Address 0xb0 is not stack'd, malloc'd or (recently) free'd
==11106== 
testcase.c: In function 'foo':
testcase.c:4:1: 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.

Tested revisions:
r181442 - crash


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

* [Bug middle-end/51211] ICE: SIGSEGV in execute_tm_mark (trans-mem.c:2242) with -fgnu-tm -O -freorder-blocks -ftracer --param hot-bb-frequency-fraction=1 and __transaction_atomic
  2011-11-18 17:42 [Bug middle-end/51211] New: ICE: SIGSEGV in execute_tm_mark (trans-mem.c:2242) with -fgnu-tm -O -freorder-blocks -ftracer --param hot-bb-frequency-fraction=1 and __transaction_atomic zsojka at seznam dot cz
@ 2011-11-18 18:29 ` patrick.marlier at gmail dot com
  2011-11-18 22:58 ` patrick.marlier at gmail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: patrick.marlier at gmail dot com @ 2011-11-18 18:29 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Marlier <patrick.marlier at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aldyh at gcc dot gnu.org

--- Comment #1 from Patrick Marlier <patrick.marlier at gmail dot com> 2011-11-18 18:11:56 UTC ---
This seems to solve the issue but we need to figure out why we get _ITM_RU
here.
Thanks for reporting :)

Patrick Marlier.

Index: trans-mem.c
===================================================================
--- trans-mem.c (revision 181466)
+++ trans-mem.c (working copy)
@@ -2211,6 +2211,9 @@
   if (fn_decl == builtin_decl_explicit (BUILT_IN_TM_MEMSET))
     transaction_subcode_ior (region, GTMA_HAVE_STORE);

+  if (flags_from_decl_or_type (fn_decl) & ECF_TM_BUILTIN)
+    return false;
+
   if (is_tm_pure_call (stmt))
     return false;


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

* [Bug middle-end/51211] ICE: SIGSEGV in execute_tm_mark (trans-mem.c:2242) with -fgnu-tm -O -freorder-blocks -ftracer --param hot-bb-frequency-fraction=1 and __transaction_atomic
  2011-11-18 17:42 [Bug middle-end/51211] New: ICE: SIGSEGV in execute_tm_mark (trans-mem.c:2242) with -fgnu-tm -O -freorder-blocks -ftracer --param hot-bb-frequency-fraction=1 and __transaction_atomic zsojka at seznam dot cz
  2011-11-18 18:29 ` [Bug middle-end/51211] " patrick.marlier at gmail dot com
@ 2011-11-18 22:58 ` patrick.marlier at gmail dot com
  2011-11-19 19:39 ` rth at gcc dot gnu.org
  2011-11-21 15:55 ` aldyh at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: patrick.marlier at gmail dot com @ 2011-11-18 22:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Patrick Marlier <patrick.marlier at gmail dot com> 2011-11-18 22:52:44 UTC ---
After looking at it. I guess the problem was in the tracer...
The tracer tries to duplicate the BB where the __transaction_atomic is.
Unfortunately this is not valid with trans-mem passes. Either duplicate all
blocks of the transaction or forbid the duplicate of the block. I choose the
second one.

Patrick Marlier.

Index: gcc/tracer.c
===================================================================
--- gcc/tracer.c        (revision 181425)
+++ gcc/tracer.c        (working copy)
@@ -90,10 +90,14 @@
 static bool
 ignore_bb_p (const_basic_block bb)
 {
+  gimple g;
   if (bb->index < NUM_FIXED_BLOCKS)
     return true;
   if (optimize_bb_for_size_p (bb))
     return true;
+  g = last_stmt (CONST_CAST_BB (bb));
+  if (g && gimple_code (g) == GIMPLE_TRANSACTION)
+    return true;
   return false;
 }


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

* [Bug middle-end/51211] ICE: SIGSEGV in execute_tm_mark (trans-mem.c:2242) with -fgnu-tm -O -freorder-blocks -ftracer --param hot-bb-frequency-fraction=1 and __transaction_atomic
  2011-11-18 17:42 [Bug middle-end/51211] New: ICE: SIGSEGV in execute_tm_mark (trans-mem.c:2242) with -fgnu-tm -O -freorder-blocks -ftracer --param hot-bb-frequency-fraction=1 and __transaction_atomic zsojka at seznam dot cz
  2011-11-18 18:29 ` [Bug middle-end/51211] " patrick.marlier at gmail dot com
  2011-11-18 22:58 ` patrick.marlier at gmail dot com
@ 2011-11-19 19:39 ` rth at gcc dot gnu.org
  2011-11-21 15:55 ` aldyh at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rth at gcc dot gnu.org @ 2011-11-19 19:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Henderson <rth at gcc dot gnu.org> 2011-11-19 19:29:22 UTC ---
Author: rth
Date: Sat Nov 19 19:29:18 2011
New Revision: 181512

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181512
Log:
PR middle-end/51211
        * tracer.c (ignore_bb_p): Don't copy GIMPLE_TRANSACTION.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tracer.c


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

* [Bug middle-end/51211] ICE: SIGSEGV in execute_tm_mark (trans-mem.c:2242) with -fgnu-tm -O -freorder-blocks -ftracer --param hot-bb-frequency-fraction=1 and __transaction_atomic
  2011-11-18 17:42 [Bug middle-end/51211] New: ICE: SIGSEGV in execute_tm_mark (trans-mem.c:2242) with -fgnu-tm -O -freorder-blocks -ftracer --param hot-bb-frequency-fraction=1 and __transaction_atomic zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2011-11-19 19:39 ` rth at gcc dot gnu.org
@ 2011-11-21 15:55 ` aldyh at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: aldyh at gcc dot gnu.org @ 2011-11-21 15:55 UTC (permalink / raw)
  To: gcc-bugs

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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

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

--- Comment #4 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2011-11-21 15:22:02 UTC ---
Thanks Patrick.


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

end of thread, other threads:[~2011-11-21 15:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-18 17:42 [Bug middle-end/51211] New: ICE: SIGSEGV in execute_tm_mark (trans-mem.c:2242) with -fgnu-tm -O -freorder-blocks -ftracer --param hot-bb-frequency-fraction=1 and __transaction_atomic zsojka at seznam dot cz
2011-11-18 18:29 ` [Bug middle-end/51211] " patrick.marlier at gmail dot com
2011-11-18 22:58 ` patrick.marlier at gmail dot com
2011-11-19 19:39 ` rth at gcc dot gnu.org
2011-11-21 15:55 ` aldyh 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).