public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/57421] New: Error when linking static libstc++ due to missing future classes
@ 2013-05-26 18:13 juergen.reuter at desy dot de
  2013-05-26 18:14 ` [Bug libstdc++/57421] " juergen.reuter at desy dot de
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: juergen.reuter at desy dot de @ 2013-05-26 18:13 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57421
           Summary: Error when linking static libstc++ due to missing
                    future classes
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: juergen.reuter at desy dot de

This is our libtool command which does the invocation. I hope that you don't
need any parts of the code to track this down:
{{{
libtool: link: gfortran -g -O2 -o whizard.static .libs/libmanager.o 
-L/Users/reuter/local/packages/whizard-2.1.1/src/whizard-core
-L/Users/reuter/local/packages/whizard-2.1.1/src
-L/Users/reuter/local/packages/whizard-2.1.1/src/hepmc -L/usr/local/lib
-L/usr/local/lib/gcc/x86_64-apple-darwin11.4.2/4.9.0
-L/usr/local/lib/gcc/x86_64-apple-darwin11.4.2/4.9.0/../../..
/usr/local/lib/libstdc++.a
-L/usr/local/packages/gcc-4.9.0_trunk/build/x86_64-apple-darwin11.4.2/libstdc++-v3/src
-L/usr/local/packages/gcc-4.9.0_trunk/build/x86_64-apple-darwin11.4.2/libstdc++-v3/src/.libs
./.libs/libstatic.a -L/Users/reuter/local/packages/whizard-2.1.1/src/models
/Users/reuter/local/packages/whizard-2.1.1/src/whizard-core/.libs/libwhizard_main.a
/Users/reuter/local/packages/whizard-2.1.1/src/.libs/libomega.a
/Users/reuter/local/packages/whizard-2.1.1/src/omega/src/.libs/libomega_core.a
/Users/reuter/local/packages/whizard-2.1.1/src/.libs/libwhizard.a
/Users/reuter/local/packages/whizard-2.1.1/src/vamp/src/.libs/libvamp.a
/Users/reuter/local/packages/whizard-2.1.1/src/circe1/src/.libs/libcirce1.a
/Users/reuter/local/packages/whizard-2.1.1/src/circe2/src/.libs/libcirce2.a
/usr/local/lib/libLHAPDF.a /usr/local/lib/libgfortran.a
/usr/local/lib/libquadmath.a -lm -lstdhep -lFmcfio 
Undefined symbols for architecture x86_64:
  "std::error_category::error_category()", referenced from:
      std::future_category()  in libstdc++.a(future.o)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
}}}


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

* [Bug libstdc++/57421] Error when linking static libstc++ due to missing future classes
  2013-05-26 18:13 [Bug libstdc++/57421] New: Error when linking static libstc++ due to missing future classes juergen.reuter at desy dot de
@ 2013-05-26 18:14 ` juergen.reuter at desy dot de
  2013-05-28 10:10 ` redi at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: juergen.reuter at desy dot de @ 2013-05-26 18:14 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 4496 bytes --]

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

--- Comment #1 from Jürgen Reuter <juergen.reuter at desy dot de> ---
I couldn't check up to now but I assume this also happens with 4.8.1.
>From gcc-bugs-return-423169-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun May 26 19:24:38 2013
Return-Path: <gcc-bugs-return-423169-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23866 invoked by alias); 26 May 2013 19:24:38 -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 23818 invoked by uid 48); 26 May 2013 19:24:32 -0000
From: "zsojka at seznam dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/57422] New: [4.9 Regression] ICE: SIGSEGV in dominated_by_p with custom flags
Date: Sun, 26 May 2013 19:24:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: zsojka at seznam dot cz
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-57422-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-05/txt/msg01842.txt.bz2
Content-length: 2439

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

            Bug ID: 57422
           Summary: [4.9 Regression] ICE: SIGSEGV in dominated_by_p with
                    custom flags
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz

Created attachment 30196
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id0196&actioníit
reduced testcase

Compiler output:
$ gcc -O2 -fPIC -fno-omit-frame-pointer -fpeel-loops -fsched-pressure
-fschedule-insns -fselective-scheduling2 --param=max-cse-insns=1 testcase.c
testcase.c: In function 'test6':
testcase.c:20:1: internal compiler error: Segmentation fault
 }
 ^
0xa3896f crash_signal
        /mnt/svn/gcc-trunk/gcc/toplev.c:333
0x704fe6 dominated_by_p(cdi_direction, basic_block_def const*, basic_block_def
const*)
        /mnt/svn/gcc-trunk/gcc/dominance.c:974
0xa01092 remove_insns_that_need_bookkeeping
        /mnt/svn/gcc-trunk/gcc/sel-sched.c:4906
0xa01092 fill_insns
        /mnt/svn/gcc-trunk/gcc/sel-sched.c:5592
0xa01092 schedule_on_fences
        /mnt/svn/gcc-trunk/gcc/sel-sched.c:7410
0xa01092 sel_sched_region_2
        /mnt/svn/gcc-trunk/gcc/sel-sched.c:7544
0xa05725 sel_sched_region_1
        /mnt/svn/gcc-trunk/gcc/sel-sched.c:7583
0xa05725 sel_sched_region(int)
        /mnt/svn/gcc-trunk/gcc/sel-sched.c:7684
0xa06ee9 run_selective_scheduling()
        /mnt/svn/gcc-trunk/gcc/sel-sched.c:7760
0x9d82e5 rest_of_handle_sched2
        /mnt/svn/gcc-trunk/gcc/sched-rgn.c:3606
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.

$ gcc -v
Using built-in specs.
COLLECT_GCC=/mnt/svn/gcc-trunk/binary-latest/bin/gcc
COLLECT_LTO_WRAPPER=/mnt/svn/gcc-trunk/binary-199337-lto-fortran-checking-yes-rtl-df/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /mnt/svn/gcc-trunk//configure --enable-checking=yes,rtl,df
--enable-languages=c,c++,lto,fortran
--prefix=/mnt/svn/gcc-trunk/binary-199337-lto-fortran-checking-yes-rtl-df/
--without-cloog --without-ppl
Thread model: posix
gcc version 4.9.0 20130526 (experimental) (GCC)


Tested revisions:
r199337 - crash
4.8 r198018 - OK


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

* [Bug libstdc++/57421] Error when linking static libstc++ due to missing future classes
  2013-05-26 18:13 [Bug libstdc++/57421] New: Error when linking static libstc++ due to missing future classes juergen.reuter at desy dot de
  2013-05-26 18:14 ` [Bug libstdc++/57421] " juergen.reuter at desy dot de
