public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/59135] Incorrect ambiguity in constexpr function overloads
Date: Wed, 20 Nov 2013 09:11:00 -0000	[thread overview]
Message-ID: <bug-59135-4-fes211EcmZ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-59135-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
The problem seems to exist in gcc 4.7.3 and within the recent 4.9.0 trunk. The
following variant of the code removes unnecessary library dependencies and
constexpr (which is not needed to reproduce the problem):

//----------------------------------
template <typename T>
struct foo
{
};

template <int N, typename T, typename ...Us>
bool bar(T &&, Us &&...)
{
    return false;
}

template <int N, typename T, typename ...Us>
bool bar(foo<T> &&, Us &&...)
{
    return true;
}

int main()
{
    bar<0>(foo<int>(), 1, 2);
}
//----------------------------------
>From gcc-bugs-return-435194-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Nov 20 09:24:04 2013
Return-Path: <gcc-bugs-return-435194-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 7771 invoked by alias); 20 Nov 2013 09:24:04 -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 7718 invoked by uid 48); 20 Nov 2013 09:24:00 -0000
From: "dcb314 at hotmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/59208] New: ice in initialize_flags_in_bb
Date: Wed, 20 Nov 2013 09:24:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: dcb314 at hotmail dot com
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 attachments.created
Message-ID: <bug-59208-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-11/txt/msg01971.txt.bz2
Content-length: 1262

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

            Bug ID: 59208
           Summary: ice in initialize_flags_in_bb
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com

Created attachment 31256
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31256&action=edit
gzipped C++ source code

The source code from bug # 45875, when compiled with today's trunk
of 20131120, says

bug1.cc: In function ‘void add_button(Widget, int&, Dimension&, DebuggerType,
EntryType, string)’:
bug1.cc:48073:13: internal compiler error: in initialize_flags_in_bb, at
tree-into-ssa.c:459
 static void add_button(Widget form, int& row, Dimension& max_width,
             ^
0xcd9db9 initialize_flags_in_bb
    ../../src/trunk/gcc/tree-into-ssa.c:459
0xcd9db9 mark_block_for_update
    ../../src/trunk/gcc/tree-into-ssa.c:473
0xce1f50 mark_use_interesting
    ../../src/trunk/gcc/tree-into-ssa.c:2456
0xce1f50 prepare_block_for_update
    ../../src/trunk/gcc/tree-into-ssa.c:2531

This worked a few days ago, at 20131117, so there is recent breakage.
>From gcc-bugs-return-435195-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Nov 20 09:25:45 2013
Return-Path: <gcc-bugs-return-435195-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 9400 invoked by alias); 20 Nov 2013 09:25:44 -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 9370 invoked by uid 48); 20 Nov 2013 09:25:41 -0000
From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/59144] weird behavior when dealing with too complicated templates and class hierarchy
Date: Wed, 20 Nov 2013 09:25:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: daniel.kruegler at googlemail dot com
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: cc
Message-ID: <bug-59144-4-ELsT5wZRlR@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59144-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59144-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-11/txt/msg01972.txt.bz2
Content-length: 1461

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

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

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

--- Comment #4 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to tmmikolajczyk from comment #3)
> Why that's not a bug? No matter if the X::bar method is virtual or not it
> should not have any impact on access to it from the derived classes in this
> case IMHO.

If bar is not virtual, it will never be instantiated in your example code and
for the non-instantiated code no diagnostics is required. Making it virtual
provokes its instantiation irrespective of any other missing odr-usage. See
14.7.1 p11:

"An implementation shall not implicitly instantiate a function template, a
variable template, a member template, a non-virtual member function, a member
class, or a static data member of a class template that does not require
instantiation. It is unspecified whether or not an implementation implicitly
instantiates a virtual member function of a class template if the virtual
member function would not otherwise be instantiated."

In other words: You example code is not useful to demonstrate what you intend
to demonstrate.
>From gcc-bugs-return-435196-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Nov 20 09:35:50 2013
Return-Path: <gcc-bugs-return-435196-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 18945 invoked by alias); 20 Nov 2013 09:35:49 -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 18879 invoked by uid 48); 20 Nov 2013 09:35:43 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/59208] [4.9 Regression] ice in initialize_flags_in_bb
Date: Wed, 20 Nov 2013 09:35:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mpolacek 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: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc target_milestone short_desc everconfirmed
Message-ID: <bug-59208-4-3xUbvpm8mD@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59208-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59208-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: 2013-11/txt/msg01973.txt.bz2
Content-length: 767

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-11-20
                 CC|                            |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |4.9.0
            Summary|ice in                      |[4.9 Regression] ice in
                   |initialize_flags_in_bb      |initialize_flags_in_bb
     Ever confirmed|0                           |1

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


  reply	other threads:[~2013-11-20  9:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-14 15:47 [Bug c++/59135] New: " vexocide at gmail dot com
2013-11-20  9:11 ` daniel.kruegler at googlemail dot com [this message]
2020-07-10 12:53 ` [Bug c++/59135] " familiebaumanns at gmail dot com
2020-07-10 23:06 ` redi at gcc dot gnu.org
2021-08-28  1:54 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-59135-4-fes211EcmZ@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).