public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: James Greenhalgh <james.greenhalgh@arm.com>
To: Christophe Lyon <christophe.lyon@linaro.org>
Cc: Thomas Koenig <tkoenig@netcologne.de>,
	"fortran@gcc.gnu.org"	<fortran@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>, <nd@arm.com>
Subject: Re: [patch, fortran] Implement maxval for characters
Date: Mon, 11 Dec 2017 13:54:00 -0000	[thread overview]
Message-ID: <20171211135400.GA2427@arm.com> (raw)
In-Reply-To: <CAKdteOb-e=AMTzUzU3nJaB7rm03nEkOhhufFPiRkVEVkiaWPRA@mail.gmail.com>

On Wed, Dec 06, 2017 at 11:38:21AM +0000, Christophe Lyon wrote:
> Hi,
> 
> 
> On 28 November 2017 at 19:40, Thomas Koenig <tkoenig@netcologne.de> wrote:
> > Hello world,
> >
> > the attached patch implements maxval for characters, an F2003 feature
> > that we were missing up to now.
> >
> > Regression-tested on x86_64-pc-linux-gnu.
> >
> > OK for trunk?
> >
> > Regards
> >
> >         Thomas
> >
> > 2017-11-28  Thomas Koenig  <tkoenig@gcc.gnu.org>
> >
> >         PR fortran/36313
> >         * check.c (gfc_check_minval_maxval): Use
> >         int_orLreal_or_char_check_f2003 for array argument.
> >         * iresolve.c (gfc_resolve_maxval): Insert number in
> >         function name for character arguments.
> >         (gfc_resolve_minval): Likewise.
> >         * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc):
> >         Fix comment.
> >         (gfc_conv_intrinsic_minmaxval): Resort arguments and call library
> >         function if dealing with a character function.
> >
> > 2017-11-28  Thomas Koenig  <tkoenig@gcc.gnu.org>
> >
> >         PR fortran/36313
> >         * Makefile.am: Add new files for character-valued
> >         maxval and minval.
> >         * Makefile.in: Regenerated.
> >         * gfortran.map: Add new functions.
> >         * m4/iforeach-s2.m4: New file.
> >         * m4/ifunction-s2.m4: New file.
> >         * m4/iparm.m4: Add intitval for minval and maxval.
> >         * m4/maxval0s.m4: New file.
> >         * m4/maxval1s.m4: New file.
> >         * m4/minval0s.m4: New file.
> >         * m4/minval1s.m4: New file.
> >         * generated/maxval0_s1.c: New file.
> >         * generated/maxval0_s4.c: New file.
> >         * generated/maxval1_s1.c: New file.
> >         * generated/maxval1_s4.c: New file.
> >         * generated/minval0_s1.c: New file.
> >         * generated/minval0_s4.c: New file.
> >         * generated/minval1_s1.c: New file.
> >         * generated/minval1_s4.c: New file.
> >
> > 2017-11-28  Thomas Koenig  <tkoenig@gcc.gnu.org>
> >
> >         PR fortran/36313
> >         * gfortran.dg/maxval_char_1.f90: New test.
> >         * gfortran.dg/maxval_char_2.f90: New test.
> >         * gfortran.dg/maxval_char_3.f90: New test.
> >         * gfortran.dg/maxval_char_4.f90: New test.
> >         * gfortran.dg/minval_char_1.f90: New test.
> >         * gfortran.dg/minval_char_2.f90: New test.
> >         * gfortran.dg/minval_char_3.f90: New test.
> >         * gfortran.dg/minval_char_4.f90: New test.
> 
> Hi,
> In my testing I'm seeing random results with at least some of these new tests
> (maxval_char_1, maxval_char_2, minval_char_2 at least).
> I'm cross-testing on arm targets using qemu.
> 
> Sorry, I don't really read fortran, so a first obvious question: is
> there anything
> undefined/random/race condition in these tests?
> My logs only show that the program aborted, so it doesn't seem the process
> was killed by a timeout or similar.

I'm also seeing these tests fail sporadically on x86_64-none-linux-gnu and
aarch64-none-linux-gnu.

I also struggle with reading fortran, one abort which triggers for me in
maxval_char_1.f90 is

  if (res /= maxval(b, mask)) call abort

I think we're getting in to trouble when the mask comes out as all False,
that seems to give a different behaviour between this call:

  write (unit=res,fmt='(I5.5)') maxval(v,mask)

After which res = "*****"

And this call:

  maxval(b, mask)

Which returns the empty string. Thus, res != maxval(b, mask) and we fail the
test.

I presume something similar is happening in the other tests from this patch.

Thanks,
James

  reply	other threads:[~2017-12-11 13:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-28 18:54 Thomas Koenig
2017-12-03  9:48 ` Ping**(5./7.) " Thomas Koenig
2017-12-03 19:59   ` Jerry DeLisle
2017-12-03 20:43     ` Thomas Koenig
2017-12-06 11:38 ` Christophe Lyon
2017-12-11 13:54   ` James Greenhalgh [this message]
2017-12-11 17:35     ` Thomas Koenig
2017-12-11 17:58       ` Thomas Koenig
2017-12-13 10:08         ` Christophe Lyon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171211135400.GA2427@arm.com \
    --to=james.greenhalgh@arm.com \
    --cc=christophe.lyon@linaro.org \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nd@arm.com \
    --cc=tkoenig@netcologne.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).