@ 2013-05-28 10:10 ` redi at gcc dot gnu.org
  2013-05-28 10:59 ` juergen.reuter at desy dot de
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2013-05-28 10:10 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2013-05-28
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jürgen Reuter from comment #0)
> This is our libtool command which does the invocation. I hope that you don't
> need any parts of the code to track this down:

You could have simply provided a minimal testcase:

#include <future>

int main()
{
    std::promise<void> p;
}
>From gcc-bugs-return-423255-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue May 28 10:18:41 2013
Return-Path: <gcc-bugs-return-423255-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23367 invoked by alias); 28 May 2013 10:18: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 23311 invoked by uid 48); 28 May 2013 10:18:36 -0000
From: "ro at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug testsuite/57413] FAIL: gcc.dg/debug/dwarf2/discriminator.c scan-assembler on x86_64-apple-darwin10, Solaris/x86
Date: Tue, 28 May 2013 10:18:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: testsuite
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ro 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: cf_gcctarget bug_status cf_reconfirmed_on cc cf_gcchost target_milestone short_desc everconfirmed cf_gccbuild
Message-ID: <bug-57413-4-SKnFk5fJOY@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57413-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57413-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-05/txt/msg01928.txt.bz2
Content-length: 1383

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

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|x86_64-apple-darwin10       |x86_64-apple-darwin10,
                   |                            |i386-pc-solaris2.*
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-05-28
                 CC|                            |ro at gcc dot gnu.org
               Host|x86_64-apple-darwin10       |x86_64-apple-darwin10,
                   |                            |i386-pc-solaris2.*
   Target Milestone|---                         |4.9.0
            Summary|FAIL:                       |FAIL:
                   |gcc.dg/debug/dwarf2/discrim |gcc.dg/debug/dwarf2/discrim
                   |inator.c scan-assembler on  |inator.c scan-assembler on
                   |x86_64-apple-darwin10       |x86_64-apple-darwin10,
                   |                            |Solaris/x86
     Ever confirmed|0                           |1
              Build|x86_64-apple-darwin10       |x86_64-apple-darwin10,
                   |                            |i386-pc-solaris2.*

