public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
@ 2015-03-09 23:14 doko at gcc dot gnu.org
  2015-03-09 23:24 ` [Bug target/65369] " pinskia at gcc dot gnu.org
                   ` (38 more replies)
  0 siblings, 39 replies; 40+ messages in thread
From: doko at gcc dot gnu.org @ 2015-03-09 23:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

            Bug ID: 65369
           Summary: [5 Regression] nettle test failure on
                    powerpc64le-linux-gnu when built with -O3
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: doko at gcc dot gnu.org

seen with trunk r221254, works with -O3 on the 4.9 branch, the following test
fails with -O3 on the trunk:

hash input address: 0x100253b0451
Got:

dd4111dd66913ae2 f39adfbc438214d6

Expected:

e33b4ddc9c38f219 9c3e7b164fcc0536
Aborted (core dumped)
FAIL: md4

it's enough to build the md4.c file with -O2.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
@ 2015-03-09 23:24 ` pinskia at gcc dot gnu.org
  2015-03-10  9:00 ` rguenth at gcc dot gnu.org
                   ` (37 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-03-09 23:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
>it's enough to build the md4.c file with -O2.

I know there is an endian test in md4.c file to speed up md4.  Maybe the wrong
one is being selected.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
  2015-03-09 23:24 ` [Bug target/65369] " pinskia at gcc dot gnu.org
