public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/46755] New: ICE: in calc_dfs_tree, at dominance.c:395 with -O
@ 2010-12-01 22:46 zsojka at seznam dot cz
  2010-12-01 23:02 ` [Bug rtl-optimization/46755] " zsojka at seznam dot cz
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: zsojka at seznam dot cz @ 2010-12-01 22:46 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: ICE: in calc_dfs_tree, at dominance.c:395 with -O
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu


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

Compiler output:
$ gcc -O pr46755.f
pr46755.f:3.72:

      ASSIGN 801 TO I800 ! { dg-warning "Deleted feature: ASSIGN" "Delet
                                                                        1
Warning: Deleted feature: ASSIGN statement at (1)
pr46755.f:6.72:

      ASSIGN 761 TO I760 ! { dg-warning "Deleted feature: ASSIGN" "Delet
                                                                        1
Warning: Deleted feature: ASSIGN statement at (1)
pr46755.f:16.72:

            ASSIGN 641 to I640 ! { dg-warning "Deleted feature: ASSIGN" 
                                                                        1
Warning: Deleted feature: ASSIGN statement at (1)
pr46755.f:25.16:

      GOTO I760 ! { dg-warning "Deleted feature: Assigned" "Assigned GO 
                1
Warning: Deleted feature: Assigned GOTO statement at (1)
pr46755.f:27.16:

      GOTO I800 ! { dg-warning "Deleted feature: Assigned" "Assigned GO 
                1
Warning: Deleted feature: Assigned GOTO statement at (1)
pr46755.f: In function 'MAIN__':
pr46755.f:28:0: internal compiler error: in calc_dfs_tree, at dominance.c:395
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Backtrace:
(gdb) bt
#0  fancy_abort (file=0x11415e8 "/mnt/svn/gcc-trunk/gcc/dominance.c", line=395,
function=0x11416a5 "calc_dfs_tree")
    at /mnt/svn/gcc-trunk/gcc/diagnostic.c:892
#1  0x0000000000698483 in calc_dfs_tree (di=0x7fffffffd770, reverse=0 '\000')
at /mnt/svn/gcc-trunk/gcc/dominance.c:395
#2  0x0000000000699d60 in calculate_dominance_info (dir=CDI_DOMINATORS) at
/mnt/svn/gcc-trunk/gcc/dominance.c:656
#3  0x0000000000650e9d in flow_loops_find (loops=0x16c36c0) at
/mnt/svn/gcc-trunk/gcc/cfgloop.c:386
#4  0x00000000007e0934 in ira (f=<value optimized out>) at
/mnt/svn/gcc-trunk/gcc/ira.c:3168
#5  0x00000000007e2840 in rest_of_handle_ira () at
/mnt/svn/gcc-trunk/gcc/ira.c:3346
#6  0x0000000000849fef in execute_one_pass (pass=0x1676ea0) at
/mnt/svn/gcc-trunk/gcc/passes.c:1553
#7  0x000000000084a2b5 in execute_pass_list (pass=0x1676ea0) at
/mnt/svn/gcc-trunk/gcc/passes.c:1608
#8  0x000000000084a2c7 in execute_pass_list (pass=0x16773c0) at
/mnt/svn/gcc-trunk/gcc/passes.c:1609
#9  0x000000000098a416 in tree_rest_of_compilation (fndecl=0x7ffff7fc0f00) at
/mnt/svn/gcc-trunk/gcc/tree-optimize.c:422
#10 0x0000000000b4fea2 in cgraph_expand_function (node=0x7ffff5cbb000) at
/mnt/svn/gcc-trunk/gcc/cgraphunit.c:1508
#11 0x0000000000b5247a in cgraph_expand_all_functions () at
/mnt/svn/gcc-trunk/gcc/cgraphunit.c:1567
#12 cgraph_optimize () at /mnt/svn/gcc-trunk/gcc/cgraphunit.c:1827
#13 0x0000000000b529fa in cgraph_finalize_compilation_unit () at
/mnt/svn/gcc-trunk/gcc/cgraphunit.c:1031
#14 0x000000000080313d in write_global_declarations () at
/mnt/svn/gcc-trunk/gcc/langhooks.c:303
#15 0x0000000000933ed0 in compile_file (argc=15, argv=0x7fffffffdbf8) at
/mnt/svn/gcc-trunk/gcc/toplev.c:591
#16 do_compile (argc=15, argv=0x7fffffffdbf8) at
/mnt/svn/gcc-trunk/gcc/toplev.c:1874
#17 toplev_main (argc=15, argv=0x7fffffffdbf8) at
/mnt/svn/gcc-trunk/gcc/toplev.c:1937
#18 0x00007ffff6586bbd in __libc_start_main () from /lib/libc.so.6
#19 0x00000000004fe129 in _start ()

Tested revisions:
r167331 - crash
4.5 r166509 - crash
4.4 r166509 - crash

Testcase is auto-reduced from 20010519-1.f, I hit this ICE when reducing for
different problem. I don't know if this code should be considered valid or
invalid.


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

* [Bug rtl-optimization/46755] ICE: in calc_dfs_tree, at dominance.c:395 with -O
  2010-12-01 22:46 [Bug rtl-optimization/46755] New: ICE: in calc_dfs_tree, at dominance.c:395 with -O zsojka at seznam dot cz
@ 2010-12-01 23:02 ` zsojka at seznam dot cz
  2010-12-01 23:09 ` steven at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: zsojka at seznam dot cz @ 2010-12-01 23:02 UTC (permalink / raw)
  To: gcc-bugs

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

Zdenek Sojka <zsojka at seznam dot cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code

--- Comment #1 from Zdenek Sojka <zsojka at seznam dot cz> 2010-12-01 23:02:46 UTC ---
It crashes with -std=legacy as well:

$ gfortran -O pr46755.f -std=legacy
pr46755.f: In function 'MAIN__':
pr46755.f:28:0: internal compiler error: in calc_dfs_tree, at dominance.c:395
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


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

* [Bug rtl-optimization/46755] ICE: in calc_dfs_tree, at dominance.c:395 with -O
  2010-12-01 22:46 [Bug rtl-optimization/46755] New: ICE: in calc_dfs_tree, at dominance.c:395 with -O zsojka at seznam dot cz
  2010-12-01 23:02 ` [Bug rtl-optimization/46755] " zsojka at seznam dot cz
