public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59742] New: compilation failed for package ‘RcppEigen’
@ 2014-01-09 20:15 patrik.dinnetz at sh dot se
  2014-01-09 20:53 ` [Bug c++/59742] " patrik.dinnetz at sh dot se
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: patrik.dinnetz at sh dot se @ 2014-01-09 20:15 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59742
           Summary: compilation failed for package ‘RcppEigen’
           Product: gcc
           Version: 4.4.6
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: patrik.dinnetz at sh dot se

Failing to instal package lme4 in R due to failing compilation of package
RcppEigen

Ubunutu 12.04
package R version 3.02

install.packages("lme4")
Installing package into ‘/home/patrik/R/i686-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
also installing the dependency ‘RcppEigen’

trying URL
'http://ftp.sunet.se/pub/lang/CRAN/src/contrib/RcppEigen_0.3.2.0.1.tar.gz'
Content type 'application/x-gzip' length 1251939 bytes (1.2 Mb)
opened URL
==================================================
downloaded 1.2 Mb

trying URL 'http://ftp.sunet.se/pub/lang/CRAN/src/contrib/lme4_1.0-5.tar.gz'
Content type 'application/x-gzip' length 2706261 bytes (2.6 Mb)
opened URL
==================================================
downloaded 2.6 Mb

* installing *source* package ‘RcppEigen’ ...
** package ‘RcppEigen’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/share/R/include -DNDEBUG  
-I"/home/patrik/R/i686-pc-linux-gnu-library/3.0/Rcpp/include" 
-I../inst/include -fpic  -O3 -pipe  -g  -c RcppEigen.cpp -o RcppEigen.o
g++ -I/usr/share/R/include -DNDEBUG  
-I"/home/patrik/R/i686-pc-linux-gnu-library/3.0/Rcpp/include" 
-I../inst/include -fpic  -O3 -pipe  -g  -c fastLm.cpp -o fastLm.o
{standard input}: Assembler messages:
{standard input}:115964: Warning: end of file not at end of a line; newline
inserted
{standard input}:118061: Error: invalid operands (*UND* and .gcc_except_table
sections) for `-'
g++: internt kompilatorfel: Dödad (program cc1plus)
Var vänlig och skicka in en komplett felrapport,
(translation from Swedish - please send compleate bugreport)
om möjligt med preprocessad källfil.
Se <file:///usr/share/doc/gcc-4.6/README.Bugs> för instruktioner.
make: *** [fastLm.o] Fel 4
ERROR: compilation failed for package ‘RcppEigen’
* removing ‘/home/patrik/R/i686-pc-linux-gnu-library/3.0/RcppEigen’
ERROR: dependency ‘RcppEigen’ is not available for package ‘lme4’
* removing ‘/home/patrik/R/i686-pc-linux-gnu-library/3.0/lme4’

The downloaded source packages are in
    ‘/tmp/RtmpvTqqF1/downloaded_packages’
Warning messages:
1: In install.packages("lme4") :
  installation of package ‘RcppEigen’ had non-zero exit status
2: In install.packages("lme4") :
  installation of package ‘lme4’ had non-zero exit status
>From gcc-bugs-return-439831-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jan 09 20:39:30 2014
Return-Path: <gcc-bugs-return-439831-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 8805 invoked by alias); 9 Jan 2014 20:15: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 20259 invoked by uid 48); 9 Jan 2014 20:01:03 -0000
From: "rsandifo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/59137] [4.7 Regression] Miscompilation at -O1 on mips/mipsel
Date: Thu, 09 Jan 2014 20:15: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.8.2
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: major
X-Bugzilla-Who: rsandifo at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: rsandifo at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.7.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: short_desc
Message-ID: <bug-59137-4-ALG7dTHguK@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59137-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59137-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-01/txt/msg00973.txt.bz2
Content-length: 637

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

rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.7/4.8/4.9 Regression]    |[4.7 Regression]
                   |Miscompilation at -O1 on    |Miscompilation at -O1 on
                   |mips/mipsel                 |mips/mipsel

--- Comment #6 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
Patch applied to mainline and 4.8 so far.  I'm not sure whether it's
suitable for 4.7 at this stage.


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

* [Bug c++/59742] compilation failed for package ‘RcppEigen’
  2014-01-09 20:15 [Bug c++/59742] New: compilation failed for package ‘RcppEigen’ patrik.dinnetz at sh dot se
@ 2014-01-09 20:53 ` patrik.dinnetz at sh dot se
  2014-01-09 21:09 ` glisse at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: patrik.dinnetz at sh dot se @ 2014-01-09 20:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from patrikdinnetz <patrik.dinnetz at sh dot se> ---
source file to large attach


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

