Bug 60198 - ICE with _Cilk_spawn in expression within template function
ICE with _Cilk_spawn in expression within template function
Status: NEW
Product: gcc
Classification: Unclassified
Component: c++
4.9.0
: P3 normal
: ---
Assigned To: Not yet assigned to anyone
: ice-on-valid-code
: 61286 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-14 15:35 UTC by Volker Reichelt
Modified: 2015-02-10 06:37 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.9.0
Last reconfirmed: 2015-02-10 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2014-02-14 15:35:20 UTC
The following valid(?) code snippet (compiled with "-fcilkplus") triggers
an ICE on trunk:

===========================================
template<typename T> int foo()
{
  int i = (_Cilk_spawn foo<T>()) + 0;
  return i;
}

template int foo<int>();
===========================================

bug.cc: In instantiation of 'int foo() [with T = int]':
bug.cc:7:23:   required from here
bug.cc:3:31: internal compiler error: in tsubst_copy, at cp/pt.c:12887
   int i = (_Cilk_spawn foo<T>()) + 0;
                               ^
0x62a933 tsubst_copy
        ../../gcc/gcc/cp/pt.c:12887
0x607956 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
        ../../gcc/gcc/cp/pt.c:15110
0x608fda tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
        ../../gcc/gcc/cp/pt.c:14188
0x6115c6 tsubst_expr
        ../../gcc/gcc/cp/pt.c:13812
0x61435d tsubst_expr
        ../../gcc/gcc/cp/pt.c:13327
0x611093 tsubst_expr
        ../../gcc/gcc/cp/pt.c:13219
0x61208c tsubst_expr
        ../../gcc/gcc/cp/pt.c:13424
0x60f2a9 instantiate_decl(tree_node*, int, bool)
        ../../gcc/gcc/cp/pt.c:19690
0x64d8c7 instantiate_pending_templates(int)
        ../../gcc/gcc/cp/pt.c:19806
0x688bed cp_write_global_declarations()
        ../../gcc/gcc/cp/decl2.c:4148
Please submit a full bug report, [etc.]
Comment 1 Volker Reichelt 2014-02-14 15:36:33 UTC
Balaji, this is your domain, would you mind having a look?
Comment 2 Sylwester Arabas 2014-02-18 10:14:45 UTC
Hi,

I've just got the same error with current Debian's gcc-snapshot (20140212) when trying to compile a code that uses the Blitz++ library, and after replacing all "#pragma ivdep" with "#pragma GCC ivdep" in that library...

    /usr/include/blitz/globeval.cc:466:12: internal compiler error: in tsubst_copy, at cp/pt.c:12887
           for (; i < uneven_start; ++i)
                ^
    Please submit a full bug report,
    with preprocessed source if appropriate.

I can provide more details if needed.

HTH,
Sylwester
Comment 3 Balaji V. Iyer 2014-02-18 14:20:09 UTC
(In reply to Sylwester Arabas from comment #2)
> Hi,
> 
> I've just got the same error with current Debian's gcc-snapshot (20140212)
> when trying to compile a code that uses the Blitz++ library, and after
> replacing all "#pragma ivdep" with "#pragma GCC ivdep" in that library...
> 
>     /usr/include/blitz/globeval.cc:466:12: internal compiler error: in
> tsubst_copy, at cp/pt.c:12887
>            for (; i < uneven_start; ++i)
>                 ^
>     Please submit a full bug report,
>     with preprocessed source if appropriate.
> 
> I can provide more details if needed.

Hi Sylwester,
    The issue with #pragma ivdep is not relevant for this bug. Can you please open another bug report for that and discuss it there?

Thanks,

Balaji V. Iyer.


> 
> HTH,
> Sylwester
Comment 4 Sylwester Arabas 2014-02-18 23:00:31 UTC
Here it is:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60267

HTH,
Sylwester
Comment 5 Andrew Pinski 2015-02-10 06:22:22 UTC
Confirmed.
Comment 6 Andrew Pinski 2015-02-10 06:37:58 UTC
*** Bug 61286 has been marked as a duplicate of this bug. ***