@ 2010-12-01 23:09 ` steven at gcc dot gnu.org
  2010-12-03  8:25 ` zsojka at seznam dot cz
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: steven at gcc dot gnu.org @ 2010-12-01 23:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2010.12.01 23:09:35
                 CC|                            |steven at gcc dot gnu.org
         AssignedTo|unassigned at gcc dot       |steven at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #2 from Steven Bosscher <steven at gcc dot gnu.org> 2010-12-01 23:09:35 UTC ---
Weird but technically valid code. I'll investigate.


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

* [Bug rtl-optimization/46755] ICE: in calc_dfs_tree, at dominance.c:395 with -O
  2010-12-01 22:46 [Bug rtl-optimization/46755] New: ICE: in calc_dfs_tree, at dominance.c:395 with -O zsojka at seznam dot cz
  2010-12-01 23:02 ` [Bug rtl-optimization/46755] " zsojka at seznam dot cz
  2010-12-01 23:09 ` steven at gcc dot gnu.org
@ 2010-12-03  8:25 ` zsojka at seznam dot cz
  2010-12-17 20:40 ` steven at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: zsojka at seznam dot cz @ 2010-12-03  8:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Zdenek Sojka <zsojka at seznam dot cz> 2010-12-03 08:25:50 UTC ---
PR46465 might be related, it has the same backtrace and uses computed gotos as
well.


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

* [Bug rtl-optimization/46755] ICE: in calc_dfs_tree, at dominance.c:395 with -O
  2010-12-01 22:46 [Bug rtl-optimization/46755] New: ICE: in calc_dfs_tree, at dominance.c:395 with -O zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2010-12-03  8:25 ` zsojka at seznam dot cz
@ 2010-12-17 20:40 ` steven at gcc dot gnu.org
  2010-12-21 14:55 ` steven at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: steven at gcc dot gnu.org @ 2010-12-17 20:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Steven Bosscher <steven at gcc dot gnu.org> 2010-12-17 20:40:20 UTC ---
*** Bug 46465 has been marked as a duplicate of this bug. ***


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

* [Bug rtl-optimization/46755] ICE: in calc_dfs_tree, at dominance.c:395 with -O
  2010-12-01 22:46 [Bug rtl-optimization/46755] New: ICE: in calc_dfs_tree, at dominance.c:395 with -O zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2010-12-17 20:40 ` steven at gcc dot gnu.org
