On 1/31/25 11:30 AM, Harald Anlauf wrote:
Hi Jerry,
Am 30.01.25 um 21:50 schrieb Jerry D:
On 1/29/25 10:30 AM, Jerry D wrote:
Follow-up:
On 1/28/25 1:33 PM, Harald Anlauf wrote:
Jerry,
while I haven't read your actual patch yet, I think the testcase
is slightly incorrect. In fact, Intel, NAG, Nvidia and AMD flang
disagree with it.
--- snip ---
The following adjustment to the patch puts this right.
case FMT_X:
case FMT_TR:
consume_data_flag = 0;
dtp->u.p.skips += f->u.n;
tab_pos = bytes_used + dtp->u.p.skips - 1;
dtp->u.p.pending_spaces = tab_pos - dtp->u.p.max_pos + 1;
dtp->u.p.pending_spaces = dtp->u.p.pending_spaces < 0
? f->u.n : dtp->u.p.pending_spaces;
//if (t == FMT_X && tab_pos < dtp->u.p.max_pos)
//{
//write_x (dtp, dtp->u.p.skips, dtp->u.p.pending_spaces);
//dtp->u.p.skips = dtp->u.p.pending_spaces = 0;
//}
Interestingly, it also fixes a floating point exception I ran into
while setting up another test case for part 2 of this effort. I
suspect this may be what was detected by the auto patch tester.
I will clean this up, adjust the test case for this part and re-submit.
Regards,
Jerry
Here is version 2 of the patch cleaned up and with the test case revised
accordingly.
Thank you Herald for helping with my blindness.
Regressions tested on x86_64. I will wait a bit to see if the auto patch
tester reports anything.
Otherwise, OK for trunk?
this looks mostly good. There is only one (minor?) issue I saw:
writing output to a file, there is a discrepancy between stream-
and non-stream I/O. Adding
write (*, fmt1) 'RADIX', radix(pi)
write (*, fmt2) 'RADIX', radix(pi)
open (10, form="formatted")
write(10, fmt1) 'RADIX', radix(pi)
write(10, fmt2) 'RADIX', radix(pi)
close(10)
open (11, form="formatted", access="stream")
write(11, fmt1) 'RADIX', radix(pi)
write(11, fmt2) 'RADIX', radix(pi)
close(11)
shows agreement between stdout and fort.10, while fort.11 differs:
% head fort.10 fort.11
==> fort.10 <==
RADIX.............. 2
RADIX ............. 2
==> fort.11 <==
RADIX 2............
RADIX 2...........
Other brands do not show this discrepancy.
Regards,
Jerry
PS working on part 2 still.
Are you addressing this in the second part of your work?
As the test program crashes with current HEAD and earlier
anyway, your patch is already progress, but we don't want
to leave it that way.
So either commit the current version and track this issue in
a PR if not yet done, or have a look if there is a quick fix.
Thanks for the work!
Harald
After studying this a bit more I will commit the subject patch. I have
opened a new PR to track this.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118774
Regards,
Jerry