From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12678 invoked by alias); 11 Aug 2014 14:02:44 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 12574 invoked by uid 48); 11 Aug 2014 14:02:37 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/62025] [4.9/4.10 Regression] Miscompilation of openssl sha512.c Date: Mon, 11 Aug 2014 14:02:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-08/txt/msg00656.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62025 --- Comment #3 from Jakub Jelinek --- Note, when I replace the if+abort with a printout of all the 8 c.h[] values and take a poll of the results from: ./cc1.208700 -m31 -O0 sha.c -o sha0.s -quiet -nostdinc ./cc1.207604 -nostdinc -quiet -O2 -m31 -march=z196 -mtune=z10 sha.c -o sha1.s ./cc1.207605 -nostdinc -quiet -O2 -m31 -march=z196 -mtune=z10 sha.c -o sha2.s ./cc1.207604 -nostdinc -quiet -O2 -mno-lra -m31 -march=z196 -mtune=z10 sha.c -o sha3.s ./cc1.207605 -nostdinc -quiet -O2 -m31 -march=z196 -mno-lra -mtune=z10 sha.c -o sha4.s /usr/src/gcc/objz/gcc/cc1 -nostdinc -quiet -O2 -m31 -march=z196 -mtune=z10 sha.c -o sha5.s /usr/src/gcc/objz/gcc/cc1 -nostdinc -quiet -O2 -m31 -march=z196 -mtune=z10 sha.c -o sha6.s -mno-lra where /usr/src/gcc/objz/gcc/cc1 is trunk from around Aug 5th, I get different results from the testcase, and also if I remove the last line or two lines from the loop in the function. But which function have different result from the -O0 results depends on how many lines are removed. With no lines removed (G for results matching -O0, B for different result): GGBGBBB With the last line removed the results are GBGBBGB. With the last two lines removed GBGBBGG, when 3 or more lines from the loop are removed, all results are the same (i.e. all Gs). As I believe the testcase doesn't have undefined behavior with any of the loop lines removed, this shows that perhaps the shrink wrapping case just changed things big enough that some RA or later issue either started appearing, or went away.