On Tue, Dec 15, 2020 at 05:02:24PM +0100, Thomas Schwinge wrote:
> Per the 'fold_convert_loc' code (cited below), we see that for 'type' of
> 'case INTEGER_TYPE' etc. -- which 'type' of 'case REFERENCE_TYPE' does
> "fall through" into -- we do not handle 'arg' of 'REAL_CST' like we do
> for 'type' of 'case REAL_TYPE'.
> 
> Now, as this code has been like that "forever", I have difficulties to
> imagine that this may be a bug.  Is this wrong usage of
> 'fold_convert_loc'?  (What does it mean to convert a 'real_cst' into a
> 'reference_type' of 'real_type'?)  (... translating to: something is
> going wrong elsewhere, in OpenACC 'reductions' handling?)

This is definitely not a bug in fold_convert, but in whatever is calling it,
converting something floating to a REFERENCE_TYPE doesn't make any sense.
One usually wants to convert some pointer to reference or another reference
to reference; and as one can't take address of real_cst, one probably
somewhere should have forced the constant into a variable so that its
address could be converted to the reference.

        Jakub

Reply via email to