public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/50769] New: [4.7 Regression] ICE: in phi_alternatives_equal, at tree-cfgcleanup.c:355 with -O2 -fno-delete-null-pointer-checks -fno-guess-branch-probability -fipa-pta
@ 2011-10-17 20:54 zsojka at seznam dot cz
  2011-10-18  9:32 ` [Bug tree-optimization/50769] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: zsojka at seznam dot cz @ 2011-10-17 20:54 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50769
           Summary: [4.7 Regression] ICE: in phi_alternatives_equal, at
                    tree-cfgcleanup.c:355 with -O2
                    -fno-delete-null-pointer-checks
                    -fno-guess-branch-probability -fipa-pta
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu


Created attachment 25533
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25533
testsuite/gfortran.dg/alloc_comp_optional_1.f90

Testcase is from the testsuite,
gcc/testsuite/gfortran.dg/alloc_comp_optional_1.f90

Compiler output:
$ gcc -O2 -fno-delete-null-pointer-checks -fno-guess-branch-probability
-fipa-pta testsuite/gfortran.dg/alloc_comp_optional_1.f90
testsuite/gfortran.dg/alloc_comp_optional_1.f90: In function 'main':
testsuite/gfortran.dg/alloc_comp_optional_1.f90:18:0: internal compiler error:
in phi_alternatives_equal, at tree-cfgcleanup.c:355
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

(gdb) bt
#0  fancy_abort (file=0x12f2e68 "/mnt/svn/gcc-trunk/gcc/tree-cfgcleanup.c",
line=355, function=0x12f2fc0 "phi_alternatives_equal")
    at /mnt/svn/gcc-trunk/gcc/diagnostic.c:892
#1  0x0000000000a56c4a in phi_alternatives_equal (dest=Unhandled dwarf
expression opcode 0xf3
) at /mnt/svn/gcc-trunk/gcc/tree-cfgcleanup.c:355
#2  0x0000000000a58052 in remove_forwarder_block (bb=0x7ffff56c88f0) at
/mnt/svn/gcc-trunk/gcc/tree-cfgcleanup.c:418
#3  cleanup_tree_cfg_bb (bb=0x7ffff56c88f0) at
/mnt/svn/gcc-trunk/gcc/tree-cfgcleanup.c:657
#4  cleanup_tree_cfg_bb (bb=0x7ffff56c88f0) at
/mnt/svn/gcc-trunk/gcc/tree-cfgcleanup.c:647
#5  0x0000000000a591c9 in cleanup_tree_cfg_1 () at
/mnt/svn/gcc-trunk/gcc/tree-cfgcleanup.c:699
#6  cleanup_tree_cfg_noloop () at /mnt/svn/gcc-trunk/gcc/tree-cfgcleanup.c:755
#7  cleanup_tree_cfg () at /mnt/svn/gcc-trunk/gcc/tree-cfgcleanup.c:805
#8  0x000000000094648d in execute_function_todo (data=Unhandled dwarf
expression opcode 0xf3
) at /mnt/svn/gcc-trunk/gcc/passes.c:1664
#9  0x0000000000946d0d in execute_todo (flags=16447) at
/mnt/svn/gcc-trunk/gcc/passes.c:1741
#10 0x0000000000949f0a in execute_one_pass (pass=0x1822760) at
/mnt/svn/gcc-trunk/gcc/passes.c:2087
#11 0x000000000094a205 in execute_pass_list (pass=0x1822760) at
/mnt/svn/gcc-trunk/gcc/passes.c:2119
#12 0x000000000094a217 in execute_pass_list (pass=0x1821680) at
/mnt/svn/gcc-trunk/gcc/passes.c:2120
#13 0x0000000000aa12be in tree_rest_of_compilation (fndecl=0x7ffff5697700) at
/mnt/svn/gcc-trunk/gcc/tree-optimize.c:420
#14 0x00000000006fb80a in cgraph_expand_function (node=0x7ffff5586d80) at
/mnt/svn/gcc-trunk/gcc/cgraphunit.c:1804
#15 0x00000000006fd75c in cgraph_expand_all_functions () at
/mnt/svn/gcc-trunk/gcc/cgraphunit.c:1871
#16 cgraph_optimize () at /mnt/svn/gcc-trunk/gcc/cgraphunit.c:2148
#17 0x00000000006fdb4a in cgraph_finalize_compilation_unit () at
/mnt/svn/gcc-trunk/gcc/cgraphunit.c:1312
#18 0x00000000008f525d in write_global_declarations () at
/mnt/svn/gcc-trunk/gcc/langhooks.c:303
#19 0x0000000000a3f364 in compile_file (argc=17, argv=0x7fffffffd9c8) at
/mnt/svn/gcc-trunk/gcc/toplev.c:581
#20 do_compile (argc=17, argv=0x7fffffffd9c8) at
/mnt/svn/gcc-trunk/gcc/toplev.c:1925
#21 toplev_main (argc=17, argv=0x7fffffffd9c8) at
/mnt/svn/gcc-trunk/gcc/toplev.c:2001
#22 0x00007ffff6178d2d in __libc_start_main () from /lib64/libc.so.6
#23 0x000000000056e629 in _start ()


Tested revisions:
r180104 - crash
r179959 - crash
r178498 - OK
4.6 r177922 - OK


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

* [Bug tree-optimization/50769] [4.7 Regression] ICE: in phi_alternatives_equal, at tree-cfgcleanup.c:355 with -O2 -fno-delete-null-pointer-checks -fno-guess-branch-probability -fipa-pta
  2011-10-17 20:54 [Bug tree-optimization/50769] New: [4.7 Regression] ICE: in phi_alternatives_equal, at tree-cfgcleanup.c:355 with -O2 -fno-delete-null-pointer-checks -fno-guess-branch-probability -fipa-pta zsojka at seznam dot cz
@ 2011-10-18  9:32 ` rguenth at gcc dot gnu.org
  2011-10-18 14:11 ` vries at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-18  9:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-10-18
                 CC|                            |tom at codesourcery dot com
   Target Milestone|---                         |4.7.0
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-10-18 09:32:05 UTC ---
Happens after PRE, -fno-tree-tail-merge fixes it.


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

* [Bug tree-optimization/50769] [4.7 Regression] ICE: in phi_alternatives_equal, at tree-cfgcleanup.c:355 with -O2 -fno-delete-null-pointer-checks -fno-guess-branch-probability -fipa-pta
  2011-10-17 20:54 [Bug tree-optimization/50769] New: [4.7 Regression] ICE: in phi_alternatives_equal, at tree-cfgcleanup.c:355 with -O2 -fno-delete-null-pointer-checks -fno-guess-branch-probability -fipa-pta zsojka at seznam dot cz
  2011-10-18  9:32 ` [Bug tree-optimization/50769] " rguenth at gcc dot gnu.org
