public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60314] New: [4.9][C++1y] ICE with decltype(auto) when generating debug information
@ 2014-02-22  3:20 lucdanton at free dot fr
  2014-02-22 10:25 ` [Bug c++/60314] [C++1y] " paolo.carlini at oracle dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: lucdanton at free dot fr @ 2014-02-22  3:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60314
           Summary: [4.9][C++1y] ICE with decltype(auto) when generating
                    debug information
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lucdanton at free dot fr

Using trunk (g++-trunk (GCC) 4.9.0 20140222 (experimental)):

$ cat main.cpp 
// fine
// decltype(auto) qux() { return 42; }

struct foo {
    // also ICEs if not static
    static decltype(auto) bar()
    { return 42; }
};

int main()
{
}

$ g++-trunk -std=c++1y main.cpp # Succeeds
$ g++-trunk -std=c++1y main.cpp -g
main.cpp:4:8: internal compiler error: in gen_type_die_with_usage, at
dwarf2out.c:19864
 struct foo {
        ^
0x8dcdf9 gen_type_die_with_usage
    ../../gcc/gcc/dwarf2out.c:19864
0x8d9945 gen_decl_die
    ../../gcc/gcc/dwarf2out.c:20361
0x8db9f4 gen_member_die
    ../../gcc/gcc/dwarf2out.c:19414
0x8db9f4 gen_struct_or_union_type_die
    ../../gcc/gcc/dwarf2out.c:19486
0x8db9f4 gen_tagged_type_die
    ../../gcc/gcc/dwarf2out.c:19676
0x8dcd6d gen_type_die_with_usage
    ../../gcc/gcc/dwarf2out.c:19823
0x8d9ba2 gen_decl_die
    ../../gcc/gcc/dwarf2out.c:20400
0xae80b2 rest_of_type_compilation(tree_node*, int)
    ../../gcc/gcc/passes.c:283
0x653f70 finish_struct_1(tree_node*)
    ../../gcc/gcc/cp/class.c:6636
0x65548c finish_struct(tree_node*, tree_node*)
    ../../gcc/gcc/cp/class.c:6801
0x6880a1 cp_parser_class_specifier_1
    ../../gcc/gcc/cp/parser.c:19249
0x6880a1 cp_parser_class_specifier
    ../../gcc/gcc/cp/parser.c:19468
0x6880a1 cp_parser_type_specifier
    ../../gcc/gcc/cp/parser.c:14305
0x6a112d cp_parser_decl_specifier_seq
    ../../gcc/gcc/cp/parser.c:11547
0x6a7ab9 cp_parser_simple_declaration
    ../../gcc/gcc/cp/parser.c:11137
0x68b570 cp_parser_block_declaration
    ../../gcc/gcc/cp/parser.c:11086
0x6b4abb cp_parser_declaration
    ../../gcc/gcc/cp/parser.c:10983
0x6b373d cp_parser_declaration_seq_opt
    ../../gcc/gcc/cp/parser.c:10869
0x6b4f9a cp_parser_translation_unit
    ../../gcc/gcc/cp/parser.c:4014
0x6b4f9a c_parse_file()
    ../../gcc/gcc/cp/parser.c:31568
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
>From gcc-bugs-return-444588-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Feb 22 04:14:10 2014
Return-Path: <gcc-bugs-return-444588-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 20988 invoked by alias); 22 Feb 2014 04:14:10 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 20928 invoked by uid 48); 22 Feb 2014 04:14:05 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/50677] volatile forces load into register
Date: Sat, 22 Feb 2014 04:14:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 4.7.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pinskia at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-50677-4-mtwCQDAJxa@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-50677-4@http.gcc.gnu.org/bugzilla/>
References: <bug-50677-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-02/txt/msg02345.txt.bz2
Content-length: 443

http://gcc.gnu.org/bugzilla/show_bug.cgi?idP677

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl.tools at gmail dot com

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 60313 has been marked as a duplicate of this bug. ***


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

* [Bug c++/60314] [C++1y] ICE with decltype(auto) when generating debug information
  2014-02-22  3:20 [Bug c++/60314] New: [4.9][C++1y] ICE with decltype(auto) when generating debug information lucdanton at free dot fr
@ 2014-02-22 10:25 ` paolo.carlini at oracle dot com
  2014-02-22 13:58 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-02-22 10:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-02-22
            Summary|[4.9][C++1y] ICE with       |[C++1y] ICE with
                   |decltype(auto) when         |decltype(auto) when
                   |generating debug            |generating debug
                   |information                 |information
     Ever confirmed|0                           |1


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