* [Bug c++/59742] compilation failed for package ‘RcppEigen’
  2014-01-09 20:15 [Bug c++/59742] New: compilation failed for package ‘RcppEigen’ patrik.dinnetz at sh dot se
  2014-01-09 20:53 ` [Bug c++/59742] " patrik.dinnetz at sh dot se
@ 2014-01-09 21:09 ` glisse at gcc dot gnu.org
  2014-01-15  0:51 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-01-09 21:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |normal

--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> ---
Please try gcc-4.8.x, 4.4 hasn't been supported for several years.
If a file is too large to attach, you can compress it.
Also, please export LC_ALL=C to avoid German messages.


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

* [Bug c++/59742] compilation failed for package ‘RcppEigen’
  2014-01-09 20:15 [Bug c++/59742] New: compilation failed for package ‘RcppEigen’ patrik.dinnetz at sh dot se
  2014-01-09 20:53 ` [Bug c++/59742] " patrik.dinnetz at sh dot se
  2014-01-09 21:09 ` glisse at gcc dot gnu.org
@ 2014-01-15  0:51 ` pinskia at gcc dot gnu.org
  2014-01-15  9:04 ` redi at gcc dot gnu.org
  2014-01-15 15:31 ` patrik.dinnetz at sh dot se
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-01-15  0:51 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2014-01-15
     Ever confirmed|0                           |1

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
>g++: internt kompilatorfel: Dödad (program cc1plus)

How much memory do you have installed or even how much swap space do you have?
cc1plus is being killed by the kernel due to out of memory.
>From gcc-bugs-return-440379-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jan 15 00:53:57 2014
Return-Path: <gcc-bugs-return-440379-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 6174 invoked by alias); 15 Jan 2014 00:53:57 -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 6153 invoked by uid 48); 15 Jan 2014 00:53:53 -0000
From: "ppluzhnikov at google dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/59818] New: [4.9 regression] Bogus error: call of overloaded .... is ambiguous
Date: Wed, 15 Jan 2014 00:53: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: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ppluzhnikov at google 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-59818-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-01/txt/msg01521.txt.bz2
Content-length: 1658

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

            Bug ID: 59818
           Summary: [4.9 regression] Bogus error: call of overloaded ....
                    is ambiguous
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppluzhnikov at google dot com

This is caused by r197790 (fix for PR c++/23055).
Google ref: b/12471166

/// --- cut ---
template <class T>
struct Identity {
  typedef T type;
};

struct Foo {
  template <typename T>
  Foo(T*, void (Identity<T>::type::*m)(void));

  template <typename T>
  Foo(const T*, void (Identity<T>::type::*m)(void) const);
};

struct Bar {
  void Method(void) const;
};

void Bar::Method(void) const
{
  Foo foo(this, &Bar::Method);
}
/// --- cut ---

Using g++ (GCC) 4.9.0 20140110 (experimental)

g++ -c t.cc
t.cc: In member function 'void Bar::Method() const':
t.cc:20:29: error: call of overloaded 'Foo(const Bar*, void (Bar::*)() const)'
is ambiguous
   Foo foo(this, &Bar::Method);
                             ^
t.cc:20:29: note: candidates are:
t.cc:11:3: note: Foo::Foo(const T*, void (Identity<T>::type::*)() const) [with
T = Bar; typename Identity<T>::type = Bar]
   Foo(const T*, void (Identity<T>::type::*m)(void) const);
   ^
t.cc:8:3: note: Foo::Foo(T*, void (Identity<T>::type::*)()) [with T = const
Bar; typename Identity<T>::type = const Bar]
   Foo(T*, void (Identity<T>::type::*m)(void));
   ^


Replacing 'Identity<T>::type' with 'T' makes the problem go away.
Source accepted by gcc-4.8 and Clang.


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

* [Bug c++/59742] compilation failed for package ‘RcppEigen’
  2014-01-09 20:15 [Bug c++/59742] New: compilation failed for package ‘RcppEigen’ patrik.dinnetz at sh dot se
                   ` (2 preceding siblings ...)
  2014-01-15  0:51 ` pinskia at gcc dot gnu.org
@ 2014-01-15  9:04 ` redi at gcc dot gnu.org
  2014-01-15 15:31 ` patrik.dinnetz at sh dot se
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2014-01-15  9:04 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |INVALID

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Not a GCC bug then.


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

* [Bug c++/59742] compilation failed for package ‘RcppEigen’
  2014-01-09 20:15 [Bug c++/59742] New: compilation failed for package ‘RcppEigen’ patrik.dinnetz at sh dot se
                   ` (3 preceding siblings ...)
  2014-01-15  9:04 ` redi at gcc dot gnu.org
@ 2014-01-15 15:31 ` patrik.dinnetz at sh dot se
  4 siblings, 0 replies; 6+ messages in thread