@ 2010-12-21 14:55 ` steven at gcc dot gnu.org
  2010-12-21 20:17 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: steven at gcc dot gnu.org @ 2010-12-21 14:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Steven Bosscher <steven at gcc dot gnu.org> 2010-12-21 14:55:43 UTC ---
Author: steven
Date: Tue Dec 21 14:55:41 2010
New Revision: 168118

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=168118
Log:
gcc/
    PR rtl-optimization/46755
    * ira.c (ira): If some dead edges were removed, find and delete
    any blocks that might have become unreachable.

testsuite/
    PR rtl-optimization/46755
    * gfortran.dg/pr46755.f: New test

Added:
    trunk/gcc/testsuite/gfortran.dg/pr46755.f
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ira.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug rtl-optimization/46755] ICE: in calc_dfs_tree, at dominance.c:395 with -O
  2010-12-01 22:46 [Bug rtl-optimization/46755] New: ICE: in calc_dfs_tree, at dominance.c:395 with -O zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2010-12-21 14:55 ` steven at gcc dot gnu.org
@ 2010-12-21 20:17 ` jakub at gcc dot gnu.org
  2010-12-21 20:55 ` steven at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-12-21 20:17 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-12-21 20:17:06 UTC ---
dg-options misses -std=legacy, so it diagnoses deleted features and thus the
testcase fails.


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

* [Bug rtl-optimization/46755] ICE: in calc_dfs_tree, at dominance.c:395 with -O
  2010-12-01 22:46 [Bug rtl-optimization/46755] New: ICE: in calc_dfs_tree, at dominance.c:395 with -O zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2010-12-21 20:17 ` jakub at gcc dot gnu.org
@ 2010-12-21 20:55 ` steven at gcc dot gnu.org
  2011-01-02 20:48 ` regehr at cs dot utah.edu
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: steven at gcc dot gnu.org @ 2010-12-21 20:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Steven Bosscher <steven at gcc dot gnu.org> 2010-12-21 20:55:26 UTC ---
No, the test case I had in testsuite had the dg-warning markers of the original
test case.

I will fix my commit. This isn't my day today, I also managed to forget
committing ChangeLogs for another bug fix...


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

* [Bug rtl-optimization/46755] ICE: in calc_dfs_tree, at dominance.c:395 with -O
  2010-12-01 22:46 [Bug rtl-optimization/46755] New: ICE: in calc_dfs_tree, at dominance.c:395 with -O zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2010-12-21 20:55 ` steven at gcc dot gnu.org
