Opened 8 years ago

#10632 new Bugs

Problem with range transform with gcc-4.8 optimized

Reported by: Fabien Nendaz <fabien@…> Owned by: Neil Groves
Milestone: To Be Determined Component: range
Version: Boost 1.55.0 Severity: Problem
Keywords: Cc:

Description

With gcc4.8, if the option -O is used, the operation " | transformed(arg1)" on a transformed range leads to unexpected results.

E.g. if "initialVec" is a vector containing any values, the following line gives a null resultVec:
auto resultVec = initialVec | transformed( arg1 * 2 ) | transformed( arg1 );

This problem is also present with clang (optimized) and visual studio 2013 (in release), but not in debug modes, and not with gcc-4.6.

Note that an operation in the second transformed remove this problem: the following code is working as expected:
auto resultVec = initialVec | transformed( arg1 * 2 ) | transformed( arg1 * 1 );

This problem has been reproduced with boost 1.49, 1.55 and 1.56.

Attachments (1)

transform_pb.cpp (607 bytes ) - added by Fabien Nendaz <fabien@…> 8 years ago.
Minimal program to reproduce

Download all attachments as: .zip

Change History (1)

by Fabien Nendaz <fabien@…>, 8 years ago

Attachment: transform_pb.cpp added

Minimal program to reproduce

Note: See TracTickets for help on using tickets.