@ 2011-10-18 14:11 ` vries at gcc dot gnu.org
  2011-10-18 14:32 ` vries at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: vries at gcc dot gnu.org @ 2011-10-18 14:11 UTC (permalink / raw)
  To: gcc-bugs

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

vries at gcc dot gnu.org changed:

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


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

* [Bug tree-optimization/50769] [4.7 Regression] ICE: in phi_alternatives_equal, at tree-cfgcleanup.c:355 with -O2 -fno-delete-null-pointer-checks -fno-guess-branch-probability -fipa-pta
  2011-10-17 20:54 [Bug tree-optimization/50769] New: [4.7 Regression] ICE: in phi_alternatives_equal, at tree-cfgcleanup.c:355 with -O2 -fno-delete-null-pointer-checks -fno-guess-branch-probability -fipa-pta zsojka at seznam dot cz
  2011-10-18  9:32 ` [Bug tree-optimization/50769] " rguenth at gcc dot gnu.org
  2011-10-18 14:11 ` vries at gcc dot gnu.org
@ 2011-10-18 14:32 ` vries at gcc dot gnu.org
  2011-10-18 17:17 ` vries at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: vries at gcc dot gnu.org @ 2011-10-18 14:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from vries at gcc dot gnu.org 2011-10-18 14:32:11 UTC ---
Created attachment 25544
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25544
tentative patch

This PR is similar to PR50672.

We discover that blocks 6 and 7 are equal and remove block 7, and redirect the
outgoing edge of it's predecessor block 11 to block 6. Block 6 contains a phi,
which after redirection looks like this:
...
.MEM_54 = PHI <.MEM_27(18), .MEM_26(17), (11)>
...

Since update_vops is false, we know TODO_update_ssa_only_virtuals will be run
and we don't update the phi. But we need to make the phi argument valid, just
like in PR50672.

The patch sets the empty phi argument to .MEM.


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