@ 2011-01-02 20:48 ` regehr at cs dot utah.edu
  2011-01-02 23:13 ` hjl.tools at gmail dot com
  2011-01-03 10:19 ` jakub at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: regehr at cs dot utah.edu @ 2011-01-02 20:48 UTC (permalink / raw)
  To: gcc-bugs

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

John Regehr <regehr at cs dot utah.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |regehr at cs dot utah.edu

--- Comment #8 from John Regehr <regehr at cs dot utah.edu> 2011-01-02 20:48:22 UTC ---
Not sure if this is still useful, but here's a fairly small failure-inducing
testcase for this bug for today's GCC.

[regehr@gamow tmp437]$ current-gcc -O2 -c small.c

small.c: In function 'func':
small.c:32:1: internal compiler error: in calc_dfs_tree, at dominance.c:395
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[regehr@gamow tmp437]$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r168402-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r168402-install
--program-prefix=r168402- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20110102 (experimental) (GCC) 

[regehr@gamow tmp437]$ cat small.c


static int
foo (int si1, short si2)
{
  return ((si1 ^ si2) & ((si1 ^ (si1 ^ si2) & ~2147483647) - si2 ^ si2)) <
    0 ? si1 : si1 - si2;
}

struct S0
{
  const unsigned f3:1;
  const unsigned f8:1;
};
struct S0 g_111 = {
  1
};

struct S0 g_139 = {
  1
};

unsigned long int g_22;

void safe (int);
int func_42 (void);

void func (void)
{
  safe (foo (func_42 () != (g_139.f3 | g_111.f8), -1L));
  for (g_22 = 0; g_22; g_22 = 1)
    {
    }
}


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

* [Bug rtl-optimization/46755] ICE: in calc_dfs_tree, at dominance.c:395 with -O
  2010-12-01 22:46 [Bug rtl-optimization/46755] New: ICE: in calc_dfs_tree, at dominance.c:395 with -O zsojka at seznam dot cz
                   ` (7 preceding siblings ...)
  2011-01-02 20:48 ` regehr at cs dot utah.edu
@ 2011-01-02 23:13 ` hjl.tools at gmail dot com
  2011-01-03 10:19 ` jakub at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: hjl.tools at gmail dot com @ 2011-01-02 23:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from H.J. Lu <hjl.tools at gmail dot com> 2011-01-02 23:12:46 UTC ---
(In reply to comment #8)
> Not sure if this is still useful, but here's a fairly small failure-inducing
> testcase for this bug for today's GCC.
> 
> [regehr@gamow tmp437]$ current-gcc -O2 -c small.c
> 
> small.c: In function 'func':
> small.c:32:1: internal compiler error: in calc_dfs_tree, at dominance.c:395
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.
> 
> [regehr@gamow tmp437]$ current-gcc -v
> 
> Using built-in specs.
> COLLECT_GCC=current-gcc
> COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r168402-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
> Target: x86_64-unknown-linux-gnu
> Configured with: ../configure --with-libelf=/usr/local --enable-lto
> --prefix=/home/regehr/z/compiler-install/gcc-r168402-install
> --program-prefix=r168402- --enable-languages=c,c++
> Thread model: posix
> gcc version 4.6.0 20110102 (experimental) (GCC) 
> 
> [regehr@gamow tmp437]$ cat small.c
> 
> 
> static int
> foo (int si1, short si2)
> {
>   return ((si1 ^ si2) & ((si1 ^ (si1 ^ si2) & ~2147483647) - si2 ^ si2)) <
>     0 ? si1 : si1 - si2;
> }
> 
> struct S0
> {
>   const unsigned f3:1;
>   const unsigned f8:1;
> };
> struct S0 g_111 = {
>   1
> };
> 
> struct S0 g_139 = {
>   1
> };
> 
> unsigned long int g_22;
> 
> void safe (int);
> int func_42 (void);
> 
> void func (void)
> {
>   safe (foo (func_42 () != (g_139.f3 | g_111.f8), -1L));
>   for (g_22 = 0; g_22; g_22 = 1)
>     {
>     }
> }

This is caused by revision 164431:

http://gcc.gnu.org/ml/gcc-cvs/2010-09/msg00727.html


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

* [Bug rtl-optimization/46755] ICE: in calc_dfs_tree, at dominance.c:395 with -O
  2010-12-01 22:46 [Bug rtl-optimization/46755] New: ICE: in calc_dfs_tree, at dominance.c:395 with -O zsojka at seznam dot cz
                   ` (8 preceding siblings ...)
  2011-01-02 23:13 ` hjl.tools at gmail dot com
@ 2011-01-03 10:19 ` jakub at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-01-03 10:19 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-03 10:19:08 UTC ---
The #c6 issue has been fixed by
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=168167
For #c8 issue a new PR, PR47157, has been created.


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

end of thread, other threads:[~2011-01-03 10:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-01 22:46 [Bug rtl-optimization/46755] New: ICE: in calc_dfs_tree, at dominance.c:395 with -O zsojka at seznam dot cz
2010-12-01 23:02 ` [Bug rtl-optimization/46755] " zsojka at seznam dot cz
2010-12-01 23:09 ` steven at gcc dot gnu.org
2010-12-03  8:25 ` zsojka at seznam dot cz
2010-12-17 20:40 ` steven at gcc dot gnu.org
2010-12-21 14:55 ` steven at gcc dot gnu.org
2010-12-21 20:17 ` jakub at gcc dot gnu.org
2010-12-21 20:55 ` steven at gcc dot gnu.org
2011-01-02 20:48 ` regehr at cs dot utah.edu
2011-01-02 23:13 ` hjl.tools at gmail dot com
2011-01-03 10:19 ` jakub 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).