This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/435: incorrect treatment of ++ operator
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/435: incorrect treatment of ++ operator
- From: bland at japan dot com
- Date: 28 Jul 2000 07:16:17 -0000
- Cc: mikhail at gol dot com
- Reply-To: bland at japan dot com
- Resent-Cc: gcc-prs at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, jason at gcc dot gnu dot org, mikhail at gol dot com
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, bland@japan.com
>Number: 435
>Category: c++
>Synopsis: incorrect treatment of ++ operator
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Fri Jul 28 00:26:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: bland@japan.com
>Release: unknown-1.0
>Organization:
>Environment:
>Description:
The sample attached prints 2 instead of 1. This behaviour is different from x86 codegen.
We are using:
%uname -a
SunOS leo 5.6 Generic_105181-19 sun4u sparc SUNW,Ultra-5_10
%gcc --version
2.95.2
>How-To-Repeat:
Compile sample on sparc platform.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="bug.cxx"
Content-Disposition: inline; filename="bug.cxx"
#include <iostream>
#include <vector>
int
main (void)
{
vector<unsigned char> v;
const char* s = "12345";
v.push_back (*s++);
cerr << v[0] << endl;
return 0;
}