bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] gawk 4.1.4 is not 100% ANSI


From: REIX, Tony
Subject: Re: [bug-gawk] gawk 4.1.4 is not 100% ANSI
Date: Wed, 26 Oct 2016 08:50:04 +0000

Hi Arnold,

It is all of this:

        -qalias=ansi  -O0	works
	-qalias=ansi  -O2	does not work

	 -qalias=noansi  -O0	works
	 -qalias=noansi  -O2	works

The IBM XLC compiler is able to apply deeper optimizations when the code is full ASCII. Thus, the issue appears only with -qalias=ansi -O2 .

I do not know what ANSI exactly means for the IBM XLC compiler. However, I guess that they rely on standards.

And, for sure, it could rather be a compiler bug. However, I've seen, testing with versions 4.1.1, 4.1.2, and 4.1.3 that the number of cores when running the tests was growing.

My idea when warning you is that the changes that you have applied may have an impact to the performance or reliability of awk in other environments. Maybe that GCC does not do such optimizations, or that it is able to see that the code is not ANSI and does not apply the optimization. Maybe.

My team is porting hundreds of OpenSource packages on AIX (about 740 MB of .tar.gz source code on one of my machines, a small sub-part of all we have ported).
gawk 4.1.* is the first package I see with this ANSI -O2 issue. That may mean that gawk code is doing something risky. The issue may appear on other environments than AIX.

Anyway, you're right, we should provide more information about what is hurting the XLC compiler. We have tried to analyze the issue, with no satisfactory result yet.
Mike, would you mind summarizing what you got about the cores ?

Meanwhile, yes, we are building gawk with the -qalias=noansi option. And it would be nice if you could add the README.aix file, explaining that this probably appeared with version 4.1.0 .

Regards,

Tony


Le 25/10/2016 à 21:02, address@hidden a écrit :
Hello.

I'm afraid your note isn't clear. It sounds like:

	-qalias=ansi  -O0	works
	-qalias=ansi  -O2	does not work

or else you meant:

	-qalias=noansi  -O0	works
	-qalias=noansi  -O2	works

Which is it?  If the former, it's a compiler bug.

If the latter, then without some guidance as to what the compiler thinks
is not ansi, I cannot help you further. I do not have access to AIX
or its compiler.

If you can use git and wish to try to figure it out using git bisect,
that would be helpful.

Or you can just live with adding -qalias=noansi when compiling gawk
and I can add a README.aix file to the distibution to document it.

Thanks,

Arnold

"REIX, Tony" <address@hidden> wrote:

I confirm the issue with gawk code being no more 100 ANSI and leading to
ANSI-optimization by the xlc compiler that generate wrong optimized code:

when compiling gawk 4.1.4 with "xlc -O0" rather than "xlc -O2", thus
with : -qalias=ansi for both -O0 and -O2, the cores do not appear.

Regards,

Tony

Le 25/10/2016 à 10:03, Tony REIX a écrit :

Tests with version 4.0.2 are OK.

I cannot compile 4.1.0 .

Cores start to appear within version 4.1.1 . However not all tests core. Only 51 tests.

So, the issue seems to have appeared with version 4.1.0 or 4.1.1 .

Regards,

Tony

Le 25/10/2016 à 09:46, Tony REIX a écrit :

Hi,

We compile gawk on AIX, with the IBM xlc compiler, with -O2.
Something like:

DEPDIR=.deps depmode=aix /opt/freeware/bin/bash ./depcomp \
/usr/vac/bin/xlc_r -DDEFPATH='".:/opt/freeware/share/awk"' -DHAVE_CONFIG_H -DGAWK \
   -DLOCALEDIR='"/opt/freeware/share/locale"' -I.   -I/opt/freeware/include \
   -O2  -D_LARGE_FILES -D_XOPEN_SOURCE_EXTENDED=1 -DGAWK_AIX=1 -c array.c


With version 4.0.0, all tests but 4 are OK.

With version 4.1.4, all tests fail due to a core dump.


By default, the /usr/vac/bin/xlc compiler makes use of: -qalias=ansi .
That means that the compiler expects the code to be 100% ANSI, and thus it does optimizations that rely on this.

When adding: -qalias=noansi to the xlc command, all tests but 6 do succeed.


So, it seems to us that the changes from version 4.0.0 to 4.1.4 has added some not-ANSI code, preventing optimizations to be used.


Regards,

Tony


.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]