On 2/1/26 12:44 PM, Harald Anlauf wrote:
Hi Jerry,
thanks for your draft patch!
I don't mind implementing it step by step, but it does not
work here as I think it should (based on two other compilers).
Let's look at the testcases first:
- real(10) should be restricted to platforms where this is
available; it will be rejected on several others
I found one compiler that did not support real(10) even though the hardware has
it and it did support real(16). Some don't do either. I am certain we need to
set target in the test cases
- EXformat_1.f90
r4 = -huge(1.0_4/3.0_4)
this is identical to
r4 = -huge(1.0_4)
Yes, I will tweak that.
and should print as:
-0XF.FFFFFP+124
and not
-0X1.P+127
hmm, I Added an = sign in a conditional looking at something else and forgot
to take it back out.
/* Handle the 'd' parameter - adjust mantissa precision if specified */
if (d > 0) <---------- I had >=, my bad.
{
This gives:
123456789012345678901234567890
-0X1.FFFFFEP+127<
-0X1.FFFFFFFFFFFFFP+1023<
-0XF.FFFFFFFFFFFFFFFP+16380<
Notice how this implementation normalizes differently then others.
etc.
Similarly for EXformat_2.f90, the first write should be
> -0X9.D14707B63DFBP+3<
and not
> -0X1.P+6<
Likwise, thanks for seeing these.
I would also recommend to extend the string length s1 so that
other brands do not complain about it being to short:
character(kind=1, len=16) :: s1
Easy to do.
I also get a warning at compilation of io.cc:
../../gcc-trunk/gcc/fortran/io.cc: In function 'format_token format_lex()':
../../gcc-trunk/gcc/fortran/io.cc:449:11: warning: this statement may fall
through [-Wimplicit-fallthrough=]
449 | switch (c)
| ^~~~~~
../../gcc-trunk/gcc/fortran/io.cc:464:9: note: here
464 | case 'Z':
| ^~~~
Can you check the logic?
Yes, I did not see it fly by, but will check.
I stopped the review here.
Finally a few general comments: please try to stick to the
80 columns/line recommendation for commit messages as well
as for code.
Agree, I can adjust.
Best,
Harald
--- snip ---
Thanks for the review. I will fix these and resubmit.
Jerry