* [Bug tree-optimization/50769] [4.7 Regression] ICE: in phi_alternatives_equal, at tree-cfgcleanup.c:355 with -O2 -fno-delete-null-pointer-checks -fno-guess-branch-probability -fipa-pta
  2011-10-17 20:54 [Bug tree-optimization/50769] New: [4.7 Regression] ICE: in phi_alternatives_equal, at tree-cfgcleanup.c:355 with -O2 -fno-delete-null-pointer-checks -fno-guess-branch-probability -fipa-pta zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2011-10-18 14:32 ` vries at gcc dot gnu.org
@ 2011-10-18 17:17 ` vries at gcc dot gnu.org
  2011-10-19 16:30 ` vries at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: vries at gcc dot gnu.org @ 2011-10-18 17:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from vries at gcc dot gnu.org 2011-10-18 17:16:15 UTC ---
Created attachment 25546
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25546
update patch

currently testing on x86_64.


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

* [Bug tree-optimization/50769] [4.7 Regression] ICE: in phi_alternatives_equal, at tree-cfgcleanup.c:355 with -O2 -fno-delete-null-pointer-checks -fno-guess-branch-probability -fipa-pta
  2011-10-17 20:54 [Bug tree-optimization/50769] New: [4.7 Regression] ICE: in phi_alternatives_equal, at tree-cfgcleanup.c:355 with -O2 -fno-delete-null-pointer-checks -fno-guess-branch-probability -fipa-pta zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2011-10-18 17:17 ` vries at gcc dot gnu.org
@ 2011-10-19 16:30 ` vries at gcc dot gnu.org
  2011-10-19 16:33 ` vries at gcc dot gnu.org
  2011-11-02 20:16 ` vries at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: vries at gcc dot gnu.org @ 2011-10-19 16:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from vries at gcc dot gnu.org 2011-10-19 16:29:52 UTC ---
Author: vries
Date: Wed Oct 19 16:29:42 2011
New Revision: 180197

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=180197
Log:
2011-10-19  Tom de Vries  <tom@codesourcery.com>

    PR tree-optimization/50769
    * tree-ssa-tail-merge.c (replace_block_by): Calculate phi_vuse2
    unconditionally.  Handle case that phi_vuse2 is not an SSA_NAME.  Add
    dummy argument .MEM to phi when increasing number of arguments of phi by
    redirecting edges to the block with phi.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-ssa-tail-merge.c


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

* [Bug tree-optimization/50769] [4.7 Regression] ICE: in phi_alternatives_equal, at tree-cfgcleanup.c:355 with -O2 -fno-delete-null-pointer-checks -fno-guess-branch-probability -fipa-pta
  2011-10-17 20:54 [Bug tree-optimization/50769] New: [4.7 Regression] ICE: in phi_alternatives_equal, at tree-cfgcleanup.c:355 with -O2 -fno-delete-null-pointer-checks -fno-guess-branch-probability -fipa-pta zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2011-10-19 16:30 ` vries at gcc dot gnu.org
@ 2011-10-19 16:33 ` vries at gcc dot gnu.org
  2011-11-02 20:16 ` vries at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: vries at gcc dot gnu.org @ 2011-10-19 16:33 UTC (permalink / raw)
  To: gcc-bugs

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

vries at gcc dot gnu.org changed:

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

--- Comment #5 from vries at gcc dot gnu.org 2011-10-19 16:32:35 UTC ---
patch checked in, marking fixed.


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

* [Bug tree-optimization/50769] [4.7 Regression] ICE: in phi_alternatives_equal, at tree-cfgcleanup.c:355 with -O2 -fno-delete-null-pointer-checks -fno-guess-branch-probability -fipa-pta
  2011-10-17 20:54 [Bug tree-optimization/50769] New: [4.7 Regression] ICE: in phi_alternatives_equal, at tree-cfgcleanup.c:355 with -O2 -fno-delete-null-pointer-checks -fno-guess-branch-probability -fipa-pta zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2011-10-19 16:33 ` vries at gcc dot gnu.org
@ 2011-11-02 20:16 ` vries at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: vries at gcc dot gnu.org @ 2011-11-02 20:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from vries at gcc dot gnu.org 2011-11-02 20:16:06 UTC ---
Author: vries
Date: Wed Nov  2 20:15:55 2011
New Revision: 180793

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=180793
Log:
2011-11-02  Tom de Vries  <tom@codesourcery.com>

    PR tree-optimization/50769
    * gfortran.dg/pr50769.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/pr50769.f90
Modified:
    trunk/gcc/testsuite/ChangeLog


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

end of thread, other threads:[~2011-11-02 20:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-17 20:54 [Bug tree-optimization/50769] New: [4.7 Regression] ICE: in phi_alternatives_equal, at tree-cfgcleanup.c:355 with -O2 -fno-delete-null-pointer-checks -fno-guess-branch-probability -fipa-pta zsojka at seznam dot cz
2011-10-18  9:32 ` [Bug tree-optimization/50769] " rguenth at gcc dot gnu.org
2011-10-18 14:11 ` vries at gcc dot gnu.org
2011-10-18 14:32 ` vries at gcc dot gnu.org
2011-10-18 17:17 ` vries at gcc dot gnu.org
2011-10-19 16:30 ` vries at gcc dot gnu.org
2011-10-19 16:33 ` vries at gcc dot gnu.org
2011-11-02 20:16 ` vries 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).