@ 2015-03-10  9:00 ` rguenth at gcc dot gnu.org
  2015-03-10 15:01 ` law at redhat dot com
                   ` (36 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-10  9:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2015-03-10
   Target Milestone|---                         |5.0
     Ever confirmed|0                           |1

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Waiting for a testcase.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
  2015-03-09 23:24 ` [Bug target/65369] " pinskia at gcc dot gnu.org
  2015-03-10  9:00 ` rguenth at gcc dot gnu.org
@ 2015-03-10 15:01 ` law at redhat dot com
  2015-03-10 21:56 ` msebor at gcc dot gnu.org
                   ` (35 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: law at redhat dot com @ 2015-03-10 15:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

Jeffrey A. Law <law at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at redhat dot com,
                   |                            |msebor at gcc dot gnu.org

--- Comment #3 from Jeffrey A. Law <law at redhat dot com> ---
Martin, perhaps you could see if you could reproduce this...


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-03-10 15:01 ` law at redhat dot com
@ 2015-03-10 21:56 ` msebor at gcc dot gnu.org
  2015-03-11  4:04 ` msebor at gcc dot gnu.org
                   ` (34 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: msebor at gcc dot gnu.org @ 2015-03-10 21:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
I've downloaded nettle-3.0 from http://ftp.gnu.org/gnu/nettle, built it with
the default options (-O2) with last week's trunk (5.0.0 20150303) and the
system GCC 4.8.3 on a ppc64le box running RHEL 7.1, and ran the test suite. 
There are the following two failures in both.  I'll look into the camellia test
failure next.

...
Encrypt failed:
Input:
0123456789abcdef fedcba9876543210

Output: 
df51fc645013f77c 25c472e2871f742a

Expected:
6767313854966973 0857065648eabe43

/src/nettle-3.0/run-tests: line 57: 46381 Aborted                 "$1"
$testflags
FAIL: camellia
...
Assert failed: /src/nettle-3.0/testsuite/testutils.c:513: MEMEQ(digest->length,
buffer, digest->data)
/src/nettle-3.0/run-tests: line 57: 49811 Aborted                 "$1"
$testflags
FAIL: gcm
...
====================
2 of 55 tests failed
====================


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-03-10 21:56 ` msebor at gcc dot gnu.org
@ 2015-03-11  4:04 ` msebor at gcc dot gnu.org
  2015-03-11  4:10 ` doko at gcc dot gnu.org
                   ` (33 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: msebor at gcc dot gnu.org @ 2015-03-11  4:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
While I haven't isolated it yet I suspect a bug in nettle and not one in gcc,
for at least three reasons:

First, the failures are insensitive to optimization levels.  Second, the same
two failures also appear on ppc64-redhat-linux with the system compiler (gcc
4.8.3).  Finally, the same failures also appear when I use clang 3.6.0 to
compile everything rather than gcc.

The test results on x86_64 running Fedora 21 are clean but that's most likely
because there nettle uses a different implementation of the encryption function
(defined in the generated camellia-crypt-internal.s based on the handcoded
assembly in x86_64/camellia-crypt-internal.asm).


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2015-03-11  4:04 ` msebor at gcc dot gnu.org
@ 2015-03-11  4:10 ` doko at gcc dot gnu.org
  2015-03-11 21:36 ` msebor at gcc dot gnu.org
                   ` (32 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: doko at gcc dot gnu.org @ 2015-03-11  4:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #6 from Matthias Klose <doko at gcc dot gnu.org> ---
I see this with -O3, not -O3. working to get a reduced test case.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2015-03-11  4:10 ` doko at gcc dot gnu.org
@ 2015-03-11 21:36 ` msebor at gcc dot gnu.org
  2015-03-12  2:50 ` msebor at gcc dot gnu.org
                   ` (31 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: msebor at gcc dot gnu.org @ 2015-03-11 21:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #7 from Martin Sebor <msebor at gcc dot gnu.org> ---
The cause of the failing tests observed on RHEL 7.1 is in the second definition
of nettle's HAVE_NATIVE_64_BIT configuration macro: 

$ grep HAVE_NATIVE_64_BIT config.*
config.h:# define HAVE_NATIVE_64_BIT 1
config.h:# define HAVE_NATIVE_64_BIT (SIZEOF_LONG * CHAR_BIT >= 64)

The macro relies on CHAR_BIT. Uses of HAVE_NATIVE_64_BIT of the form

  #if !HAVE_NATIVE_64_BIT

in files that don't include <limits.h> that defined CHAR_BIT end up compiling
the conditional blocks that are intended to be included only when the target
has no native support for 64 bit arithmetic.  One such file that comes into
play in the failing tests is camellia-absorb.c.  Since ppc64le obviously does
have such support, the code is unnecessary and, as it turns out, introduces
errors.

Once <limits.h> is included (I simply added the include directive to macros.h),
all of nettle's tests pass even on ppc64le-redhat-linux with the default -O2.

However, after rebuilding at -O3 I see the following failure:

hash input address: 0x10007410471
Got:

dd4111dd66913ae2 f39adfbc438214d6

Expected:

e33b4ddc9c38f219 9c3e7b164fcc0536
/src/nettle-3.0/run-tests: line 57: 57170 Aborted                 "$1"
$testflags
FAIL: md4

The failure disappears and is replaced by the errors below if I rebuild
everything with -fsanitize=address -fsanitize=bounds -fsanitize=undefined:

...
/src/nettle-3.0/blowfish.c:363:19: runtime error: left shift of 244 by 24
places cannot be represented in type 'int'
PASS: blowfish
...
/src/nettle-3.0/des.c:176:42: runtime error: index 42 out of bounds for type
'int8_t [26][4]'
PASS: des
/src/nettle-3.0/des.c:176:42: runtime error: index 52 out of bounds for type
'int8_t [26][4]'
PASS: des3
/src/nettle-3.0/des.c:176:42: runtime error: index 35 out of bounds for type
'int8_t [26][4]'
PASS: des-compat
...
/src/nettle-3.0/twofish.c:200:54: runtime error: left shift of 184 by 24 places
cannot be represented in type 'int'
PASS: twofish


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2015-03-11 21:36 ` msebor at gcc dot gnu.org
@ 2015-03-12  2:50 ` msebor at gcc dot gnu.org
  2015-03-12 11:11 ` thopre01 at gcc dot gnu.org
                   ` (30 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: msebor at gcc dot gnu.org @ 2015-03-12  2:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #8 from Martin Sebor <msebor at gcc dot gnu.org> ---
Created attachment 35016
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35016&action=edit
Test case for nettle md4 test failure.

The attached test case reduced from Nettle 3.0 test 7 in testsuite/md4-test.c
reproduces the suspected gcc 5.0 incorrect code generation on ppc64le.  Compile
with -O3 and run and observe a SIGABRT.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2015-03-12 11:11 ` thopre01 at gcc dot gnu.org
@ 2015-03-12 11:11 ` thopre01 at gcc dot gnu.org
  2015-03-12 13:54 ` amodra at gmail dot com
                   ` (25 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: thopre01 at gcc dot gnu.org @ 2015-03-12 11:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #12 from Thomas Preud'homme <thopre01 at gcc dot gnu.org> ---
(In reply to Markus Trippelsdorf from comment #11)
>    0x0000000010000a00 <+1024>:  bl      0x100005b0 <_init+112>
>    0x0000000010000a04 <+1028>:  ld      r2,24(r1)
>    0x0000000010000a08 <+1032>:  lwz     r9,224(r1)
>    0x0000000010000a0c <+1036>:  addi    r3,r1,200
>    0x0000000010000a10 <+1040>:  addi    r4,r1,380
>    0x0000000010000a14 <+1044>:  stw     r9,380(r1)
>    0x0000000010000a18 <+1048>:  lwz     r9,228(r1)
>    0x0000000010000a1c <+1052>:  stw     r9,384(r1)
>    0x0000000010000a20 <+1056>:  lwz     r9,232(r1)
>    0x0000000010000a24 <+1060>:  stw     r9,388(r1)
>    0x0000000010000a28 <+1064>:  lwz     r9,236(r1)
>    0x0000000010000a2c <+1068>:  stw     r9,392(r1)
>    0x0000000010000a30 <+1072>:  lwz     r9,240(r1)
>    0x0000000010000a34 <+1076>:  stw     r9,396(r1)
>    0x0000000010000a38 <+1080>:  lwz     r9,244(r1)
>    0x0000000010000a3c <+1084>:  stw     r9,400(r1)
>    0x0000000010000a40 <+1088>:  lwz     r9,248(r1)
>    0x0000000010000a44 <+1092>:  stw     r9,404(r1)
>    0x0000000010000a48 <+1096>:  lwz     r9,252(r1)
>    0x0000000010000a4c <+1100>:  stw     r9,408(r1)
>    0x0000000010000a50 <+1104>:  lwz     r9,256(r1)
>    0x0000000010000a54 <+1108>:  stw     r9,412(r1)
>    0x0000000010000a58 <+1112>:  lwz     r9,260(r1)
>    0x0000000010000a5c <+1116>:  stw     r9,416(r1)
>    0x0000000010000a60 <+1120>:  lwz     r9,264(r1)
>    0x0000000010000a64 <+1124>:  stw     r9,420(r1)
>    0x0000000010000a68 <+1128>:  lwz     r9,268(r1)
>    0x0000000010000a6c <+1132>:  stw     r9,424(r1)
>    0x0000000010000a70 <+1136>:  lwz     r9,272(r1)
>    0x0000000010000a74 <+1140>:  stw     r9,428(r1)
>    0x0000000010000a78 <+1144>:  lwz     r9,276(r1)
>    0x0000000010000a7c <+1148>:  stw     r9,432(r1)
>    0x0000000010000a80 <+1152>:  lwz     r9,280(r1)
>    0x0000000010000a84 <+1156>:  stw     r9,436(r1)
>    0x0000000010000a88 <+1160>:  lwz     r9,284(r1)
>    0x0000000010000a8c <+1164>:  stw     r9,440(r1)
>    0x0000000010000a90 <+1168>:  bl      0x10000cb0 <md4_transform>
>    0x0000000010000a94 <+1172>:  li      r3,0
>    0x0000000010000a98 <+1176>:  b       0x10000784 <main+388>
>    0x0000000010000a9c <+1180>:  bl      0x100005e0 <_init+160>
>    0x0000000010000aa0 <+1184>:  ld      r2,24(r1)
> ---Type <return> to continue, or q <return> to quit---
>    0x0000000010000aa4 <+1188>:  cmpdi   cr7,r3,0
>    0x0000000010000aa8 <+1192>:  beq     cr7,0x10000988 <main+904>
>    0x0000000010000aac <+1196>:  li      r3,1
>    0x0000000010000ab0 <+1200>:  b       0x10000998 <main+920>
>    0x0000000010000ab4 <+1204>:  bl      0x100005f0 <_init+176>
> => 0x0000000010000ab8 <+1208>:  ld      r2,24(r1)
>    0x0000000010000abc <+1212>:  .long 0x0
>    0x0000000010000ac0 <+1216>:  .long 0x1000000
>    0x0000000010000ac4 <+1220>:  .long 0x1280

Alright, so the last 8 bytes of buffer and digest differ. I'll unwind this
tomorrow. Thanks!


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2015-03-12 11:11 ` thopre01 at gcc dot gnu.org
@ 2015-03-12 11:11 ` trippels at gcc dot gnu.org
  2015-03-12 11:11 ` trippels at gcc dot gnu.org
                   ` (28 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-03-12 11:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #11 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
   0x0000000010000a00 <+1024>:  bl      0x100005b0 <_init+112>
   0x0000000010000a04 <+1028>:  ld      r2,24(r1)
   0x0000000010000a08 <+1032>:  lwz     r9,224(r1)
   0x0000000010000a0c <+1036>:  addi    r3,r1,200
   0x0000000010000a10 <+1040>:  addi    r4,r1,380
   0x0000000010000a14 <+1044>:  stw     r9,380(r1)
   0x0000000010000a18 <+1048>:  lwz     r9,228(r1)
   0x0000000010000a1c <+1052>:  stw     r9,384(r1)
   0x0000000010000a20 <+1056>:  lwz     r9,232(r1)
   0x0000000010000a24 <+1060>:  stw     r9,388(r1)
   0x0000000010000a28 <+1064>:  lwz     r9,236(r1)
   0x0000000010000a2c <+1068>:  stw     r9,392(r1)
   0x0000000010000a30 <+1072>:  lwz     r9,240(r1)
   0x0000000010000a34 <+1076>:  stw     r9,396(r1)
   0x0000000010000a38 <+1080>:  lwz     r9,244(r1)
   0x0000000010000a3c <+1084>:  stw     r9,400(r1)
   0x0000000010000a40 <+1088>:  lwz     r9,248(r1)
   0x0000000010000a44 <+1092>:  stw     r9,404(r1)
   0x0000000010000a48 <+1096>:  lwz     r9,252(r1)
   0x0000000010000a4c <+1100>:  stw     r9,408(r1)
   0x0000000010000a50 <+1104>:  lwz     r9,256(r1)
   0x0000000010000a54 <+1108>:  stw     r9,412(r1)
   0x0000000010000a58 <+1112>:  lwz     r9,260(r1)
   0x0000000010000a5c <+1116>:  stw     r9,416(r1)
   0x0000000010000a60 <+1120>:  lwz     r9,264(r1)
   0x0000000010000a64 <+1124>:  stw     r9,420(r1)
   0x0000000010000a68 <+1128>:  lwz     r9,268(r1)
   0x0000000010000a6c <+1132>:  stw     r9,424(r1)
   0x0000000010000a70 <+1136>:  lwz     r9,272(r1)
   0x0000000010000a74 <+1140>:  stw     r9,428(r1)
   0x0000000010000a78 <+1144>:  lwz     r9,276(r1)
   0x0000000010000a7c <+1148>:  stw     r9,432(r1)
   0x0000000010000a80 <+1152>:  lwz     r9,280(r1)
   0x0000000010000a84 <+1156>:  stw     r9,436(r1)
   0x0000000010000a88 <+1160>:  lwz     r9,284(r1)
   0x0000000010000a8c <+1164>:  stw     r9,440(r1)
   0x0000000010000a90 <+1168>:  bl      0x10000cb0 <md4_transform>
   0x0000000010000a94 <+1172>:  li      r3,0
   0x0000000010000a98 <+1176>:  b       0x10000784 <main+388>
   0x0000000010000a9c <+1180>:  bl      0x100005e0 <_init+160>
   0x0000000010000aa0 <+1184>:  ld      r2,24(r1)
---Type <return> to continue, or q <return> to quit---
   0x0000000010000aa4 <+1188>:  cmpdi   cr7,r3,0
   0x0000000010000aa8 <+1192>:  beq     cr7,0x10000988 <main+904>
   0x0000000010000aac <+1196>:  li      r3,1
   0x0000000010000ab0 <+1200>:  b       0x10000998 <main+920>
   0x0000000010000ab4 <+1204>:  bl      0x100005f0 <_init+176>
=> 0x0000000010000ab8 <+1208>:  ld      r2,24(r1)
   0x0000000010000abc <+1212>:  .long 0x0
   0x0000000010000ac0 <+1216>:  .long 0x1000000
   0x0000000010000ac4 <+1220>:  .long 0x1280


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2015-03-12 11:11 ` trippels at gcc dot gnu.org
@ 2015-03-12 11:11 ` thopre01 at gcc dot gnu.org
  2015-03-12 11:11 ` thopre01 at gcc dot gnu.org
                   ` (26 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: thopre01 at gcc dot gnu.org @ 2015-03-12 11:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

Thomas Preud'homme <thopre01 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2015-03-10 00:00:00         |2015-03-12

--- Comment #10 from Thomas Preud'homme <thopre01 at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #8)
> Created attachment 35016 [details]
> Test case for nettle md4 test failure.
> 
> The attached test case reduced from Nettle 3.0 test 7 in
> testsuite/md4-test.c reproduces the suspected gcc 5.0 incorrect code
> generation on ppc64le.  Compile with -O3 and run and observe a SIGABRT.

I don't have access to such a machine right now so I would appreciate if
somebody can give me the instruction that causes the abort.

Thanks


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2015-03-12  2:50 ` msebor at gcc dot gnu.org
@ 2015-03-12 11:11 ` thopre01 at gcc dot gnu.org
  2015-03-12 11:11 ` trippels at gcc dot gnu.org
                   ` (29 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: thopre01 at gcc dot gnu.org @ 2015-03-12 11:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

Thomas Preud'homme <thopre01 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |thopre01 at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |thopre01 at gcc dot gnu.org


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2015-03-12 11:11 ` trippels at gcc dot gnu.org
@ 2015-03-12 11:11 ` trippels at gcc dot gnu.org
  2015-03-12 11:11 ` thopre01 at gcc dot gnu.org
                   ` (27 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-03-12 11:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
                 CC|                            |thomas.preudhomme at arm dot com,
                   |                            |trippels at gcc dot gnu.org

--- Comment #9 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Started with r210843.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2015-03-12 11:11 ` thopre01 at gcc dot gnu.org
@ 2015-03-12 13:54 ` amodra at gmail dot com
  2015-03-12 14:01 ` amodra at gmail dot com
                   ` (24 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: amodra at gmail dot com @ 2015-03-12 13:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2015-03-12 00:00:00         |2015-03-10 0:00
                 CC|                            |amodra at gmail dot com

--- Comment #13 from Alan Modra <amodra at gmail dot com> ---
Markus, are you sure about comment #9?  I completely disabled the bswap pass
and still see a failure of the testcase at -O3.

Incidentally, if I compile with -O2 -fno-inline, the testcase fails on the
first iteration rather than the second (unaligned case) iteration.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2015-03-12 13:54 ` amodra at gmail dot com
@ 2015-03-12 14:01 ` amodra at gmail dot com
  2015-03-12 14:04 ` trippels at gcc dot gnu.org
                   ` (23 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: amodra at gmail dot com @ 2015-03-12 14:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #14 from Alan Modra <amodra at gmail dot com> ---
That should be -O3 -fno-inline.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2015-03-12 14:01 ` amodra at gmail dot com
@ 2015-03-12 14:04 ` trippels at gcc dot gnu.org
  2015-03-12 15:10 ` jakub at gcc dot gnu.org
                   ` (22 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-03-12 14:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #15 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
(In reply to Alan Modra from comment #13)
> Markus, are you sure about comment #9?  I completely disabled the bswap pass
> and still see a failure of the testcase at -O3.
> 
> Incidentally, if I compile with -O2 -fno-inline, the testcase fails on the
> first iteration rather than the second (unaligned case) iteration.

Yes r210842 is fine, r210843 fails with -O3.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2015-03-12 14:04 ` trippels at gcc dot gnu.org
@ 2015-03-12 15:10 ` jakub at gcc dot gnu.org
  2015-03-12 15:22 ` jakub at gcc dot gnu.org
                   ` (21 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-12 15:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Yeah, it is really weird.  With -O0 the testcase also fails on the first
iteration.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (16 preceding siblings ...)
  2015-03-12 15:10 ` jakub at gcc dot gnu.org
@ 2015-03-12 15:22 ` jakub at gcc dot gnu.org
  2015-03-12 15:34 ` trippels at gcc dot gnu.org
                   ` (20 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-12 15:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I've tried to add
__builtin_memset(ctx, 0, sizeof (*ctx));
to the beginning of md4_init and it changes the result of the program at -O0,
so I expect the testcase relies on some particular pattern of uninitialized
data in ctx->block.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (17 preceding siblings ...)
  2015-03-12 15:22 ` jakub at gcc dot gnu.org
@ 2015-03-12 15:34 ` trippels at gcc dot gnu.org
  2015-03-12 15:38 ` jakub at gcc dot gnu.org
                   ` (19 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-03-12 15:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #18 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
trippels@gcc2-power8 ~ % valgrind --track-origins=yes ./a.out
==152914== Memcheck, a memory error detector
==152914== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==152914== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==152914== Command: ./a.out
==152914==
==152914== Use of uninitialised value of size 8
==152914==    at 0x4135C58: _itoa_word (in /usr/lib64/libc-2.20.so)
==152914==    by 0x413A42B: vfprintf@@GLIBC_2.17 (in /usr/lib64/libc-2.20.so)
==152914==    by 0x1000132B: main (gcc-65369.c:199)
==152914==  Uninitialised value was created by a stack allocation
==152914==    at 0x100010F0: md4_digest (gcc-65369.c:143)
==152914==
==152914== Conditional jump or move depends on uninitialised value(s)
==152914==    at 0x4135C60: _itoa_word (in /usr/lib64/libc-2.20.so)
==152914==    by 0x413A42B: vfprintf@@GLIBC_2.17 (in /usr/lib64/libc-2.20.so)
==152914==    by 0x1000132B: main (gcc-65369.c:199)
==152914==  Uninitialised value was created by a stack allocation
==152914==    at 0x100010F0: md4_digest (gcc-65369.c:143)
==152914==
==152914== Use of uninitialised value of size 8
==152914==    at 0x4135C6C: _itoa_word (in /usr/lib64/libc-2.20.so)
==152914==    by 0x413A42B: vfprintf@@GLIBC_2.17 (in /usr/lib64/libc-2.20.so)
==152914==    by 0x1000132B: main (gcc-65369.c:199)
==152914==  Uninitialised value was created by a stack allocation
==152914==    at 0x100010F0: md4_digest (gcc-65369.c:143)
==152914==
==152914== Conditional jump or move depends on uninitialised value(s)
==152914==    at 0x413A4AC: vfprintf@@GLIBC_2.17 (in /usr/lib64/libc-2.20.so)
==152914==    by 0x414107B: printf@@GLIBC_2.17 (in /usr/lib64/libc-2.20.so)
==152914==    by 0x1000132B: main (gcc-65369.c:199)
==152914==  Uninitialised value was created by a stack allocation
==152914==    at 0x100010F0: md4_digest (gcc-65369.c:143)
==152914==
==152914== Conditional jump or move depends on uninitialised value(s)
==152914==    at 0x413A2CC: vfprintf@@GLIBC_2.17 (in /usr/lib64/libc-2.20.so)
==152914==    by 0x414107B: printf@@GLIBC_2.17 (in /usr/lib64/libc-2.20.so)
==152914==    by 0x1000132B: main (gcc-65369.c:199)
==152914==  Uninitialised value was created by a stack allocation
==152914==    at 0x100010F0: md4_digest (gcc-65369.c:143)
==152914==
buffer[] = { \xe3 \x3b \x4d \xdc \x9c \x38 \xf2 \x19 \x9c \x3e \x7b \x16 \x4f
\xcc \x05 \x36 }
digest[] = { \xe3 \x3b \x4d \xdc \x9c \x38 \xf2 \x19 \x9c \x3e \x7b \x16 \x4f
\xcc \x05 \x36 }
==152914== Conditional jump or move depends on uninitialised value(s)
==152914==    at 0x409BE6C: memcmp (in
/usr/lib64/valgrind/vgpreload_memcheck-ppc64le-linux.so)
==152914==    by 0x100013AB: main (gcc-65369.c:204)
==152914==  Uninitialised value was created by a stack allocation
==152914==    at 0x100010F0: md4_digest (gcc-65369.c:143)
==152914==
==152914== Conditional jump or move depends on uninitialised value(s)
==152914==    at 0x409BE94: memcmp (in
/usr/lib64/valgrind/vgpreload_memcheck-ppc64le-linux.so)
==152914==    by 0x100013AB: main (gcc-65369.c:204)
==152914==  Uninitialised value was created by a stack allocation
==152914==    at 0x100010F0: md4_digest (gcc-65369.c:143)
==152914==
buffer[] = { \xe3 \x3b \x4d \xdc \x9c \x38 \xf2 \x19 \x9c \x3e \x7b \x16 \x4f
\xcc \x05 \x36 }
digest[] = { \xe3 \x3b \x4d \xdc \x9c \x38 \xf2 \x19 \x9c \x3e \x7b \x16 \x4f
\xcc \x05 \x36 }
==152914== Conditional jump or move depends on uninitialised value(s)
==152914==    at 0x409BE6C: memcmp (in
/usr/lib64/valgrind/vgpreload_memcheck-ppc64le-linux.so)
==152914==    by 0x1000138F: main (gcc-65369.c:203)
==152914==  Uninitialised value was created by a stack allocation
==152914==    at 0x100010F0: md4_digest (gcc-65369.c:143)
==152914==
==152914== Conditional jump or move depends on uninitialised value(s)
==152914==    at 0x409BE94: memcmp (in
/usr/lib64/valgrind/vgpreload_memcheck-ppc64le-linux.so)
==152914==    by 0x1000138F: main (gcc-65369.c:203)
==152914==  Uninitialised value was created by a stack allocation
==152914==    at 0x100010F0: md4_digest (gcc-65369.c:143)
==152914==
==152914==
==152914== HEAP SUMMARY:
==152914==     in use at exit: 0 bytes in 0 blocks
==152914==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==152914==
==152914== All heap blocks were freed -- no leaks are possible
==152914==
==152914== For counts of detected and suppressed errors, rerun with: -v
==152914== ERROR SUMMARY: 206 errors from 9 contexts (suppressed: 0 from 0)


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (18 preceding siblings ...)
  2015-03-12 15:34 ` trippels at gcc dot gnu.org
@ 2015-03-12 15:38 ` jakub at gcc dot gnu.org
  2015-03-12 15:40 ` msebor at gcc dot gnu.org
                   ` (18 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-12 15:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #19 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Yeah.  In md4_digest, for (i = 0; i < 16 - 2; i++) look writes data[0] through
data[13], data[14] is stored after the loop, but data[15] is uninitialized,
but md5_transform reads it and uses it.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (19 preceding siblings ...)
  2015-03-12 15:38 ` jakub at gcc dot gnu.org
@ 2015-03-12 15:40 ` msebor at gcc dot gnu.org
  2015-03-12 15:42 ` jakub at gcc dot gnu.org
                   ` (17 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: msebor at gcc dot gnu.org @ 2015-03-12 15:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #20 from Martin Sebor <msebor at gcc dot gnu.org> ---
The original test doesn't show any valgrind errors so these could be the result
of using delta to reduce the test case.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (20 preceding siblings ...)
  2015-03-12 15:40 ` msebor at gcc dot gnu.org
@ 2015-03-12 15:42 ` jakub at gcc dot gnu.org
  2015-03-12 15:44 ` trippels at gcc dot gnu.org
                   ` (16 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-12 15:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #21 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Looking at https://git.lysator.liu.se/nettle/nettle/blob/master/md4.c I see
there:
  bit_count = (ctx->count << 9) | (ctx->index << 3);
  data[MD4_DATA_LENGTH-2] = bit_count;
  data[MD4_DATA_LENGTH-1] = bit_count >> 32;
and thus it initializes everything.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (21 preceding siblings ...)
  2015-03-12 15:42 ` jakub at gcc dot gnu.org
@ 2015-03-12 15:44 ` trippels at gcc dot gnu.org
  2015-03-12 15:48 ` jakub at gcc dot gnu.org
                   ` (15 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-03-12 15:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #22 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Could you please attach the unreduced testcase?


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (22 preceding siblings ...)
  2015-03-12 15:44 ` trippels at gcc dot gnu.org
@ 2015-03-12 15:48 ` jakub at gcc dot gnu.org
  2015-03-12 15:54 ` msebor at gcc dot gnu.org
                   ` (14 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-12 15:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #23 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 35019
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35019&action=edit
pr65369.c

Adjusted testcase that now works reliably at -O0, and even with -O3
-fno-inline, but fails with -O3 on powerpc64le-linux.  Works on x86_64-linux. 
Contains LP64 dependency right now...


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (23 preceding siblings ...)
  2015-03-12 15:48 ` jakub at gcc dot gnu.org
@ 2015-03-12 15:54 ` msebor at gcc dot gnu.org
  2015-03-12 16:32 ` trippels at gcc dot gnu.org
                   ` (13 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: msebor at gcc dot gnu.org @ 2015-03-12 15:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #24 from Martin Sebor <msebor at gcc dot gnu.org> ---
Created attachment 35020
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35020&action=edit
Unreduced translation unit of the test program.

Compil and run like so:

$ gcc -O3 -Wall -Werror  gcc-65369.i && valgrind ./a.out
==86961== Memcheck, a memory error detector
==86961== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==86961== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==86961== Command: ./a.out
==86961== 
buffer[] = { \xe3 \x3b \x4d \xdc \x9c \x38 \xf2 \x19 \x9c \x3e \x7b \x16 \x4f
\xcc \x05 \x36 }
digest[] = { \xe3 \x3b \x4d \xdc \x9c \x38 \xf2 \x19 \x9c \x3e \x7b \x16 \x4f
\xcc \x05 \x36 }
buffer[] = { \xdd \x41 \x11 \xdd \x66 \x91 \x3a \xe2 \xf3 \x9a \xdf \xbc \x43
\x82 \x14 \xd6 }
digest[] = { \xe3 \x3b \x4d \xdc \x9c \x38 \xf2 \x19 \x9c \x3e \x7b \x16 \x4f
\xcc \x05 \x36 }
a.out: gcc-65369.c:41: main: Assertion `0 == memcmp (buffer, digest, sizeof
buffer - 1)' failed.
==86961== 
==86961== HEAP SUMMARY:
==86961==     in use at exit: 97 bytes in 1 blocks
==86961==   total heap usage: 3 allocs, 2 frees, 295 bytes allocated
==86961== 
==86961== LEAK SUMMARY:
==86961==    definitely lost: 0 bytes in 0 blocks
==86961==    indirectly lost: 0 bytes in 0 blocks
==86961==      possibly lost: 97 bytes in 1 blocks
==86961==    still reachable: 0 bytes in 0 blocks
==86961==         suppressed: 0 bytes in 0 blocks
==86961== Rerun with --leak-check=full to see details of leaked memory
==86961== 
==86961== For counts of detected and suppressed errors, rerun with: -v
==86961== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Aborted


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (24 preceding siblings ...)
  2015-03-12 15:54 ` msebor at gcc dot gnu.org
@ 2015-03-12 16:32 ` trippels at gcc dot gnu.org
  2015-03-13  4:42 ` thopre01 at gcc dot gnu.org
                   ` (12 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-03-12 16:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #25 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Jakub's reduced- and the unreduced testcase also started to fail 
with r210843.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (25 preceding siblings ...)
  2015-03-12 16:32 ` trippels at gcc dot gnu.org
@ 2015-03-13  4:42 ` thopre01 at gcc dot gnu.org
  2015-03-13  6:38 ` amodra at gmail dot com
                   ` (11 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: thopre01 at gcc dot gnu.org @ 2015-03-13  4:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

Thomas Preud'homme <thopre01 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
   Last reconfirmed|2015-03-10 00:00:00         |2015-03-12 0:00
           Assignee|thopre01 at gcc dot gnu.org        |unassigned at gcc dot gnu.org

--- Comment #27 from Thomas Preud'homme <thopre01 at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #26)
> So, on my version of the testcase with r210843 -O3 -mcpu=power8 there are
> like 49
> 32 bit load in host endianness found at: _105 = MEM[(const unsigned char
> *)load_src_25];
> occurrences, so I've added a quick hack (should have used dbg counters
> parhaps), and
> with BSWAPCNT=16 it works fine, with BSWAPCNT=17 it fails.
> In the *.optimized dump, I've noticed that this single load matters for
> vectorization in md4_update function, with BSWAPCNT=16 a chunk of code isn't
> vectorized, with BSWAPCNT=17 it is.

> 
> So very well this might just trigger a latent bug in the vectorizer or
> powerpc backend.


Using trunk I get the following difference for bswap

@@ -1110,10 +1111,10 @@ nettle_md4_update (struct md4_ctx * ctx,
   _100 = MEM[(const uint8_t *)data_149 + 1B];
   _101 = (unsigned int) _100;
   _102 = _101 << 8;
+  _106 = MEM[(const uint8_t *)data_149];
   _104 = *data_149;
   _105 = (unsigned int) _104;
   _123 = _99 | _105;
-  _106 = _102 | _123;

Which looks perfectly fine. So yeah, I guess the problem is at a different
level.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (26 preceding siblings ...)
  2015-03-13  4:42 ` thopre01 at gcc dot gnu.org
@ 2015-03-13  6:38 ` amodra at gmail dot com
  2015-03-13  6:46 ` trippels at gcc dot gnu.org
                   ` (10 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: amodra at gmail dot com @ 2015-03-13  6:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #28 from Alan Modra <amodra at gmail dot com> ---
Created attachment 35024
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35024&action=edit
modified testcase without bswap optimization

This modified testcase avoids triggering the bswap optimization but still shows
a failure at -O3.  So definitely not a problem caused by Thomas' patch.

-O3 -fno-tree-slp-vectorize is OK

-O3 slp dump shows weird offset of +12 between vector loads rather than +16 as
is usual


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (27 preceding siblings ...)
  2015-03-13  6:38 ` amodra at gmail dot com
@ 2015-03-13  6:46 ` trippels at gcc dot gnu.org
  2015-03-13  9:46 ` rguenth at gcc dot gnu.org
                   ` (9 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-03-13  6:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wschmidt at gcc dot gnu.org

--- Comment #29 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
CCing Bill because this might be a bug in rs6000_analyze_swaps().


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (28 preceding siblings ...)
  2015-03-13  6:46 ` trippels at gcc dot gnu.org
@ 2015-03-13  9:46 ` rguenth at gcc dot gnu.org
  2015-03-13 14:01 ` amodra at gmail dot com
                   ` (8 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-13  9:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #30 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Alan Modra from comment #28)
> Created attachment 35024 [details]
> modified testcase without bswap optimization
> 
> This modified testcase avoids triggering the bswap optimization but still
> shows a failure at -O3.  So definitely not a problem caused by Thomas' patch.
> 
> -O3 -fno-tree-slp-vectorize is OK
> 
> -O3 slp dump shows weird offset of +12 between vector loads rather than +16
> as is usual

Well, that's the realign-load sequence.  Load ptr & ~15 and then load (ptr +
12) & ~15.  If ptr is already aligned both loads should load from the same
location.

SLP happens in md4_update only (but it's quite trivial).


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (29 preceding siblings ...)
  2015-03-13  9:46 ` rguenth at gcc dot gnu.org
@ 2015-03-13 14:01 ` amodra at gmail dot com
  2015-03-13 14:22 ` amodra at gmail dot com
                   ` (7 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: amodra at gmail dot com @ 2015-03-13 14:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #35016|0                           |1
        is obsolete|                            |
  Attachment #35019|0                           |1
        is obsolete|                            |
  Attachment #35024|0                           |1
        is obsolete|                            |

--- Comment #31 from Alan Modra <amodra at gmail dot com> ---
Created attachment 35027
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35027&action=edit
reduced testcase


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (30 preceding siblings ...)
  2015-03-13 14:01 ` amodra at gmail dot com
@ 2015-03-13 14:22 ` amodra at gmail dot com
  2015-03-13 14:51 ` trippels at gcc dot gnu.org
                   ` (6 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: amodra at gmail dot com @ 2015-03-13 14:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #32 from Alan Modra <amodra at gmail dot com> ---
Richi, ptr+12 is nonsense.  Suppose ptr is 16k+1, then first vector loads from
16k and second from the same address since (16k+1+12) & ~15 == 16k.  But we
want to end up with 15 bytes from the first 16-byte aligned block and one byte
from the *next* 16-byte aligned block, which means we must use ptr+16.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (31 preceding siblings ...)
  2015-03-13 14:22 ` amodra at gmail dot com
@ 2015-03-13 14:51 ` trippels at gcc dot gnu.org
  2015-03-13 15:25 ` wschmidt at gcc dot gnu.org
                   ` (5 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-03-13 14:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #33 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
FWIW Alan's new testcase started to fail with r212452.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (32 preceding siblings ...)
  2015-03-13 14:51 ` trippels at gcc dot gnu.org
@ 2015-03-13 15:25 ` wschmidt at gcc dot gnu.org
  2015-03-13 16:25 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2015-03-13 15:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #34 from Bill Schmidt <wschmidt at gcc dot gnu.org> ---
(In reply to Markus Trippelsdorf from comment #29)
> CCing Bill because this might be a bug in rs6000_analyze_swaps().

Adding -mno-optimize-swaps to Alan's example does not fix the problem, so no...


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (33 preceding siblings ...)
  2015-03-13 15:25 ` wschmidt at gcc dot gnu.org
@ 2015-03-13 16:25 ` jakub at gcc dot gnu.org
  2015-03-13 16:45 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-13 16:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #35 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Note to self.  This is the case dr_explicit_realign: case of vectorizable_load.
(ptr + 12) & -16L - i.e. vs_minus_1 * TYPE_ALIGN_UNIT (element) is reasonable
for the case where the original stmt data ref is naturally aligned, but in this
case it is an unaligned load and thus we can't use + 12 but should use + 15
instead.  This is quite related to PR63341, but that was the
dr_explicit_realign_optimized case, not dr_explicit_realign.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (34 preceding siblings ...)
  2015-03-13 16:25 ` jakub at gcc dot gnu.org
@ 2015-03-13 16:45 ` jakub at gcc dot gnu.org
  2015-03-13 16:46 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  38 siblings, 0 replies; 40+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-13 16:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #36 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 35029
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35029&action=edit
gcc5-pr65369.patch

Untested fix.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (35 preceding siblings ...)
  2015-03-13 16:45 ` jakub at gcc dot gnu.org
@ 2015-03-13 16:46 ` jakub at gcc dot gnu.org
  2015-03-14  9:57 ` jakub at gcc dot gnu.org
  2015-03-14  9:57 ` jakub at gcc dot gnu.org
  38 siblings, 0 replies; 40+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-13 16:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (37 preceding siblings ...)
  2015-03-14  9:57 ` jakub at gcc dot gnu.org
@ 2015-03-14  9:57 ` jakub at gcc dot gnu.org
  38 siblings, 0 replies; 40+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-14  9:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #38 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Bug target/65369] [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3
  2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
                   ` (36 preceding siblings ...)
  2015-03-13 16:46 ` jakub at gcc dot gnu.org
@ 2015-03-14  9:57 ` jakub at gcc dot gnu.org
  2015-03-14  9:57 ` jakub at gcc dot gnu.org
  38 siblings, 0 replies; 40+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-14  9:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65369

--- Comment #37 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Sat Mar 14 09:56:39 2015
New Revision: 221435

URL: https://gcc.gnu.org/viewcvs?rev=221435&root=gcc&view=rev
Log:
    PR tree-optimization/65369
    * tree-vect-stmts.c (vectorizable_load) <case dr_explicit_realign>:
    Set bump to vs * TYPE_SIZE_UNIT (elem_type) - 1 instead of
    (vs - 1) * TYPE_SIZE_UNIT (elem_type).

    * gcc.c-torture/execute/pr65369.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/execute/pr65369.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-stmts.c


^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2015-03-14  9:57 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-09 23:14 [Bug target/65369] New: [5 Regression] nettle test failure on powerpc64le-linux-gnu when built with -O3 doko at gcc dot gnu.org
2015-03-09 23:24 ` [Bug target/65369] " pinskia at gcc dot gnu.org
2015-03-10  9:00 ` rguenth at gcc dot gnu.org
2015-03-10 15:01 ` law at redhat dot com
2015-03-10 21:56 ` msebor at gcc dot gnu.org
2015-03-11  4:04 ` msebor at gcc dot gnu.org
2015-03-11  4:10 ` doko at gcc dot gnu.org
2015-03-11 21:36 ` msebor at gcc dot gnu.org
2015-03-12  2:50 ` msebor at gcc dot gnu.org
2015-03-12 11:11 ` thopre01 at gcc dot gnu.org
2015-03-12 11:11 ` trippels at gcc dot gnu.org
2015-03-12 11:11 ` trippels at gcc dot gnu.org
2015-03-12 11:11 ` thopre01 at gcc dot gnu.org
2015-03-12 11:11 ` thopre01 at gcc dot gnu.org
2015-03-12 13:54 ` amodra at gmail dot com
2015-03-12 14:01 ` amodra at gmail dot com
2015-03-12 14:04 ` trippels at gcc dot gnu.org
2015-03-12 15:10 ` jakub at gcc dot gnu.org
2015-03-12 15:22 ` jakub at gcc dot gnu.org
2015-03-12 15:34 ` trippels at gcc dot gnu.org
2015-03-12 15:38 ` jakub at gcc dot gnu.org
2015-03-12 15:40 ` msebor at gcc dot gnu.org
2015-03-12 15:42 ` jakub at gcc dot gnu.org
2015-03-12 15:44 ` trippels at gcc dot gnu.org
2015-03-12 15:48 ` jakub at gcc dot gnu.org
2015-03-12 15:54 ` msebor at gcc dot gnu.org
2015-03-12 16:32 ` trippels at gcc dot gnu.org
2015-03-13  4:42 ` thopre01 at gcc dot gnu.org
2015-03-13  6:38 ` amodra at gmail dot com
2015-03-13  6:46 ` trippels at gcc dot gnu.org
2015-03-13  9:46 ` rguenth at gcc dot gnu.org
2015-03-13 14:01 ` amodra at gmail dot com
2015-03-13 14:22 ` amodra at gmail dot com
2015-03-13 14:51 ` trippels at gcc dot gnu.org
2015-03-13 15:25 ` wschmidt at gcc dot gnu.org
2015-03-13 16:25 ` jakub at gcc dot gnu.org
2015-03-13 16:45 ` jakub at gcc dot gnu.org
2015-03-13 16:46 ` jakub at gcc dot gnu.org
2015-03-14  9:57 ` jakub at gcc dot gnu.org
2015-03-14  9:57 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).