public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/51212] New: ICE: verify_flow_info failed: BB 3 can not throw but has an EH edge with -fgnu-tm -fnon-call-exceptions and transaction_callable
@ 2011-11-18 18:12 zsojka at seznam dot cz
  2011-12-14  2:29 ` [Bug middle-end/51212] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: zsojka at seznam dot cz @ 2011-11-18 18:12 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51212
           Summary: ICE: verify_flow_info failed: BB 3 can not throw but
                    has an EH edge with -fgnu-tm -fnon-call-exceptions and
                    transaction_callable
    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
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu


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

Compiler output:
$ gcc -fgnu-tm -fnon-call-exceptions testcase.C 
testcase.C: In function 'void foo(int*)':
testcase.C:9:6: error: BB 3 can not throw but has an EH edge
testcase.C:9:6: internal compiler error: verify_flow_info failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

(gdb) bt
#0  internal_error (gmsgid=0x1403c6b "verify_flow_info failed") at
/mnt/svn/gcc-trunk/gcc/diagnostic.c:839
#1  0x00000000007ff57f in verify_flow_info () at
/mnt/svn/gcc-trunk/gcc/cfghooks.c:259
#2  0x0000000000a6a0ef in execute_function_todo (data=Unhandled dwarf
expression opcode 0xf3
) at /mnt/svn/gcc-trunk/gcc/passes.c:1722
#3  0x0000000000a6a93d in execute_todo (flags=16392) at
/mnt/svn/gcc-trunk/gcc/passes.c:1751
#4  0x0000000000a6db5a in execute_one_pass (pass=0x199a740) at
/mnt/svn/gcc-trunk/gcc/passes.c:2097
#5  0x0000000000a6de85 in execute_pass_list (pass=0x199a740) at
/mnt/svn/gcc-trunk/gcc/passes.c:2129
#6  0x0000000000bcfafe in tree_rest_of_compilation (fndecl=0x7ffff56fdf00) at
/mnt/svn/gcc-trunk/gcc/tree-optimize.c:420
#7  0x0000000000823b5a in cgraph_expand_function (node=0x7ffff55876c0) at
/mnt/svn/gcc-trunk/gcc/cgraphunit.c:1819
#8  0x0000000000825c96 in cgraph_output_in_order () at
/mnt/svn/gcc-trunk/gcc/cgraphunit.c:1984
#9  cgraph_optimize () at /mnt/svn/gcc-trunk/gcc/cgraphunit.c:2194
#10 0x000000000082606a in cgraph_finalize_compilation_unit () at
/mnt/svn/gcc-trunk/gcc/cgraphunit.c:1327
#11 0x000000000064779b in cp_write_global_declarations () at
/mnt/svn/gcc-trunk/gcc/cp/decl2.c:4050
#12 0x0000000000b62d84 in compile_file (argc=15, argv=0x7fffffffdab8) at
/mnt/svn/gcc-trunk/gcc/toplev.c:581
#13 do_compile (argc=15, argv=0x7fffffffdab8) at
/mnt/svn/gcc-trunk/gcc/toplev.c:1931
#14 toplev_main (argc=15, argv=0x7fffffffdab8) at
/mnt/svn/gcc-trunk/gcc/toplev.c:2007
#15 0x00007ffff6178d2d in __libc_start_main () from /lib64/libc.so.6
#16 0x000000000056ba39 in _start ()

Tested revisions:
r181442 - crash


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

* [Bug middle-end/51212] ICE: verify_flow_info failed: BB 3 can not throw but has an EH edge with -fgnu-tm -fnon-call-exceptions and transaction_callable
  2011-11-18 18:12 [Bug middle-end/51212] New: ICE: verify_flow_info failed: BB 3 can not throw but has an EH edge with -fgnu-tm -fnon-call-exceptions and transaction_callable zsojka at seznam dot cz
@ 2011-12-14  2:29 ` pinskia at gcc dot gnu.org
  2011-12-21 16:29 ` aldyh at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-12-14  2:29 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-12-14
     Ever Confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-12-14 02:07:18 UTC ---
Confirmed, somehow the load from p is no longer marked as being throwing.


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

* [Bug middle-end/51212] ICE: verify_flow_info failed: BB 3 can not throw but has an EH edge with -fgnu-tm -fnon-call-exceptions and transaction_callable
  2011-11-18 18:12 [Bug middle-end/51212] New: ICE: verify_flow_info failed: BB 3 can not throw but has an EH edge with -fgnu-tm -fnon-call-exceptions and transaction_callable zsojka at seznam dot cz
  2011-12-14  2:29 ` [Bug middle-end/51212] " pinskia at gcc dot gnu.org
@ 2011-12-21 16:29 ` aldyh at gcc dot gnu.org
  2011-12-21 17:26 ` rth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: aldyh at gcc dot gnu.org @ 2011-12-21 16:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2011-12-21 16:28:12 UTC ---
The problem here is that with -fnon-call-exceptions, the load from *p may trap,
but when we instrument the store, we have lost the landing pad information.

We can save and attach the exception information to the instrumented load
(_ITM_RU*), but currently all the TM load/store builtins are marked as
no-throw.  Perhaps we can get rid of the no-throw bit when
-fnon-call-exceptions is enabled.

Maybe something like this:

1. Get rid of the NOTHROW bits from the TM load/store builtins.
2. Attach the EH information to the TM load/store calls.
3. Split the BB accordingly when the TM load/store calls are not the last in
the BB (because we have added a cast after the instrumentation).

How does this sound Richard?


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

* [Bug middle-end/51212] ICE: verify_flow_info failed: BB 3 can not throw but has an EH edge with -fgnu-tm -fnon-call-exceptions and transaction_callable
  2011-11-18 18:12 [Bug middle-end/51212] New: ICE: verify_flow_info failed: BB 3 can not throw but has an EH edge with -fgnu-tm -fnon-call-exceptions and transaction_callable zsojka at seznam dot cz
  2011-12-14  2:29 ` [Bug middle-end/51212] " pinskia at gcc dot gnu.org
  2011-12-21 16:29 ` aldyh at gcc dot gnu.org
@ 2011-12-21 17:26 ` rth at gcc dot gnu.org
  2011-12-22 20:21 ` aldyh at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rth at gcc dot gnu.org @ 2011-12-21 17:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Henderson <rth at gcc dot gnu.org> 2011-12-21 17:18:11 UTC ---
As far as the compiler goes that all sounds plausible.

The main problem is that we would have to make libitm exception safe.
I'm 100% sure that won't work at the moment.  I'm also sure that it
would be exceedingly awkward to take an exception in the middle of
the actual transaction.

Unless Torvald has a brilliant idea there, I'm inclined to simply
emit a sorry for combining -fgnu-tm and -fnon-call-exceptions.

Unless we redefine that combination such that we only support the
exception case for NULL, but non-null faulting memory references
just crash.  In that case we can simply test for NULL at the start
of the accessors and explicitly throw the exception.


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

* [Bug middle-end/51212] ICE: verify_flow_info failed: BB 3 can not throw but has an EH edge with -fgnu-tm -fnon-call-exceptions and transaction_callable
  2011-11-18 18:12 [Bug middle-end/51212] New: ICE: verify_flow_info failed: BB 3 can not throw but has an EH edge with -fgnu-tm -fnon-call-exceptions and transaction_callable zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2011-12-21 17:26 ` rth at gcc dot gnu.org
@ 2011-12-22 20:21 ` aldyh at gcc dot gnu.org
  2011-12-22 20:43 ` aldyh at gcc dot gnu.org
  2012-01-04 14:54 ` aldyh at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: aldyh at gcc dot gnu.org @ 2011-12-22 20:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2011-12-22 20:18:20 UTC ---
Author: aldyh
Date: Thu Dec 22 20:18:11 2011
New Revision: 182636

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182636
Log:
    PR middle-end/51212
    * opts.c (finish_options): Call sorry on -fgnu-tm and
    -fnon-call-exceptions combination.

Added:
    trunk/gcc/testsuite/g++.dg/tm/pr51212.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/opts.c


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

* [Bug middle-end/51212] ICE: verify_flow_info failed: BB 3 can not throw but has an EH edge with -fgnu-tm -fnon-call-exceptions and transaction_callable
  2011-11-18 18:12 [Bug middle-end/51212] New: ICE: verify_flow_info failed: BB 3 can not throw but has an EH edge with -fgnu-tm -fnon-call-exceptions and transaction_callable zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2011-12-22 20:21 ` aldyh at gcc dot gnu.org
@ 2011-12-22 20:43 ` aldyh at gcc dot gnu.org
  2012-01-04 14:54 ` aldyh at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: aldyh at gcc dot gnu.org @ 2011-12-22 20:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #5 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2011-12-22 20:19:24 UTC ---
fixed


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

* [Bug middle-end/51212] ICE: verify_flow_info failed: BB 3 can not throw but has an EH edge with -fgnu-tm -fnon-call-exceptions and transaction_callable
  2011-11-18 18:12 [Bug middle-end/51212] New: ICE: verify_flow_info failed: BB 3 can not throw but has an EH edge with -fgnu-tm -fnon-call-exceptions and transaction_callable zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2011-12-22 20:43 ` aldyh at gcc dot gnu.org
@ 2012-01-04 14:54 ` aldyh at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: aldyh at gcc dot gnu.org @ 2012-01-04 14:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2012-01-04 14:53:44 UTC ---
Author: aldyh
Date: Wed Jan  4 14:53:30 2012
New Revision: 182877

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182877
Log:
        PR middle-end/51212
        * opts.c (finish_options): Sorry out when using transactional
        memory and non-call exceptions.
        * doc/invoke.texi (C Dialect Options): Document it.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/doc/invoke.texi
    trunk/gcc/opts.c


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

end of thread, other threads:[~2012-01-04 14:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-18 18:12 [Bug middle-end/51212] New: ICE: verify_flow_info failed: BB 3 can not throw but has an EH edge with -fgnu-tm -fnon-call-exceptions and transaction_callable zsojka at seznam dot cz
2011-12-14  2:29 ` [Bug middle-end/51212] " pinskia at gcc dot gnu.org
2011-12-21 16:29 ` aldyh at gcc dot gnu.org
2011-12-21 17:26 ` rth at gcc dot gnu.org
2011-12-22 20:21 ` aldyh at gcc dot gnu.org
2011-12-22 20:43 ` aldyh at gcc dot gnu.org
2012-01-04 14:54 ` 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).