public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61597] New: Unexpected behavior at runtime
@ 2014-06-24 17:18 adrien.hamelin+gcc at gmail dot com
  2014-06-24 18:00 ` [Bug c++/61597] " adrien.hamelin+gcc at gmail dot com
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: adrien.hamelin+gcc at gmail dot com @ 2014-06-24 17:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61597

            Bug ID: 61597
           Summary: Unexpected behavior at runtime
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: adrien.hamelin+gcc at gmail dot com

When compiling the code visible at the link at the bottom, the compiler eat it
fine and produce an executable, but it doesn't work.

The problem is in the std::iota function present in the main. For the second
parameter, "begin + size", the operator+ is effectively called and works as
expected, but the result parameter given to the function is "begin" unmodified
(checked with gdb in without optimizations).

The code compiles and runs fine with Visual 13 and Clang 3.4.2.
It also runs fine if i use a "std::vector" instead of my "Memory::Array", or if
i use "std::next(begin, size)".

I tried to remove all unnecessary code to show the bug.

The option given to gcc are shown in the link, but it also doesn't work with no
optimizations. I had the bug on Mingw64 with gcc4.9 on Windows 7 64, and also
on the website.


http://coliru.stacked-crooked.com/a/d6fde84b59d4526a


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

end of thread, other threads:[~2023-01-31  3:35 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-24 17:18 [Bug c++/61597] New: Unexpected behavior at runtime adrien.hamelin+gcc at gmail dot com
2014-06-24 18:00 ` [Bug c++/61597] " adrien.hamelin+gcc at gmail dot com
2014-06-25  6:47 ` adrien.hamelin+gcc at gmail dot com
2014-06-25  6:57 ` trippels at gcc dot gnu.org
2014-06-25  8:22 ` adrien.hamelin+gcc at gmail dot com
2014-06-25  8:36 ` adrien.hamelin+gcc at gmail dot com
2014-06-25 10:03 ` redi at gcc dot gnu.org
2014-06-25 10:12 ` redi at gcc dot gnu.org
2014-06-25 11:30 ` adrien.hamelin+gcc at gmail dot com
2014-06-25 12:16 ` redi at gcc dot gnu.org
2014-06-25 13:00 ` glisse at gcc dot gnu.org
2014-06-25 13:08 ` redi at gcc dot gnu.org
2014-06-25 13:23 ` glisse at gcc dot gnu.org
2014-06-25 16:56 ` manu at gcc dot gnu.org
2014-06-25 20:31 ` glisse at gcc dot gnu.org
2023-01-31  3:35 ` pinskia 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).