From patchwork Wed Nov 3 15:54:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 70033 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 607461007D3 for ; Thu, 4 Nov 2010 02:54:58 +1100 (EST) Received: (qmail 2969 invoked by alias); 3 Nov 2010 15:54:56 -0000 Received: (qmail 2957 invoked by uid 22791); 3 Nov 2010 15:54:55 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 03 Nov 2010 15:54:48 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 5B44794393 for ; Wed, 3 Nov 2010 16:54:46 +0100 (CET) Date: Wed, 3 Nov 2010 16:54:46 +0100 (CET) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH] Testcase for PR44807 Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Which appears to be fixed. Richard. 2010-11-03 Richard Guenther PR tree-optimization/44807 * gcc.dg/torture/pr44807.c: New testcase. Index: testsuite/gcc.dg/torture/pr44807.c =================================================================== --- testsuite/gcc.dg/torture/pr44807.c (revision 0) +++ testsuite/gcc.dg/torture/pr44807.c (revision 0) @@ -0,0 +1,40 @@ +/* { dg-do compile } */ + +struct jobstats +{ + int j_jobslots; +}; +struct jobstats js; +int *jobs; + +typedef int sh_job_map_func_t (int *, int, int, int); + +static void +map_over_jobs (sh_job_map_func_t func) +{ + int i; + int set, oset; + if (js.j_jobslots) + return; + sigemptyset (&set); + sigaddset (set, 17); + sigemptyset (&oset); + sigprocmask (0, set, oset); + for (i = 0; js.j_jobslots; i++) + if (jobs[i]) + func (jobs, 0, 0, 0); + sigprocmask (oset, ((void *) 0)); +} + +int +print_job (int *job, int format, int state, int job_index) +{ + map_over_jobs (print_job); +} + +void +list_running_jobs (void) +{ + map_over_jobs (print_job); +} +