Bug#837041: clang fails to compile atomics correctly
Daniel Black
daniel.black at au1.ibm.com
Thu Sep 8 05:05:52 UTC 2016
Package: clang
Version: 1:3.5-25
Severity: normal
Dear Maintainer,
Compiling postgresql on clang fails its self test
http://www.pgbuildfarm.org/cgi-bin/show_stage_log.pl?nm=devario&dt=2016-09-08%2002%3A45%3A38&stg=check
Using the extracted files I'm able to generates this
$ clang -Wl,-undefined,ignore-all -o ~/main_regress -I `pwd` ~/main_regress.c /build/main_regress.c:7:20: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
fprintf(stderr, fmt);
^~~
/build/main_regress.c:18:27: warning: more '%' conversions than data arguments [-Wformat]
fprintf(stderr, "Cond: %s, type: %s");
~^
2 warnings generated.
$ ./main^C
$ ~/main_regress
flag: unexpectedly setAborted (core dumped)
$ gcc -Wl,-undefined,ignore-all -o ~/main_regress_gcc -I `pwd` ~/main_regress.c
$ ~/main_regress_gcc
$ objdump -D ~/main_regress
0000000010000ab4 <pg_atomic_unlocked_test_flag>:
10000ab4: 02 10 40 3c lis r2,4098
10000ab8: 58 93 42 38 addi r2,r2,-27816
10000abc: a6 02 08 7c mflr r0
10000ac0: f8 ff e1 fb std r31,-8(r1)
10000ac4: 10 00 01 f8 std r0,16(r1)
10000ac8: 91 ff 21 f8 stdu r1,-112(r1)
10000acc: 78 0b 3f 7c mr r31,r1
10000ad0: 60 00 7f f8 std r3,96(r31)
10000ad4: 60 00 7f e8 ld r3,96(r31)
10000ad8: 00 00 63 38 addi r3,r3,0
10000adc: 60 00 9f e8 ld r4,96(r31)
10000ae0: 00 20 23 7c cmpd r3,r4
10000ae4: 2c 00 82 41 beq 10000b10 <pg_atomic_unlocked_test_flag+0x5c>
10000ae8: fe ff 62 3c addis r3,r2,-2
10000aec: dc 7c 63 38 addi r3,r3,31964
10000af0: fe ff 82 3c addis r4,r2,-2
10000af4: 50 7d 84 38 addi r4,r4,32080
10000af8: fe ff a2 3c addis r5,r2,-2
10000afc: 61 7d a5 38 addi r5,r5,32097
10000b00: f8 00 c0 38 li r6,248
10000b04: b4 07 c6 7c extsw r6,r6
10000b08: 25 fc ff 4b bl 1000072c <ExceptionalCondition+0x8>
10000b0c: 00 00 00 60 nop
10000b10: 04 00 00 48 b 10000b14 <pg_atomic_unlocked_test_flag+0x60>
10000b14: 60 00 7f e8 ld r3,96(r31)
10000b18: 59 02 00 48 bl 10000d70 <pg_atomic_unlocked_test_flag_impl>
10000b1c: 00 00 00 60 nop
10000b20: 20 06 63 78 clrldi r3,r3,56
10000b24: 70 00 21 38 addi r1,r1,112
10000b28: 10 00 01 e8 ld r0,16(r1)
10000b2c: f8 ff e1 eb ld r31,-8(r1)
10000b30: a6 03 08 7c mtlr r0
10000b34: 20 00 80 4e blr
0000000010000c60 <pg_atomic_clear_flag_impl>:
10000c60: f0 ff 61 f8 std r3,-16(r1)
10000c64: 00 00 80 38 li r4,0
10000c68: ac 04 00 7c sync
10000c6c: f8 1e 65 54 rlwinm r5,r3,3,27,28
10000c70: 18 00 a5 68 xori r5,r5,24
10000c74: 64 07 63 78 rldicr r3,r3,0,61
10000c78: 30 28 86 7c slw r6,r4,r5
10000c7c: ff 00 e0 38 li r7,255
10000c80: 30 28 e7 7c slw r7,r7,r5
10000c84: e8 ff a1 f8 std r5,-24(r1)
10000c88: e0 ff 61 f8 std r3,-32(r1)
10000c8c: d8 ff c1 f8 std r6,-40(r1)
10000c90: d0 ff e1 f8 std r7,-48(r1)
10000c94: e0 ff 61 e8 ld r3,-32(r1)
10000c98: 28 18 80 7c lwarx r4,0,r3
10000c9c: d0 ff a1 e8 ld r5,-48(r1)
10000ca0: 78 28 86 7c andc r6,r4,r5
10000ca4: d8 ff e1 e8 ld r7,-40(r1)
10000ca8: 38 28 e8 7c and r8,r7,r5
10000cac: 78 33 06 7d or r6,r8,r6
10000cb0: 2d 19 c0 7c stwcx. r6,0,r3
10000cb4: c8 ff 81 f8 std r4,-56(r1)
10000cb8: dc ff 82 40 bne 10000c94 <pg_atomic_clear_flag_impl+0x34>
10000cbc: c8 ff 61 e8 ld r3,-56(r1)
10000cc0: e8 ff 81 e8 ld r4,-24(r1)
10000cc4: 30 24 65 7c srw r5,r3,r4
10000cc8: c4 ff a1 90 stw r5,-60(r1)
10000ccc: 20 00 80 4e blr
0000000010000d9c <pg_atomic_init_flag_impl>:
10000d9c: 02 10 40 3c lis r2,4098
10000da0: 58 93 42 38 addi r2,r2,-27816
10000da4: a6 02 08 7c mflr r0
10000da8: f8 ff e1 fb std r31,-8(r1)
10000dac: 10 00 01 f8 std r0,16(r1)
10000db0: 91 ff 21 f8 stdu r1,-112(r1)
10000db4: 78 0b 3f 7c mr r31,r1
10000db8: 60 00 7f f8 std r3,96(r31)
10000dbc: 60 00 7f e8 ld r3,96(r31)
10000dc0: a1 fe ff 4b bl 10000c60 <pg_atomic_clear_flag_impl>
10000dc4: 00 00 00 60 nop
10000dc8: 70 00 21 38 addi r1,r1,112
10000dcc: 10 00 01 e8 ld r0,16(r1)
10000dd0: f8 ff e1 eb ld r31,-8(r1)
10000dd4: a6 03 08 7c mtlr r0
10000dd8: 20 00 80 4e blr
gcc:
00000000100006a0 <pg_atomic_unlocked_test_flag_impl>:
100006a0: f8 ff e1 fb std r31,-8(r1)
100006a4: c1 ff 21 f8 stdu r1,-64(r1)
100006a8: 78 0b 3f 7c mr r31,r1
100006ac: 20 00 7f f8 std r3,32(r31)
100006b0: 20 00 3f e9 ld r9,32(r31)
100006b4: 00 00 29 89 lbz r9,0(r9)
100006b8: 20 06 29 79 clrldi r9,r9,56
100006bc: 00 00 89 2f cmpwi cr7,r9,0
100006c0: 26 10 30 7d mfocrf r9,1
100006c4: fe ff 29 55 rlwinm r9,r9,31,31,31
100006c8: 20 06 29 79 clrldi r9,r9,56
100006cc: 78 4b 23 7d mr r3,r9
100006d0: 40 00 3f 38 addi r1,r31,64
100006d4: f8 ff e1 eb ld r31,-8(r1)
100006d8: 20 00 80 4e blr
...
00000000100006e8 <pg_atomic_clear_flag_impl>:
100006e8: f8 ff e1 fb std r31,-8(r1)
100006ec: c1 ff 21 f8 stdu r1,-64(r1)
100006f0: 78 0b 3f 7c mr r31,r1
100006f4: 20 00 7f f8 std r3,32(r31)
100006f8: 20 00 3f e9 ld r9,32(r31)
100006fc: 00 00 40 39 li r10,0
10000700: ac 04 20 7c lwsync
10000704: 00 00 49 99 stb r10,0(r9)
10000708: 40 00 3f 38 addi r1,r31,64
1000070c: f8 ff e1 eb ld r31,-8(r1)
10000710: 20 00 80 4e blr
0000000010000720 <pg_atomic_init_flag_impl>:
10000720: 02 10 40 3c lis r2,4098
10000724: 20 c2 42 38 addi r2,r2,-15840
10000728: a6 02 08 7c mflr r0
1000072c: 10 00 01 f8 std r0,16(r1)
10000730: f8 ff e1 fb std r31,-8(r1)
10000734: c1 ff 21 f8 stdu r1,-64(r1)
10000738: 78 0b 3f 7c mr r31,r1
1000073c: 20 00 7f f8 std r3,32(r31)
10000740: 20 00 7f e8 ld r3,32(r31)
10000744: a5 ff ff 4b bl 100006e8 <pg_atomic_clear_flag_impl>
10000748: 40 00 3f 38 addi r1,r31,64
1000074c: 10 00 01 e8 ld r0,16(r1)
10000750: a6 03 08 7c mtlr r0
10000754: f8 ff e1 eb ld r31,-8(r1)
10000758: 20 00 80 4e blr
-- System Information:
Debian Release: 8.5
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: ppc64el (ppc64le)
Kernel: Linux 4.4.0-31-generic (SMP w/48 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect
Versions of packages clang depends on:
ii clang-3.5 1:3.5-10
clang recommends no packages.
clang suggests no packages.
-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: regress_cpp.c
Type: text/x-c
Size: 567414 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-llvm-team/attachments/20160908/c366d709/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main_regress.c
Type: text/x-c
Size: 416 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-llvm-team/attachments/20160908/c366d709/attachment-0003.bin>
More information about the Pkg-llvm-team
mailing list