This is the mail archive of the
mailing list for the GCC project.
Re: Clarifying attribute-const
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: gcc at gcc dot gnu dot org, Geert Bosch <boschg at mac dot com>, Alexander Monakov <amonakov at ispras dot ru>
- Date: Fri, 02 Oct 2015 10:42 +0200
- Subject: Re: Clarifying attribute-const
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LNX dot 2 dot 20 dot 1509251933001 dot 23590 at monopod dot intra dot ispras dot ru> <E1BB19B1-2CC6-494C-AFDC-49ED2FD227FD at mac dot com> <CAFiYyc0GhDs=aetjsWYGBXK9u05r9e29u63z4um5uHBpffNjZA at mail dot gmail dot com>
> I think that's less clear as the transform basically duplicates the call
> on both branches and removes the one that is not necessary.
Yes, IMO that one is allowed under the as-if rule.
> I think GCC does both though (if it throws only externally, for
> internally throwing ones the transforms would be too complicated).
We never ran into a problem with that in practice AFAIK.