* [Bug c++/60314] [C++1y] ICE with decltype(auto) when generating debug information
  2014-02-22  3:20 [Bug c++/60314] New: [4.9][C++1y] ICE with decltype(auto) when generating debug information lucdanton at free dot fr
  2014-02-22 10:25 ` [Bug c++/60314] [C++1y] " paolo.carlini at oracle dot com
@ 2014-02-22 13:58 ` rguenth at gcc dot gnu.org
  2014-02-22 20:04 ` daniel.kruegler at googlemail dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-02-22 13:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Huh, this is valid C++? ...


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

* [Bug c++/60314] [C++1y] ICE with decltype(auto) when generating debug information
  2014-02-22  3:20 [Bug c++/60314] New: [4.9][C++1y] ICE with decltype(auto) when generating debug information lucdanton at free dot fr
  2014-02-22 10:25 ` [Bug c++/60314] [C++1y] " paolo.carlini at oracle dot com
  2014-02-22 13:58 ` rguenth at gcc dot gnu.org
@ 2014-02-22 20:04 ` daniel.kruegler at googlemail dot com
  2014-02-25  9:38 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2014-02-22 20:04 UTC (permalink / raw)
  To: gcc-bugs

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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
Yes, it's valid C++14 as of the current draft.
>From gcc-bugs-return-444638-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Feb 22 20:09:25 2014
Return-Path: <gcc-bugs-return-444638-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 13137 invoked by alias); 22 Feb 2014 20:09:24 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 13108 invoked by uid 48); 22 Feb 2014 20:09:20 -0000
From: "glisse at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/60320] New: Redundant static initialization check
Date: Sat, 22 Feb 2014 20:09:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: glisse at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-60320-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-02/txt/msg02395.txt.bz2
Content-length: 1913

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`320

            Bug ID: 60320
           Summary: Redundant static initialization check
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glisse at gcc dot gnu.org

Hello,

I think it would be nice if g++ realized that static variables that have been
initialized don't later on become uninitialized again. A simple example:

extern int e;
static int b(){
  static const int a = e;
  return a;
}
int g(){
  return b()-b();
}

gets "optimized" to:

<bb 2>:
  _7 = MEM[(char *)&_ZGVZL1bvE1a];
  if (_7 == 0)
    goto <bb 3>;
  else
    goto <bb 9>;

  <bb 3>:
  _8 = __cxa_guard_acquire (&_ZGVZL1bvE1a);
  if (_8 != 0)
    goto <bb 5>;
  else
    goto <bb 4>;

  <bb 4>:
  pretmp_26 = a;
  goto <bb 6>;

  <bb 5>:
  e.2_9 = e;
  a = e.2_9;
  __cxa_guard_release (&_ZGVZL1bvE1a);

  <bb 6>:
  # prephitmp_27 = PHI <e.2_9(5), pretmp_26(4)>
  _11 = MEM[(char *)&_ZGVZL1bvE1a];
  if (_11 == 0)
    goto <bb 7>;
  else
    goto <bb 9>;

  <bb 7>:
  _12 = __cxa_guard_acquire (&_ZGVZL1bvE1a);
  if (_12 != 0)
    goto <bb 8>;
  else
    goto <bb 9>;

  <bb 8>:
  e.2_13 = e;
  a = e.2_13;
  __cxa_guard_release (&_ZGVZL1bvE1a);
  pretmp_5 = prephitmp_27 - e.2_13;

  <bb 9>:
  # prephitmp_3 = PHI <0(6), _12(7), pretmp_5(8), 0(2)>
  return prephitmp_3;


There may be a dup but I couldn't find it. It doesn't seem that easy to teach
gcc about it. Maybe LTO-inlining of __cxa_guard_* functions would help (or
not). We could emit _ZGVZL1bvE1a=1 after the release call, but that seems ugly.
We could have special code that, for a MEM_REF[&var42], looks for a dominating
call to __cxa_guard_release(&var42), and in that case asserts it is non-zero
(is that, or a slight variant, valid?).


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

* [Bug c++/60314] [C++1y] ICE with decltype(auto) when generating debug information
  2014-02-22  3:20 [Bug c++/60314] New: [4.9][C++1y] ICE with decltype(auto) when generating debug information lucdanton at free dot fr
                   ` (2 preceding siblings ...)
  2014-02-22 20:04 ` daniel.kruegler at googlemail dot com
@ 2014-02-25  9:38 ` paolo.carlini at oracle dot com
  2014-02-28 16:51 ` paolo at gcc dot gnu.org
  2014-02-28 16:53 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-02-25  9:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |paolo.carlini at oracle dot com
   Target Milestone|---                         |4.9.0

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Mine.


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

* [Bug c++/60314] [C++1y] ICE with decltype(auto) when generating debug information
  2014-02-22  3:20 [Bug c++/60314] New: [4.9][C++1y] ICE with decltype(auto) when generating debug information lucdanton at free dot fr
                   ` (3 preceding siblings ...)
  2014-02-25  9:38 ` paolo.carlini at oracle dot com
@ 2014-02-28 16:51 ` paolo at gcc dot gnu.org
  2014-02-28 16:53 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 7+ messages in thread
