public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56762] New: too aggressive optimization or missing warnings
@ 2013-03-28 10:37 npl at chello dot at
  2013-03-28 12:15 ` [Bug c++/56762] " daniel.kruegler at googlemail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: npl at chello dot at @ 2013-03-28 10:37 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56762
           Summary: too aggressive optimization or missing warnings
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: npl@chello.at


Created attachment 29743
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29743
code describing the issue

Alternatively this could be just me misunderstanding C++.
But the issue is that I have an object created on the stack and I would expect
it to survive until it goes out of scope.
Now I understand that I probably used it the wrong way by giving it a temporary
when it needed a reference to something more solid, but I would expect an error
message in this case.

Please look at the provided code, which compiles without error/warning. the
exchange function wont have any calls to lock/unlock.

tested with gcc 4.7.2 + 4.8.0


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

* [Bug c++/56762] too aggressive optimization or missing warnings
  2013-03-28 10:37 [Bug c++/56762] New: too aggressive optimization or missing warnings npl at chello dot at
@ 2013-03-28 12:15 ` daniel.kruegler at googlemail dot com
  2013-03-28 13:38 ` npl at chello dot at
  2013-03-28 15:14 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-03-28 12:15 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2013-03-28 12:15:30 UTC ---
This line does not what you expect it would do (Search for "most vexing
parse"):

CLockGuard<CIntLock> sGuard(CIntLock());

It does *not* construct an CIntLock object nor does it declare an sGuard
object, instead it does declare a function and has no further effects.
>From gcc-bugs-return-418652-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Mar 28 12:34:32 2013
Return-Path: <gcc-bugs-return-418652-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 12866 invoked by alias); 28 Mar 2013 12:34:31 -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 12797 invoked by uid 48); 28 Mar 2013 12:34:25 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/56756] [4.9 Regression] ICE: verify_ssa failed (definition in block n follows the use !)
Date: Thu, 28 Mar 2013 12: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-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Changed-Fields:
Message-ID: <bug-56756-4-P98PHvuKmY@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-56756-4@http.gcc.gnu.org/bugzilla/>
References: <bug-56756-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
MIME-Version: 1.0
X-SW-Source: 2013-03/txt/msg02093.txt.bz2
Content-length: 873


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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-28 12:34:24 UTC ---
Ok, so one reason is that we simply "ignore" dependencies when computing
what stmts to move (which happens in the same processing order):

static bool
add_dependency (tree def, struct lim_aux_data *data, struct loop *loop,
                bool add_cost)
{
...
  max_loop = outermost_invariant_loop (def, loop);
  if (!max_loop)
    return false;
...
  def_data = get_lim_data (def_stmt);
  if (!def_data)
    return true;

so, when we don't know anything about the stmt we depend on because we
didn't visit it yet outermost_invariant_loop returns garbage in this case.

But I got side-tracked by the above (which still should be fixed IMHO),
as also store-motion does not properly initialize dependence.


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

* [Bug c++/56762] too aggressive optimization or missing warnings
  2013-03-28 10:37 [Bug c++/56762] New: too aggressive optimization or missing warnings npl at chello dot at
  2013-03-28 12:15 ` [Bug c++/56762] " daniel.kruegler at googlemail dot com
@ 2013-03-28 13:38 ` npl at chello dot at
  2013-03-28 15:14 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: npl at chello dot at @ 2013-03-28 13:38 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from npl at chello dot at 2013-03-28 13:38:01 UTC ---
Oh how I hate this rule. Thanks for the info and sorry for the invalid report.


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

* [Bug c++/56762] too aggressive optimization or missing warnings
  2013-03-28 10:37 [Bug c++/56762] New: too aggressive optimization or missing warnings npl at chello dot at
  2013-03-28 12:15 ` [Bug c++/56762] " daniel.kruegler at googlemail dot com
  2013-03-28 13:38 ` npl at chello dot at
@ 2013-03-28 15:14 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2013-03-28 15:14 UTC (permalink / raw)
  To: gcc-bugs


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-03-28 15:14:11 UTC ---
We should give a warning, see PR 15672

*** This bug has been marked as a duplicate of bug 15672 ***


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

end of thread, other threads:[~2013-03-28 15:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-28 10:37 [Bug c++/56762] New: too aggressive optimization or missing warnings npl at chello dot at
2013-03-28 12:15 ` [Bug c++/56762] " daniel.kruegler at googlemail dot com
2013-03-28 13:38 ` npl at chello dot at
2013-03-28 15:14 ` redi 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).