From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 501 invoked by alias); 1 Jan 2015 00:36:32 -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 486 invoked by uid 48); 1 Jan 2015 00:36:26 -0000 From: "rurban@x-ray.at" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/64459] __attribute__((returns_nonnull)) creates wrong code on amd64 Date: Thu, 01 Jan 2015 00:36:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rurban@x-ray.at X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status resolution 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: 2015-01/txt/msg00000.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64459 Reini Urban changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |RESOLVED Resolution|--- |INVALID --- Comment #3 from Reini Urban --- This ticket can be closed, not a bug. My test script finished after some hours of grinding, which tested all of the 992 returns_nonnull annotated functions in parrot. Disabling returns_nonnull on one function made it work. I've checked the assembly. It was Parrot_cx_check_scheduler(), which had a wrong if (Parrot_cx_check_scheduler(...) == 0) check, and consequently this branch was removed by gcc. So it's really a missed clang and msvc dead-code removal opportunity.