From: paolo at gcc dot gnu.org @ 2014-02-28 16:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Fri Feb 28 16:51:21 2014
New Revision: 208225

URL: http://gcc.gnu.org/viewcvs?rev=208225&root=gcc&view=rev
Log:
2014-02-25  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/60314
    * dwarf2out.c (is_cxx_auto): Handle decltype(auto).

/testsuite
2014-02-25  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/60314
    * g++.dg/cpp1y/auto-fn24.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/cpp1y/auto-fn24.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dwarf2out.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/60314] [C++1y] ICE with decltype(auto) when generating debug information
  2014-02-22  3:20 [Bug c++/60314] New: [4.9][C++1y] ICE with decltype(auto) when generating debug information lucdanton at free dot fr
                   ` (4 preceding siblings ...)
  2014-02-28 16:51 ` paolo at gcc dot gnu.org
@ 2014-02-28 16:53 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-02-28 16:53 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
           Assignee|paolo.carlini at oracle dot com    |unassigned at gcc dot gnu.org

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Sorry, this is the actual CL entry:

2014-02-28  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/60314
    * dwarf2out.c (decltype_auto_die): New static.
    (gen_subprogram_die): Handle 'decltype(auto)' like 'auto'.
    (gen_type_die_with_usage): Handle 'decltype(auto)'.
    (is_cxx_auto): Likewise.

Fixed for 4.9.0 anyway.


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

end of thread, other threads:[~2014-02-28 16:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-22  3:20 [Bug c++/60314] New: [4.9][C++1y] ICE with decltype(auto) when generating debug information lucdanton at free dot fr
2014-02-22 10:25 ` [Bug c++/60314] [C++1y] " paolo.carlini at oracle dot com
2014-02-22 13:58 ` rguenth at gcc dot gnu.org
2014-02-22 20:04 ` daniel.kruegler at googlemail dot com
2014-02-25  9:38 ` paolo.carlini at oracle dot com
2014-02-28 16:51 ` paolo at gcc dot gnu.org
2014-02-28 16:53 ` paolo.carlini at oracle dot com

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).