This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix #pragma omp atomic with floating point types (PR middle-end/36106)


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]