From patchwork Sun Nov 27 00:05:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 127823 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 C75ABB70DC for ; Sun, 27 Nov 2011 11:05:31 +1100 (EST) Received: (qmail 3597 invoked by alias); 27 Nov 2011 00:05:27 -0000 Received: (qmail 3583 invoked by uid 22791); 27 Nov 2011 00:05:25 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-vx0-f175.google.com (HELO mail-vx0-f175.google.com) (209.85.220.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 27 Nov 2011 00:05:12 +0000 Received: by vcbfo13 with SMTP id fo13so1178580vcb.20 for ; Sat, 26 Nov 2011 16:05:12 -0800 (PST) Received: by 10.52.177.34 with SMTP id cn2mr409822vdc.34.1322352312219; Sat, 26 Nov 2011 16:05:12 -0800 (PST) Received: from pebble.twiddle.home ([173.160.232.49]) by mx.google.com with ESMTPS id id7sm41416494vdb.21.2011.11.26.16.05.10 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 26 Nov 2011 16:05:10 -0800 (PST) Message-ID: <4ED17EB4.4070807@twiddle.net> Date: Sat, 26 Nov 2011 16:05:08 -0800 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16 MIME-Version: 1.0 To: GCC Patches Subject: Adjust omp-low test for alignment 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 The m68k-linux failure for the various omp atomic tests is due to the fact that BIGGEST_ALIGNMENT is 16 bits on that platform. I think it's pretty reasonable to assume that if something is aligned to BIGGEST_ALIGNEMENT, then it can be considered "aligned". Tested on x86_64-linux and m68k-linux cross. r~ * omp-low.c (expand_omp_atomic): Assume anything aligned to BIGGEST_ALIGNMENT is aligned. diff --git a/gcc/omp-low.c b/gcc/omp-low.c index a4bfb84..4e1c2ba 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -5501,7 +5501,9 @@ expand_omp_atomic (struct omp_region *region) unsigned int align = TYPE_ALIGN_UNIT (type); /* __sync builtins require strict data alignment. */ - if (exact_log2 (align) >= index) + /* ??? Assume BIGGEST_ALIGNMENT *is* aligned. */ + if (exact_log2 (align) >= index + || align * BITS_PER_UNIT >= BIGGEST_ALIGNMENT) { /* Atomic load. */ if (loaded_val == stored_val