public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58874] New: [4.9 Regression] [c++11] ICE with OpenMP reduction declaration and -std=c++11
@ 2013-10-25 10:03 reichelt at gcc dot gnu.org
  2013-10-25 10:04 ` [Bug c++/58874] " reichelt at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-10-25 10:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58874
           Summary: [4.9 Regression] [c++11] ICE with OpenMP reduction
                    declaration and -std=c++11
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          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 triggers an ICE on trunk if compiled with
"-fopenmp -std=c++11"):

==========================================================================
struct A
{
  template<int> struct B
  {
    #pragma omp declare reduction (x : int : omp_out |= omp_in)
  };
};

#pragma omp declare reduction (x : int : omp_out |= omp_in) initializer
(omp_priv = 0)
==========================================================================

bug.cc: In function 'void omp declare reduction x~i(int&)':
bug.cc:13:85: sorry, unimplemented: unexpected AST of kind decl_expr
 #pragma omp declare reduction (x : int : omp_out |= omp_in) initializer
(omp_priv = 0)
                                                                               
     ^
bug.cc:13:85: internal compiler error: in potential_constant_expression_1, at
cp/semantics.c:10426
0x6df5dc potential_constant_expression_1
        ../../gcc/gcc/cp/semantics.c:10426
0x5a9c14 fold_non_dependent_expr_sfinae(tree_node*, int)
        ../../gcc/gcc/cp/pt.c:5087
0x5a9c89 build_non_dependent_expr(tree_node*)
        ../../gcc/gcc/cp/pt.c:21210
0x6c3a10 finish_expr_stmt(tree_node*)
        ../../gcc/gcc/cp/semantics.c:628
0x66a8b4 cp_parser_omp_declare_reduction_exprs
        ../../gcc/gcc/cp/parser.c:30078
0x643b1a cp_parser_omp_declare_reduction
        ../../gcc/gcc/cp/parser.c:30291
0x64551b cp_parser_omp_declare
        ../../gcc/gcc/cp/parser.c:30355
0x64551b cp_parser_pragma
        ../../gcc/gcc/cp/parser.c:30890
0x66f661 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:10725
0x670f36 cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:3990
0x670f36 c_parse_file()
        ../../gcc/gcc/cp/parser.c:30999
0x78e183 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1046
Please submit a full bug report, [etc.]

The code compiles fine without "-std=c++11".
The regression was introduced between 4.9.0 20131005 and 4.9.0 20131012.


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

* [Bug c++/58874] [4.9 Regression] [c++11] ICE with OpenMP reduction declaration and -std=c++11
  2013-10-25 10:03 [Bug c++/58874] New: [4.9 Regression] [c++11] ICE with OpenMP reduction declaration and -std=c++11 reichelt at gcc dot gnu.org
@ 2013-10-25 10:04 ` reichelt at gcc dot gnu.org
  2013-10-25 10:21 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-10-25 10:04 UTC (permalink / raw)
  To: gcc-bugs

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

Volker Reichelt <reichelt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
      Known to work|                            |4.3.0, 4.4.0, 4.5.0, 4.6.0,
                   |                            |4.7.0, 4.8.0
   Target Milestone|---                         |4.9.0
      Known to fail|                            |4.9.0


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

* [Bug c++/58874] [4.9 Regression] [c++11] ICE with OpenMP reduction declaration and -std=c++11
  2013-10-25 10:03 [Bug c++/58874] New: [4.9 Regression] [c++11] ICE with OpenMP reduction declaration and -std=c++11 reichelt at gcc dot gnu.org
  2013-10-25 10:04 ` [Bug c++/58874] " reichelt at gcc dot gnu.org
@ 2013-10-25 10:21 ` mpolacek at gcc dot gnu.org
  2013-11-26 16:23 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-10-25 10:21 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-10-25
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.


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

* [Bug c++/58874] [4.9 Regression] [c++11] ICE with OpenMP reduction declaration and -std=c++11
  2013-10-25 10:03 [Bug c++/58874] New: [4.9 Regression] [c++11] ICE with OpenMP reduction declaration and -std=c++11 reichelt at gcc dot gnu.org
  2013-10-25 10:04 ` [Bug c++/58874] " reichelt at gcc dot gnu.org
  2013-10-25 10:21 ` mpolacek at gcc dot gnu.org
@ 2013-11-26 16:23 ` jakub at gcc dot gnu.org
  2013-11-26 20:40 ` jakub at gcc dot gnu.org
  2013-11-26 20:57 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-11-26 16:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 31300
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31300&action=edit
gcc49-pr58874.patch

Untested fix.


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

* [Bug c++/58874] [4.9 Regression] [c++11] ICE with OpenMP reduction declaration and -std=c++11
  2013-10-25 10:03 [Bug c++/58874] New: [4.9 Regression] [c++11] ICE with OpenMP reduction declaration and -std=c++11 reichelt at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-11-26 16:23 ` jakub at gcc dot gnu.org
@ 2013-11-26 20:40 ` jakub at gcc dot gnu.org
  2013-11-26 20:57 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-11-26 20:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Tue Nov 26 20:39:56 2013
New Revision: 205412

URL: http://gcc.gnu.org/viewcvs?rev=205412&root=gcc&view=rev
Log:
    PR c++/58874
    * parser.c (cp_parser_late_parsing_for_member): For OpenMP UDRs
    pass 2 instead of 0 to finish_function.

    * g++.dg/gomp/pr58874.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/gomp/pr58874.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/58874] [4.9 Regression] [c++11] ICE with OpenMP reduction declaration and -std=c++11
  2013-10-25 10:03 [Bug c++/58874] New: [4.9 Regression] [c++11] ICE with OpenMP reduction declaration and -std=c++11 reichelt at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2013-11-26 20:40 ` jakub at gcc dot gnu.org
@ 2013-11-26 20:57 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-11-26 20:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2013-11-26 20:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-25 10:03 [Bug c++/58874] New: [4.9 Regression] [c++11] ICE with OpenMP reduction declaration and -std=c++11 reichelt at gcc dot gnu.org
2013-10-25 10:04 ` [Bug c++/58874] " reichelt at gcc dot gnu.org
2013-10-25 10:21 ` mpolacek at gcc dot gnu.org
2013-11-26 16:23 ` jakub at gcc dot gnu.org
2013-11-26 20:40 ` jakub at gcc dot gnu.org
2013-11-26 20:57 ` 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).