This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: xlc: add -qalias=noansi -qmaxmem=-1
Type: behavior Stage: resolved
Components: Build Versions: Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: David.Edelsohn, miss-islington, skrah
Priority: normal Keywords: patch

Created on 2020-09-04 20:00 by skrah, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 22096 merged skrah, 2020-09-04 20:02
PR 22097 merged miss-islington, 2020-09-04 20:33
Messages (6)
msg376396 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2020-09-04 20:06
At least the xlc version on AIX 7.1 has aggressive optimizations even
with -O:

==================================================================== 
#include <stdio.h>
#include <stdlib.h>


static int
f(long *a, long long *b)
{
     int t = *a;
     *b = 0;          // cannot change *a
     return *a - t;   // can be folded to zero
}

int
main(void)
{
    long a = 10;

    printf("%d\n", f(&a, (long long *)&a));

    return 0;
}
====================================================================



$ xlc -O -o alias alias.c
$ ./alias
0
$ 
$ xlc -O -qalias=noansi -o alias alias.c
$ ./alias
-10
msg376397 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2020-09-04 20:12
We would also need -fwrapv to be safe, but I cannot find an equivalent
option for xlc.

The Intel compiler had a similar failure to #40244 that was resolved
by -fwrapv (see #40223).
msg376398 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2020-09-04 20:17
-qmaxmem=-1 is added to disable verbose remarks.
msg376399 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2020-09-04 20:33
New changeset 84a7917b4c9afec07575065cffa143b91fe98c14 by Stefan Krah in branch 'master':
bpo-41721: Add xlc options (GH-22096)
https://github.com/python/cpython/commit/84a7917b4c9afec07575065cffa143b91fe98c14
msg376402 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2020-09-04 20:45
The code example is for 64-bit Linux with sizeof(long) == sizeof(long long).

It also works on 32-bit xlc with int/long.
msg376404 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2020-09-04 21:03
New changeset fb050d0d60f38dc9b6c30df1864020a92981be5b by Miss Islington (bot) in branch '3.9':
bpo-41721: Add xlc options (GH-22097)
https://github.com/python/cpython/commit/fb050d0d60f38dc9b6c30df1864020a92981be5b
History
Date User Action Args
2022-04-11 14:59:35adminsetgithub: 85887
2020-09-05 08:07:49skrahsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-09-04 21:03:05skrahsetmessages: + msg376404
2020-09-04 20:45:40skrahsetmessages: + msg376402
2020-09-04 20:33:48miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request21184
2020-09-04 20:33:24skrahsetmessages: + msg376399
2020-09-04 20:17:08skrahsetmessages: + msg376398
2020-09-04 20:12:07skrahsetmessages: + msg376397
2020-09-04 20:06:51skrahsettype: behavior
messages: + msg376396
components: + Build
versions: + Python 3.9, Python 3.10
2020-09-04 20:02:10skrahsetkeywords: + patch
stage: patch review
pull_requests: + pull_request21183
2020-09-04 20:00:05skrahcreate