This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, i386]: Use std::swap


On Tue, Nov 11, 2014 at 10:41 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Tue, Nov 11, 2014 at 9:09 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>> On Mon, Nov 10, 2014 at 10:51 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
>>> On Mon, 10 Nov 2014, Richard Biener wrote:
>>>
>>>> No extra includes required?
>>>
>>>
>>> <utility> is already included in wide-int.h and rtl.h, should probably move
>>> those.
>>
>> Bah, we hit a problem. std::swap has been moved from <algorithm> to
>> <utility> in C++11, and the patch breaks build on CentOS 5.11
>> (gcc-4.1.2).
>>
>> Short of reverting the i386.c patch, is there a quick solution by
>> including some additional headers?
>
> Attached patch that implements both suggestions from Richi and Marc
> fixes the bootstrap.
>
> 2014-11-11  Uros Bizjak  <ubizjak@gmail.com>
>
>     * system.h: Include algorithm and utility.
>     * rtl.h: Do not include utility here.
>     * wide-int.h: Ditto.
>     * tree-vect-data-refs.c (swap): Remove template.
>     (vect_prune_runtime_alias_test_list): Use std::swap instead of swap.
>
> Bootstrapped on x86_64-linux-gnu (CentOS 5.11).
>
> OK for mainline?
>
> BTW: There are lots of places where std::swap can be used, a nice
> search-and-replace task for someone to start with gcc development. ;)

Agreed ;)  Note that we have to be careful to avoid pulling all of libstdc++
into all files via system.h (system.h is so a bad thing... :/).

Ok.

Thanks,
Richard.

> Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]