--- Comment #1 from Rainer Orth <ro at gcc dot gnu.org> ---
Same failure on Solaris/x86 with Sun as.


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

* [Bug libstdc++/57421] Error when linking static libstc++ due to missing future classes
  2013-05-26 18:13 [Bug libstdc++/57421] New: Error when linking static libstc++ due to missing future classes juergen.reuter at desy dot de
  2013-05-26 18:14 ` [Bug libstdc++/57421] " juergen.reuter at desy dot de
  2013-05-28 10:10 ` redi at gcc dot gnu.org
@ 2013-05-28 10:59 ` juergen.reuter at desy dot de
  2013-05-28 12:15 ` redi at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: juergen.reuter at desy dot de @ 2013-05-28 10:59 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 3010 bytes --]

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

--- Comment #3 from Jürgen Reuter <juergen.reuter at desy dot de> ---
I'll try to cook it down as much as possible.
>From gcc-bugs-return-423261-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue May 28 11:08:15 2013
Return-Path: <gcc-bugs-return-423261-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 14055 invoked by alias); 28 May 2013 11:08:15 -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 13908 invoked by uid 48); 28 May 2013 11:08:06 -0000
From: "amylaar at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/57439] [4.9 regression] FAIL: gcc.c-torture/execute/920501-6.c execution,  -O1
Date: Tue, 28 May 2013 11:08: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.9.0
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: amylaar 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: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.created
Message-ID: <bug-57439-4-1EGE9KrApS@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57439-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57439-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-05/txt/msg01934.txt.bz2
Content-length: 975

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

--- Comment #4 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> ---
Created attachment 30209
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id0209&actioníit
experimental patch

I've used -I to point the compiler to the include directory in the newlib
sources, and from what I see them, the problem is that a narrow register
is generated by using the original REGNO and the new narrow mode - this
misses the big endian correction.

This patch uses gen_lowpart_common, which should just DTRT regardless of
endianness.

A further observation is that previously a conversion to a DImode add of 4 was
tried, and abandoned, presumably due to cost.  A SImode add to the 32 bit
lowpart
would be more profitable, at least if the target supports addq.l .
In general, we should try if a set or constant add with a destination that is
a subreg that constitutes one (or more) full hard register(s) is the cheapest
option.


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

* [Bug libstdc++/57421] Error when linking static libstc++ due to missing future classes
  2013-05-26 18:13 [Bug libstdc++/57421] New: Error when linking static libstc++ due to missing future classes juergen.reuter at desy dot de
                   ` (2 preceding siblings ...)
  2013-05-28 10:59 ` juergen.reuter at desy dot de
@ 2013-05-28 12:15 ` redi at gcc dot gnu.org
  2013-05-28 12:48 ` juergen.reuter at desy dot de
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2013-05-28 12:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I already did, that's the code I posted!

The only switches needed are -std=c++11 -static-libstdc++


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

* [Bug libstdc++/57421] Error when linking static libstc++ due to missing future classes
  2013-05-26 18:13 [Bug libstdc++/57421] New: Error when linking static libstc++ due to missing future classes juergen.reuter at desy dot de
                   ` (3 preceding siblings ...)
  2013-05-28 12:15 ` redi at gcc dot gnu.org
