This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[gfortran,patch] Fix handling of optional args to MIN and MAX intrinsics
- From: FX Coudert <fxcoudert at gmail dot com>
- To: "fortran at gcc dot gnu dot org List" <fortran at gcc dot gnu dot org>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 4 Jul 2007 02:41:04 +0200
- Subject: [gfortran,patch] Fix handling of optional args to MIN and MAX intrinsics
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:to:message-id:content-type:from:subject:date:x-mailer; b=eGm0PaG+S2u9nmxPzGPtOdOLUPb5NTAVwpjGHTKTHsuvN3Z2oJheBJS9pXWI7pFXlNUT4P1VgxjOzrAT3I0kd96D3gd9ypuWl8nlhyPfrrtv0N+Ol7DQz2ZQj/JTqff0LuJkpyJrDmHqALCdnuq31+EVHpVbzfAJIkgrDu1IQ5o=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:to:message-id:content-type:from:subject:date:x-mailer; b=Jla/WDkOnkc0qPMGLscmbOh4OotoskOrCWavvPVBuSsSFtqWPhb3k22+el7JEST4gscpDc30R7iTRxtsm8EaLPOgIybZAuQ1wnwxr8Lv06+0pfWPtKHtoWRm7czT5jdrY/L1FzF55wZq9ZzRqqM+7f+F5yTwj/9a9/iaED8o/gc=
Attached patch fixes the handling of optional arguments to the MIN
and MAX intrinsics : their first two arguments are mandatory, and all
following ones are optional. The devil is in the details, and the
details are in the PR and the link to the comp.lang.fortran thread
about this.
What this patch does is: 1. check that the first two arguments are
provided ; 2. for each following arg, if it is an optional arg, only
use it for comparison if it is actually present. I've have the patch
for some time, but it built on top of Lee's trans-intrinsic.c patch,
and since we have no fresh news I decided it was time to commit it
nonetheless (thanks Joost for the friendly reminder!).
Regtested on x86_64-linux, OK for mainline ?
FX
:ADDPATCH fortran:
Attachment:
minmax_optional.ChangeLog
Description: Binary data
Attachment:
minmax_optional.diff
Description: Binary data