public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65075] New: [5 Regression] constexpr regression
@ 2015-02-16  0:34 jakub at gcc dot gnu.org
  2015-02-16  0:35 ` [Bug c++/65075] " jakub at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-02-16  0:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65075

            Bug ID: 65075
           Summary: [5 Regression] constexpr regression
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org

typedef void (*E) ();
template <class T>
constexpr E
bar ()
{
  return []() {};
}
void
foo ()
{
  (bar<int> ()) ();
}

is rejected since r215954 aka PR55250 with -std=c++11:
error: body of constexpr function ‘constexpr void (* bar())() [with T = int; E
= void (*)()]’ not a return-statement
The body is a return statement, just perhaps with some extra artificial
statements created for the lambda.
>From gcc-bugs-return-477349-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Feb 16 00:34:42 2015
Return-Path: <gcc-bugs-return-477349-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 16311 invoked by alias); 16 Feb 2015 00:34:41 -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 16266 invoked by uid 48); 16 Feb 2015 00:34:37 -0000
From: "glisse at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/64992] More optimize opportunity
Date: Mon, 16 Feb 2015 00:34:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: glisse 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: bug_status
Message-ID: <bug-64992-4-WvBpr2IFi9@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-64992-4@http.gcc.gnu.org/bugzilla/>
References: <bug-64992-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: 2015-02/txt/msg01682.txt.bz2
Content-length: 714

https://gcc.gnu.org/bugzilla/show_bug.cgi?idd992

Marc Glisse <glisse at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW

--- Comment #5 from Marc Glisse <glisse at gcc dot gnu.org> ---
We do not sink the code that computes d into the branch c==-1. If we did, the
second comparison would simplify to a constant. VRP is not clever enough to
"backport" new assertions to already computed values.

We could also simplify N*x==0 to x==0 even for unsigned when VRP information
tells us that overflow/wrap cannot happen (here N is 2 and x is in [0,1]).


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

end of thread, other threads:[~2015-02-17  8:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-16  0:34 [Bug c++/65075] New: [5 Regression] constexpr regression jakub at gcc dot gnu.org
2015-02-16  0:35 ` [Bug c++/65075] " jakub at gcc dot gnu.org
2015-02-16 10:18 ` rguenth at gcc dot gnu.org
2015-02-16 13:56 ` paolo.carlini at oracle dot com
2015-02-16 13:59 ` jakub at gcc dot gnu.org
2015-02-17  8:26 ` jakub at gcc dot gnu.org
2015-02-17  8:33 ` 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).