This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix #pragma omp atomic with floating point types (PR middle-end/36106)
- From: Diego Novillo <dnovillo at google dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- Date: Tue, 06 May 2008 14:56:40 -0700
- Subject: Re: [PATCH] Fix #pragma omp atomic with floating point types (PR middle-end/36106)
- References: <20080505203427.GT2255@devserv.devel.redhat.com>
On 5/5/08 1:34 PM, Jakub Jelinek wrote:
@@ -3775,48 +3775,81 @@ expand_omp_atomic_pipeline (basic_block
/* Load the initial value, replacing the OMP_ATOMIC_LOAD. */
bsi = bsi_last (load_bb);
gcc_assert (TREE_CODE (bsi_stmt (bsi)) == OMP_ATOMIC_LOAD);
- initial = force_gimple_operand_bsi (&bsi, build_fold_indirect_ref (addr),
+ /* For floating-point values, we'll need to view-convert them to integers
+ so that we can perform the atomic compare and swap. Simplify the
+ following code by always setting up the "i"ntegral variables. */
+ if (!INTEGRAL_TYPE_P (type) && !POINTER_TYPE_P (type))
Why not just FLOAT_TYPE_P (type)? Or do you also want to include
aggregates here? Also, why "i"ntegral?
The rest looks fine.
Diego.