public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/6090: Problem with copy of std_valarray
@ 2002-03-29 12:11 paolo
0 siblings, 0 replies; 8+ messages in thread
From: paolo @ 2002-03-29 12:11 UTC (permalink / raw)
To: erwan.goasdoue, gcc-bugs, gcc-prs, nobody
Synopsis: Problem with copy of std_valarray
State-Changed-From-To: open->analyzed
State-Changed-By: paolo
State-Changed-When: Fri Mar 29 12:11:01 2002
State-Changed-Why:
Could you please provide a short, self-contained testcase
demonstrating the problem?
Thanks, Paolo.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6090
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: libstdc++/6090: Problem with copy of std_valarray
@ 2002-08-03 13:44 gdr
0 siblings, 0 replies; 8+ messages in thread
From: gdr @ 2002-08-03 13:44 UTC (permalink / raw)
To: erwan.goasdoue, gcc-bugs, gcc-prs, gdr
Synopsis: Problem with copy of std_valarray
State-Changed-From-To: analyzed->closed
State-Changed-By: gdr
State-Changed-When: Sat Aug 3 13:44:35 2002
State-Changed-Why:
Not a bug
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6090
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: libstdc++/6090: Problem with copy of std_valarray
@ 2002-04-11 16:56 Gabriel Dos Reis
0 siblings, 0 replies; 8+ messages in thread
From: Gabriel Dos Reis @ 2002-04-11 16:56 UTC (permalink / raw)
To: gdr; +Cc: gcc-prs
The following reply was made to PR libstdc++/6090; it has been noted by GNATS.
From: Gabriel Dos Reis <gdr@codesourcery.com>
To: Benjamin Kosnik <bkoz@redhat.com>
Cc: gdr@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/6090: Problem with copy of std_valarray
Date: 12 Apr 2002 01:53:10 +0200
Benjamin Kosnik <bkoz@redhat.com> writes:
| The following reply was made to PR libstdc++/6090; it has been noted by GNATS.
|
| From: Benjamin Kosnik <bkoz@redhat.com>
| To: Gabriel Dos Reis <gdr@codesourcery.com>
| Cc: erwan.goasdoue@ipsis.fr, gcc-bugs@gcc.gnu.org, gdr@gcc.gnu.org,
| gcc-gnats@gcc.gnu.org
| Subject: Re: libstdc++/6090: Problem with copy of std_valarray
| Date: Wed, 10 Apr 2002 09:49:17 -0700 (PDT)
|
| > That is the mandated behaviour, in particular if the source and the
| > target don't have the same length then the behaviour is undefined.
|
| I think the problem is that the assignment and copy ctor do different
| things. Why is that?
(I'm not sure that is really a problem).
The copy constructor is supposed to construct a new object out of an
existing one, whereas the assignment operator is supposed to assign
values to components of an existing object. Those two operations are
fundamentally semantically different. Valarray<>'s design is more
driven by speed than by security; the assignement operator is more
memcpy()-like than std::vector<>::operator=()-like. That was a design
choice explained by the fact that valarray<>s are meant to be basic
blocks with "basic" operations.
-- Gaby
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: libstdc++/6090: Problem with copy of std_valarray
@ 2002-04-10 10:26 Benjamin Kosnik
0 siblings, 0 replies; 8+ messages in thread
From: Benjamin Kosnik @ 2002-04-10 10:26 UTC (permalink / raw)
To: gdr; +Cc: gcc-prs
The following reply was made to PR libstdc++/6090; it has been noted by GNATS.
From: Benjamin Kosnik <bkoz@redhat.com>
To: Gabriel Dos Reis <gdr@codesourcery.com>
Cc: erwan.goasdoue@ipsis.fr, gcc-bugs@gcc.gnu.org, gdr@gcc.gnu.org,
gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/6090: Problem with copy of std_valarray
Date: Wed, 10 Apr 2002 09:49:17 -0700 (PDT)
> That is the mandated behaviour, in particular if the source and the
> target don't have the same length then the behaviour is undefined.
I think the problem is that the assignment and copy ctor do different
things. Why is that?
-benjamin
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: libstdc++/6090: Problem with copy of std_valarray
@ 2002-04-08 4:16 Gabriel Dos Reis
0 siblings, 0 replies; 8+ messages in thread
From: Gabriel Dos Reis @ 2002-04-08 4:16 UTC (permalink / raw)
To: gdr; +Cc: gcc-prs
The following reply was made to PR libstdc++/6090; it has been noted by GNATS.
From: Gabriel Dos Reis <gdr@codesourcery.com>
To: bkoz@gcc.gnu.org
Cc: erwan.goasdoue@ipsis.fr, gcc-bugs@gcc.gnu.org, gdr@gcc.gnu.org,
gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/6090: Problem with copy of std_valarray
Date: 08 Apr 2002 13:06:42 +0200
bkoz@gcc.gnu.org writes:
| Synopsis: Problem with copy of std_valarray
|
| State-Changed-From-To: feedback->analyzed
| State-Changed-By: bkoz
| State-Changed-When: Wed Apr 3 12:45:33 2002
| State-Changed-Why:
| This looks like it is still an issue in gcc-3.1.
|
| include/std/std_valarray.h: 342
|
| template<typename _Tp>
| inline valarray<_Tp>&
| valarray<_Tp>::operator= (const valarray<_Tp>& __v)
| {
| __valarray_copy(__v._M_data, _M_size, _M_data);
| return *this;
| }
|
| include/std/std_valarray.h: 284
| template<typename _Tp>
| inline valarray<_Tp>::valarray (const valarray<_Tp>& __v)
| : _M_size(__v._M_size), _M_data(__valarray_get_storage<_Tp>(__v._M_size))
| { __valarray_copy_construct (__v._M_data, __v._M_data + _M_size, _M_data); }
I'm not sure I understand what the problem is about. Is the submitter
complaining that copying a valarray wasn't adjusting the target's size?
That is the mandated behaviour, in particular if the source and the
target don't have the same length then the behaviour is undefined.
-- Gaby
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: libstdc++/6090: Problem with copy of std_valarray
@ 2002-04-03 12:45 bkoz
0 siblings, 0 replies; 8+ messages in thread
From: bkoz @ 2002-04-03 12:45 UTC (permalink / raw)
To: erwan.goasdoue, gcc-bugs, gcc-prs, gdr
Synopsis: Problem with copy of std_valarray
State-Changed-From-To: feedback->analyzed
State-Changed-By: bkoz
State-Changed-When: Wed Apr 3 12:45:33 2002
State-Changed-Why:
This looks like it is still an issue in gcc-3.1.
include/std/std_valarray.h: 342
template<typename _Tp>
inline valarray<_Tp>&
valarray<_Tp>::operator= (const valarray<_Tp>& __v)
{
__valarray_copy(__v._M_data, _M_size, _M_data);
return *this;
}
include/std/std_valarray.h: 284
template<typename _Tp>
inline valarray<_Tp>::valarray (const valarray<_Tp>& __v)
: _M_size(__v._M_size), _M_data(__valarray_get_storage<_Tp>(__v._M_size))
{ __valarray_copy_construct (__v._M_data, __v._M_data + _M_size, _M_data); }
Gaby?
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6090
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: libstdc++/6090: Problem with copy of std_valarray
@ 2002-04-01 18:51 bkoz
0 siblings, 0 replies; 8+ messages in thread
From: bkoz @ 2002-04-01 18:51 UTC (permalink / raw)
To: erwan.goasdoue, gcc-bugs, gcc-prs, gdr, nobody
Synopsis: Problem with copy of std_valarray
Responsible-Changed-From-To: unassigned->gdr
Responsible-Changed-By: bkoz
Responsible-Changed-When: Mon Apr 1 18:51:24 2002
Responsible-Changed-Why:
Yours.....
State-Changed-From-To: analyzed->feedback
State-Changed-By: bkoz
State-Changed-When: Mon Apr 1 18:51:24 2002
State-Changed-Why:
Can you make sure that this is still an issue with gcc-3_1?
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6090
^ permalink raw reply [flat|nested] 8+ messages in thread
* libstdc++/6090: Problem with copy of std_valarray
@ 2002-03-29 2:16 erwan.goasdoue
0 siblings, 0 replies; 8+ messages in thread
From: erwan.goasdoue @ 2002-03-29 2:16 UTC (permalink / raw)
To: gcc-gnats
>Number: 6090
>Category: libstdc++
>Synopsis: Problem with copy of std_valarray
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Mar 29 02:16:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: std_valarray.h
>Release: happened with gcc 2.95.3
>Organization:
>Environment:
linux mandrake 8.1
>Description:
Problem with operator= :
valarray<_Tp>::operator= (const valarray<_Tp>& __v)
{
__valarray_copy(__v._M_data, _M_size, _M_data);
return *this;
}
contrary to :
template<typename _Tp>
inline valarray<_Tp>::valarray (const valarray<_Tp>& __v)
: _M_size (__v._M_size), _M_data (new _Tp[__v._M_size])
{ __valarray_copy (__v._M_data, _M_size, _M_data); }
never modify size of target.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2002-08-03 20:44 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-29 12:11 libstdc++/6090: Problem with copy of std_valarray paolo
-- strict thread matches above, loose matches on Subject: below --
2002-08-03 13:44 gdr
2002-04-11 16:56 Gabriel Dos Reis
2002-04-10 10:26 Benjamin Kosnik
2002-04-08 4:16 Gabriel Dos Reis
2002-04-03 12:45 bkoz
2002-04-01 18:51 bkoz
2002-03-29 2:16 erwan.goasdoue
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).