On Tue, Jan 3, 2017 at 6:50 PM, Andreas Krebbel
<kreb...@linux.vnet.ibm.com> wrote:
> The regression with 8 bit boolean types surfaced with the z10 machine. The 
> ABI is much older. Since
> we cannot change it anymore we should rather talk to the hardware guys to add 
> the instruction we
> need. So for now we probably have to live with the regression in the Fortran 
> cases since as I
> understand it your change fixes an actual problem.

I do think this is fixable without waiting for potential improved
hardware.  The vast majority of uses of boolean_type_node in the
Fortran frontend is code like

          tmp = fold_build2_loc (input_location, GT_EXPR,
                                 boolean_type_node, from_len,
                                 build_zero_cst (TREE_TYPE (from_len)));
          tmp = fold_build3_loc (input_location, COND_EXPR,
                                 void_type_node, tmp, extcopy, stdcopy);

where the result of a boolean expression is returned as a
boolean_type_node.  This is a more like high-level language semantics,
whereas on the asm level boolean expressions are of course evaluated
with integer arithmetic (or are there targets where this is not
true?).

So while the Fortran frontend shouldn't redefine the ABI specified
boolean_type_node, for situations like the above we could instead use
some fast_scalar_non_abi_bool_type_node (better name suggestions
welcome?), if we had some mechanism for returning such information
from the backend? Or is there some universal best choice here?

Or since boolean types are not actually present at the asm level, what
is the best choice in cases like the above in order to generate code
that can be lowered to as efficient code as possible? Should the
result of the fold_build2_loc be of, say, TREE_TYPE(from_len) instead
of boolean_type_node (or fast_scalar_non_abi_bool_type_node or
whatever we come up with)?


(Repost without html formatting, sorry for the spam)

-- 
Janne Blomqvist

Reply via email to