public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60331] New: ICE with OpenMP #pragma omp declare reduction in template class
@ 2014-02-24 20:05 reichelt at gcc dot gnu.org
  2014-03-17 15:31 ` [Bug c++/60331] " paolo.carlini at oracle dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: reichelt at gcc dot gnu.org @ 2014-02-24 20:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60331
           Summary: ICE with OpenMP #pragma omp declare reduction in
                    template class
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, openmp
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org

The following valid(?) code snippet (compiled with "-std=c++11 -fopenmp")
triggers an ICE on trunk:

===============================================================================
template<typename> struct A
{
  #pragma omp declare reduction (x : int : omp_out += omp_in) initializer
(omp_priv = omp_priv)
};
===============================================================================

bug.cc: In static member function 'static void A< <template-parameter-1-1>
>::omp declare reduction x~i(int&)':
bug.cc:3:87: sorry, unimplemented: unexpected AST of kind decl_expr
   #pragma omp declare reduction (x : int : omp_out += omp_in) initializer
(omp_priv = omp_priv)
                                                                               
       ^
bug.cc:3:87: internal compiler error: in potential_constant_expression_1, at
cp/semantics.c:10553
0x746309 potential_constant_expression_1
        ../../gcc/gcc/cp/semantics.c:10553
0x6105a8 fold_non_dependent_expr_sfinae(tree_node*, int)
        ../../gcc/gcc/cp/pt.c:5111
0x610619 build_non_dependent_expr(tree_node*)
        ../../gcc/gcc/cp/pt.c:21306
0x72b0e0 finish_expr_stmt(tree_node*)
        ../../gcc/gcc/cp/semantics.c:688
0x6d2629 cp_parser_omp_declare_reduction_exprs
        ../../gcc/gcc/cp/parser.c:30638
0x6d404a cp_parser_late_parsing_for_member
        ../../gcc/gcc/cp/parser.c:23503
0x6ae0bc cp_parser_class_specifier_1
        ../../gcc/gcc/cp/parser.c:19451
0x6ae0bc cp_parser_class_specifier
        ../../gcc/gcc/cp/parser.c:19482
0x6ae0bc cp_parser_type_specifier
        ../../gcc/gcc/cp/parser.c:14305
0x6c6ec0 cp_parser_decl_specifier_seq
        ../../gcc/gcc/cp/parser.c:11547
0x6ccb63 cp_parser_single_declaration
        ../../gcc/gcc/cp/parser.c:23082
0x6cd044 cp_parser_template_declaration_after_export
        ../../gcc/gcc/cp/parser.c:22958
0x6d83e9 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:10947
0x6d6ed8 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:10869
0x6d877a cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4014
0x6d877a c_parse_file()
        ../../gcc/gcc/cp/parser.c:31582
0x7f79f3 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1060
Please submit a full bug report, [etc.]

Without "-std=c++11" or without the template, the code compiles fine.


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

* [Bug c++/60331] ICE with OpenMP #pragma omp declare reduction in template class
  2014-02-24 20:05 [Bug c++/60331] New: ICE with OpenMP #pragma omp declare reduction in template class reichelt at gcc dot gnu.org
@ 2014-03-17 15:31 ` paolo.carlini at oracle dot com
  2014-03-25  9:30 ` jakub at gcc dot gnu.org
  2014-03-25  9:47 ` jakub at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-03-17 15:31 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-03-17
                 CC|                            |jakub at gcc dot gnu.org
     Ever confirmed|0                           |1


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

* [Bug c++/60331] ICE with OpenMP #pragma omp declare reduction in template class
  2014-02-24 20:05 [Bug c++/60331] New: ICE with OpenMP #pragma omp declare reduction in template class reichelt at gcc dot gnu.org
  2014-03-17 15:31 ` [Bug c++/60331] " paolo.carlini at oracle dot com
@ 2014-03-25  9:30 ` jakub at gcc dot gnu.org
  2014-03-25  9:47 ` jakub at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-03-25  9:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Tue Mar 25 09:30:10 2014
New Revision: 208806

URL: http://gcc.gnu.org/viewcvs?rev=208806&root=gcc&view=rev
Log:
    PR c++/60331
    * semantics.c (potential_constant_expression_1): Handle
    DECL_EXPR.

    * testsuite/libgomp.c++/udr-11.C: New test.
    * testsuite/libgomp.c++/udr-12.C: New test.
    * testsuite/libgomp.c++/udr-13.C: New test.
    * testsuite/libgomp.c++/udr-14.C: New test.
    * testsuite/libgomp.c++/udr-15.C: New test.
    * testsuite/libgomp.c++/udr-16.C: New test.
    * testsuite/libgomp.c++/udr-17.C: New test.
    * testsuite/libgomp.c++/udr-18.C: New test.
    * testsuite/libgomp.c++/udr-19.C: New test.

Added:
    trunk/libgomp/testsuite/libgomp.c++/udr-11.C
    trunk/libgomp/testsuite/libgomp.c++/udr-12.C
    trunk/libgomp/testsuite/libgomp.c++/udr-13.C
    trunk/libgomp/testsuite/libgomp.c++/udr-14.C
    trunk/libgomp/testsuite/libgomp.c++/udr-15.C
    trunk/libgomp/testsuite/libgomp.c++/udr-16.C
    trunk/libgomp/testsuite/libgomp.c++/udr-17.C
    trunk/libgomp/testsuite/libgomp.c++/udr-18.C
    trunk/libgomp/testsuite/libgomp.c++/udr-19.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c
    trunk/libgomp/ChangeLog


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

* [Bug c++/60331] ICE with OpenMP #pragma omp declare reduction in template class
  2014-02-24 20:05 [Bug c++/60331] New: ICE with OpenMP #pragma omp declare reduction in template class reichelt at gcc dot gnu.org
  2014-03-17 15:31 ` [Bug c++/60331] " paolo.carlini at oracle dot com
  2014-03-25  9:30 ` jakub at gcc dot gnu.org
@ 2014-03-25  9:47 ` jakub at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-03-25  9:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.9.0

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Should be fixed now.


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

end of thread, other threads:[~2014-03-25  9:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-24 20:05 [Bug c++/60331] New: ICE with OpenMP #pragma omp declare reduction in template class reichelt at gcc dot gnu.org
2014-03-17 15:31 ` [Bug c++/60331] " paolo.carlini at oracle dot com
2014-03-25  9:30 ` jakub at gcc dot gnu.org
2014-03-25  9:47 ` 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).