@ 2013-05-28 12:48 ` juergen.reuter at desy dot de
  2013-05-28 12:49 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: juergen.reuter at desy dot de @ 2013-05-28 12:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jürgen Reuter <juergen.reuter at desy dot de> ---
Well, we have Fortran 2003 code into which via Bind(C) some c++ code is linked.
For static builds, on MAC OS X because of the properties of the single-pass
linker we need to explicitly link the C++ static library libstc++. Using this
with the flags you mentioned does not change anything, unfortunately.
>From gcc-bugs-return-423270-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue May 28 12:49:31 2013
Return-Path: <gcc-bugs-return-423270-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 2936 invoked by alias); 28 May 2013 12:49: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 2905 invoked by uid 48); 28 May 2013 12:49:25 -0000
From: "gallardo.d.e at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/57440] New: Memory usage with future and std containers
Date: Tue, 28 May 2013 12:49:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 4.7.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: gallardo.d.e at gmail 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
Message-ID: <bug-57440-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-05/txt/msg01943.txt.bz2
Content-length: 2712

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

            Bug ID: 57440
           Summary: Memory usage with future and std containers
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gallardo.d.e at gmail dot com

Consider the following test code:

#include <vector>
#include <array>
#include <future>
#include <iostream>

using std::vector;
using std::array;
using std::cout;
using std::endl;

typedef unsigned int uint;


double TestFutures()
{
    return 1;
}

void DoWork()
{
    const uint nPointsP;
    const uint nThreads\x100;
    vector<double> results(nThreads,0);

    // For each data point...
    for (uint k=0; k<nPoints; ++k) {
        // ... launch the threads
        vector<std::future<double> > values;
        for (uint w=0; w<nThreads; ++w) {
            values.push_back(std::async(TestFutures));
        }
        // ... and now read the results
        for (uint w=0; w<nThreads; ++w) {
            results[w]+= values[w].get();
        }
    }
}

int main()
{
    const uint nTimesP;

    for (uint k=0; k<nTimes; ++k) {
        cout << "Cycle: " << k << endl;
        DoWork();
    }
}

I compile it with gcc 4.7.2 (MinGW 4.7.2) in Qt 5.0.1, Qt Creator 2.6.2. Then I
run it, either in the debugger, or stand alone, release or debug version. If I
monitor the memory usage, it increases monotonically during the execution of
the loops. By increasing the variable nTimes in the main function, I can make
the program allocate an arbitrary amount of memory (I have tried up to 1Gb). I
monitor the memory usage with task manager or procexp.

If I then take the same code and compile it and run it under MS Visual Studio
Express 2012, the memory usage remains stable during the loop. This, I think,
is what you would expect, as the vector of futures should be destroyed after
each k-iteration.

I reported this in the MinGw bug forum and was redirected here.

Just to let you know, I still have the same issue if I substitute the vector of
futures with an array, i.e. this DoWork() routine:

void DoWork()
{
    const uint nPointsP;
    const uint nThreads\x100;
    vector<double> results(nThreads,0);

    // For each data point...
    for (uint k=0; k<nPoints; ++k) {
        // ... launch the threads
        array<std::future<double>,nThreads> values;
        for (uint w=0; w<nThreads; ++w) {
            values[w]=std::async(TestFutures);
        }
        // ... and now read the results
        for (uint w=0; w<nThreads; ++w) {
            results[w]+= values[w].get();
        }
    }
}


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

* [Bug libstdc++/57421] Error when linking static libstc++ due to missing future classes
  2013-05-26 18:13 [Bug libstdc++/57421] New: Error when linking static libstc++ due to missing future classes juergen.reuter at desy dot de
                   ` (4 preceding siblings ...)
  2013-05-28 12:48 ` juergen.reuter at desy dot de
@ 2013-05-28 12:49 ` redi at gcc dot gnu.org
  2013-05-28 13:59 ` juergen.reuter at desy dot de
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2013-05-28 12:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I think you've misunderstood, I posted the minimum code and the switches needed
to reproduce the bug, I wasn't suggesting a workaround.


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

* [Bug libstdc++/57421] Error when linking static libstc++ due to missing future classes
  2013-05-26 18:13 [Bug libstdc++/57421] New: Error when linking static libstc++ due to missing future classes juergen.reuter at desy dot de
                   ` (5 preceding siblings ...)
  2013-05-28 12:49 ` redi at gcc dot gnu.org
@ 2013-05-28 13:59 ` juergen.reuter at desy dot de
  2013-05-28 14:19 ` juergen.reuter at desy dot de
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: juergen.reuter at desy dot de @ 2013-05-28 13:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jürgen Reuter <juergen.reuter at desy dot de> ---
Ok, true, now I got it. But now it really looks like a problem of the library,
and not our linking procedure. About this I was not totally sure before.
>From gcc-bugs-return-423279-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue May 28 14:02:16 2013
Return-Path: <gcc-bugs-return-423279-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 12076 invoked by alias); 28 May 2013 14:02:16 -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 11752 invoked by uid 48); 28 May 2013 14:02:02 -0000
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/57440] Memory usage with future and std containers
Date: Tue, 28 May 2013 14:02:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 4.7.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: redi 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:
Message-ID: <bug-57440-4-OazzPwulQA@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57440-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57440-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-05/txt/msg01952.txt.bz2
Content-length: 692

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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Also I can't reproduce this on GNU/Linux, the memory usage is bounded as
expected.

I'm surprised this even compiles with Mingw, are you using Mingw-w64 with
libpthread-win32?  Since it seems to be platform-specific it could be a
resource leak of mutexes or condition variables, so my wild guess is that
libpthread-win32 requires pthread_mutex_destroy or pthread_cond_destroy to be
used.

Does it make any difference if you add these to the very top of the source
file, before including any headers?

#define _GTHREAD_USE_MUTEX_INIT_FUNC
#define _GTHREAD_USE_COND_INIT_FUNC


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

* [Bug libstdc++/57421] Error when linking static libstc++ due to missing future classes
  2013-05-26 18:13 [Bug libstdc++/57421] New: Error when linking static libstc++ due to missing future classes juergen.reuter at desy dot de
                   ` (6 preceding siblings ...)
  2013-05-28 13:59 ` juergen.reuter at desy dot de
@ 2013-05-28 14:19 ` juergen.reuter at desy dot de
  2013-05-31 21:52 ` juergen.reuter at desy dot de
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: juergen.reuter at desy dot de @ 2013-05-28 14:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Jürgen Reuter <juergen.reuter at desy dot de> ---
Somehow, your example works for me :(
>From gcc-bugs-return-423281-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue May 28 15:21:54 2013
Return-Path: <gcc-bugs-return-423281-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 7218 invoked by alias); 28 May 2013 15:21:53 -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 7152 invoked by uid 48); 28 May 2013 15:21:48 -0000
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/57435] [4.8/4.9 Regression] Ice on invalid: check_for_ambiguous
Date: Tue, 28 May 2013 15:21:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: ice-on-invalid-code
X-Bugzilla-Severity: minor
X-Bugzilla-Who: burnus 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.8.1
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-57435-4-ByTQSu2u09@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57435-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57435-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-05/txt/msg01954.txt.bz2
Content-length: 638

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

--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> ---


Author: burnus
Date: Tue May 28 15:18:14 2013
New Revision: 199382

URL: http://gcc.gnu.org/viewcvs?rev\x199382&root=gcc&view=rev
Log:
2013-05-28  Dominique d'Humieres  <dominiq@lps.ens.fr>

        PR fortran/57435
        * module.c (check_for_ambiguous): Avoid null pointer deref.

2013-05-28  Tobias Burnus  <burnus@net-b.de>

        PR fortran/57435


Added:
    trunk/gcc/testsuite/gfortran.dg/use_29.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/module.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug libstdc++/57421] Error when linking static libstc++ due to missing future classes
  2013-05-26 18:13 [Bug libstdc++/57421] New: Error when linking static libstc++ due to missing future classes juergen.reuter at desy dot de
                   ` (7 preceding siblings ...)
  2013-05-28 14:19 ` juergen.reuter at desy dot de
@ 2013-05-31 21:52 ` juergen.reuter at desy dot de
  2013-06-11  6:21 ` juergen.reuter at desy dot de
  2014-01-23 11:43 ` redi at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: juergen.reuter at desy dot de @ 2013-05-31 21:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Jürgen Reuter <juergen.reuter at desy dot de> ---
