This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH] Use the middle-end boolean_type_node
- From: FX <fxcoudert at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: vogt at linux dot vnet dot ibm dot com, Janne Blomqvist <blomqvist dot janne at gmail dot com>, fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Date: Tue, 3 Jan 2017 20:16:49 +0100
- Subject: Re: [PATCH] Use the middle-end boolean_type_node
- Authentication-results: sourceware.org; auth=none
- References: <1481662749-31499-1-git-send-email-blomqvist.janne@gmail.com> <20170103141446.GA1354@linux.vnet.ibm.com> <20170103142026.GV21933@tucnak>
> The gfc_init_types change is an ABI change, at least if the fortran FE
> bool type is ever stored in memory and accessed by multiple TUs, or
> passed as argument etc. And the difference between the C/C++ _Bool/bool
> and fortran FE bool has caused lots of issues in the past, so if it can be
> the same type, it is preferrable.
The patch committed doesn’t change the way Fortran LOGICAL types are emitted. The fact that the default LOGICAL kind is different (on most platforms) from C/C++ boolean is due to the standard, and not our own choice of ABI.
As Jane says, boolean_type_node in the Fortran front-end is only used for intermediate values and temporaries; it is used every time we build a COND_EXPR. It is not part of the ABI.
FX