From: patrik.dinnetz at sh dot se @ 2014-01-15 15:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from patrikdinnetz <patrik.dinnetz at sh dot se> ---
   Probably not./Patrik

   -----"redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> skrev: -----Till:
   Patrik Dinnétz/Personal/Sodertorn@Sodertorn
   Från: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
   Datum: 01/15/2014 10:04FM
   Ärende: [Bug c++/59742] compilation failed for package ‘RcppEigen’

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

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

   What |Removed |Added
   ----------------------------------------------------------------------------
   Status|WAITING |RESOLVED
   Resolution|--- |INVALID

   --- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
   Not a GCC bug then.

   --
   You are receiving this mail because:
   You reported the bug.
>From gcc-bugs-return-440456-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jan 15 15:35:34 2014
Return-Path: <gcc-bugs-return-440456-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 13192 invoked by alias); 15 Jan 2014 15:35:33 -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 13025 invoked by uid 48); 15 Jan 2014 15:34:55 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug testsuite/59808] [4.9 Regression] r206596 caused: FAIL: gcc.target/i386/sse-14.c (test for excess errors)
Date: Wed, 15 Jan 2014 15:35: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: ubizjak at gmail dot com
X-Bugzilla-Status: RESOLVED
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:
Message-ID: <bug-59808-4-jZwREfGJVm@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59808-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59808-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: 2014-01/txt/msg01598.txt.bz2
Content-length: 607

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

--- Comment #9 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Kirill Yukhin from comment #7)
> Author: kyukhin
> Date: Wed Jan 15 12:01:08 2014
> New Revision: 206629
> 
> URL: http://gcc.gnu.org/viewcvs?rev=206629&root=gcc&view=rev
> Log:
>         PR target/59808
>         * gcc.target/i386/sse-12.c: Add `-mavx512[cd, er, pf]' options.
>         * gcc.target/i386/sse-14.c: Fix PR59808.

This is not a good ChangeLog entry. You should say somethin along

* gcc.target/i386/sse-14.c: Update constant avx512erintrin.h tests.
>From gcc-bugs-return-440457-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jan 15 15:35:50 2014
Return-Path: <gcc-bugs-return-440457-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 13886 invoked by alias); 15 Jan 2014 15: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 13852 invoked by uid 48); 15 Jan 2014 15:35:46 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug testsuite/59808] [4.9 Regression] r206596 caused: FAIL: gcc.target/i386/sse-14.c (test for excess errors)
Date: Wed, 15 Jan 2014 15:35: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: ubizjak at gmail dot com
X-Bugzilla-Status: RESOLVED
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:
Message-ID: <bug-59808-4-0nDXXnwHGt@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59808-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59808-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: 2014-01/txt/msg01599.txt.bz2
Content-length: 387

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

--- Comment #10 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Uroš Bizjak from comment #9)

> This is not a good ChangeLog entry. You should say somethin along
> 
> * gcc.target/i386/sse-14.c: Update constant avx512erintrin.h tests.

* gcc.target/i386/sse-14.c: Update constants for avx512erintrin.h tests.
>From gcc-bugs-return-440458-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jan 15 15:36:37 2014
Return-Path: <gcc-bugs-return-440458-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 14677 invoked by alias); 15 Jan 2014 15:36:36 -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 14648 invoked by uid 48); 15 Jan 2014 15:36:32 -0000
From: "lin90162 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/59829] New: Calling vector::data() occurs undefined behavior when the vector is empty
Date: Wed, 15 Jan 2014 15:36: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.8.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: lin90162 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-59829-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-01/txt/msg01600.txt.bz2
Content-length: 1304

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

            Bug ID: 59829
           Summary: Calling vector::data() occurs undefined behavior when
                    the vector is empty
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lin90162 at gmail dot com

When vector is empty, calling vector::data() occurs undefined behavior by
dereferencing NULL.

The implementation of vector::data() and vector::front() in libstdc++ are below


/// BEGIN OF CODE

reference
front()
{ return *begin(); }

const_reference
front() const
{ return *begin(); }

data() _GLIBCXX_NOEXCEPT
{ return std::__addressof(front()); }

data() _GLIBCXX_NOEXCEPT
{ return std::__addressof(front()); }

/// END OF CODE


Here, when vector is empty, begin() is called, then begin() returns NULL and it
is dereferenced.

N3337 23.3.6.4 says "Returns: A pointer such that [data(),data() + size()) is a
valid range. For a non-empty vector, data() == &front()".
It means that calling vector::data() is well-defined even if vector is empty.

As additional information, libc++ implementation of vector::data() can be
called safely when vector is empty.


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

end of thread, other threads:[~2014-01-15 15:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-09 20:15 [Bug c++/59742] New: compilation failed for package ‘RcppEigen’ patrik.dinnetz at sh dot se
2014-01-09 20:53 ` [Bug c++/59742] " patrik.dinnetz at sh dot se
2014-01-09 21:09 ` glisse at gcc dot gnu.org
2014-01-15  0:51 ` pinskia at gcc dot gnu.org
2014-01-15  9:04 ` redi at gcc dot gnu.org
2014-01-15 15:31 ` patrik.dinnetz at sh dot se

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