Well, I checked gcc/gfortran/g++ 4.8.1 today. There, the problem DOES NOT
occur,
so it seems to be a problem of gcc 4.9-LATEST.
>From gcc-bugs-return-423616-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri May 31 21:54:15 2013
Return-Path: <gcc-bugs-return-423616-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 4919 invoked by alias); 31 May 2013 21:54:15 -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 4880 invoked by uid 48); 31 May 2013 21:54:12 -0000
From: "mrs at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/57438] bootstrap fails on x86_64 darwin in stage2 linking cc1
Date: Fri, 31 May 2013 21:54:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: bootstrap
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mrs 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:
Message-ID: <bug-57438-4-zDcWGj0iQj@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57438-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57438-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-05/txt/msg02289.txt.bz2
Content-length: 1306

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

--- Comment #14 from mrs at gcc dot gnu.org <mrs at gcc dot gnu.org> ---
Thanks, how about this one?

Index: target.def
==================================================================--- target.def    (revision 199270)
+++ target.def    (working copy)
@@ -225,7 +225,7 @@ DEFHOOK
 (named_section,
  "",
  void, (const char *name, unsigned int flags, tree decl),
- default_no_named_section)
+ 0)

 /* Return preferred text (sub)section for function DECL.
    Main purpose of this function is to separate cold, normal and hot
Index: varasm.c
==================================================================--- varasm.c    (revision 199270)
+++ varasm.c    (working copy)
@@ -6042,19 +6042,6 @@ have_global_bss_p (void)
   return bss_noswitch_section || targetm.have_switchable_bss_sections;
 }

-/* Output assembly to switch to section NAME with attribute FLAGS.
-   Four variants for common object file formats.  */
-
-void
-default_no_named_section (const char *name ATTRIBUTE_UNUSED,
-              unsigned int flags ATTRIBUTE_UNUSED,
-              tree decl ATTRIBUTE_UNUSED)
-{
-  /* Some object formats don't support named sections at all.  The
-     front-end should already have flagged this as an error.  */
-  gcc_unreachable ();
-}
-


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

* [Bug libstdc++/57421] Error when linking static libstc++ due to missing future classes
  2013-05-26 18:13 [Bug libstdc++/57421] New: Error when linking static libstc++ due to missing future classes juergen.reuter at desy dot de
                   ` (8 preceding siblings ...)
  2013-05-31 21:52 ` juergen.reuter at desy dot de
@ 2013-06-11  6:21 ` juergen.reuter at desy dot de
  2014-01-23 11:43 ` redi at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: juergen.reuter at desy dot de @ 2013-06-11  6:21 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 2559 bytes --]

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

--- Comment #10 from Jürgen Reuter <juergen.reuter at desy dot de> ---
After I completely recompiled the trunk version (r199585) the problem is gone.
So most probably it resulted from an incomplete update and recompilation of the
code,
or was in an intermediate step of the development, which seems to be gone by
now.
>From gcc-bugs-return-424138-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jun 11 07:31:44 2013
Return-Path: <gcc-bugs-return-424138-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 28638 invoked by alias); 11 Jun 2013 07:31: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 28569 invoked by uid 48); 11 Jun 2013 07:31:38 -0000
From: "dcb314 at hotmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/54582] gap in FORTIFY checking of buffer lengths
Date: Tue, 11 Jun 2013 07:31:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: dcb314 at hotmail dot com
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: attachments.created
Message-ID: <bug-54582-4-f12DgUUquR@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-54582-4@http.gcc.gnu.org/bugzilla/>
References: <bug-54582-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-06/txt/msg00517.txt.bz2
Content-length: 389

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

--- Comment #16 from David Binderman <dcb314 at hotmail dot com> ---
Created attachment 30287
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id0287&actioníit
C++ source code

Latest version understands NUM1.NUM2, 53 formatting specifiers
and a bunch of prefixes like %#

It seems to work well over the source code of Fedora Linux.


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

* [Bug libstdc++/57421] Error when linking static libstc++ due to missing future classes
  2013-05-26 18:13 [Bug libstdc++/57421] New: Error when linking static libstc++ due to missing future classes juergen.reuter at desy dot de
                   ` (9 preceding siblings ...)
  2013-06-11  6:21 ` juergen.reuter at desy dot de
@ 2014-01-23 11:43 ` redi at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2014-01-23 11:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #11 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I can't reproduce this now either, closing


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

end of thread, other threads:[~2014-01-23 11:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-26 18:13 [Bug libstdc++/57421] New: Error when linking static libstc++ due to missing future classes juergen.reuter at desy dot de
2013-05-26 18:14 ` [Bug libstdc++/57421] " juergen.reuter at desy dot de
2013-05-28 10:10 ` redi at gcc dot gnu.org
2013-05-28 10:59 ` juergen.reuter at desy dot de
2013-05-28 12:15 ` redi at gcc dot gnu.org
2013-05-28 12:48 ` juergen.reuter at desy dot de
2013-05-28 12:49 ` redi at gcc dot gnu.org
2013-05-28 13:59 ` juergen.reuter at desy dot de
2013-05-28 14:19 ` juergen.reuter at desy dot de
2013-05-31 21:52 ` juergen.reuter at desy dot de
2013-06-11  6:21 ` juergen.reuter at desy dot de
2014-01-23 11:43 ` 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).