This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR53992 - openmp lower transaction code
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Patrick Marlier <patrick dot marlier at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Richard Henderson <rth at redhat dot com>
- Date: Mon, 20 Aug 2012 16:29:28 +0200
- Subject: Re: [PATCH] PR53992 - openmp lower transaction code
- References: <503247B1.5020809@gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Aug 20, 2012 at 10:20:33AM -0400, Patrick Marlier wrote:
> Ok for trunk? Ok to backport to 4.7 branch if no regression?
Ok for both, with the following nits resolved:
> gcc/
> 2012-08-17 Patrick Marlier <patrick.marlier@gmail.com>
>
> PR libgomp/53992
Use PR middle-end/53992 instead, libgomp is for library issues only.
> * omp-low.c (lower_omp_1): Handle GIMPLE_TRANSACTION.
> @@ -7108,24 +7111,24 @@ diagnose_sb_2 (gimple_stmt_iterator *gsi_p, bool *
> break;
>
> case GIMPLE_COND:
> - {
> - tree lab = gimple_cond_true_label (stmt);
> - if (lab)
> - {
> - n = splay_tree_lookup (all_labels,
> - (splay_tree_key) lab);
> - diagnose_sb_0 (gsi_p, context,
> - n ? (gimple) n->value : NULL);
> - }
> - lab = gimple_cond_false_label (stmt);
> - if (lab)
> - {
> - n = splay_tree_lookup (all_labels,
> - (splay_tree_key) lab);
> - diagnose_sb_0 (gsi_p, context,
> - n ? (gimple) n->value : NULL);
> - }
> - }
> + {
> + tree lab = gimple_cond_true_label (stmt);
> + if (lab)
> + {
> + n = splay_tree_lookup (all_labels,
> + (splay_tree_key) lab);
> + diagnose_sb_0 (gsi_p, context,
> + n ? (gimple) n->value : NULL);
> + }
> + lab = gimple_cond_false_label (stmt);
> + if (lab)
> + {
> + n = splay_tree_lookup (all_labels,
> + (splay_tree_key) lab);
> + diagnose_sb_0 (gsi_p, context,
> + n ? (gimple) n->value : NULL);
> + }
> + }
> break;
>
> case GIMPLE_GOTO:
Please leave this hunk out. Formatting can be normally fixed only
if you touch the code in question or at least lines around it, not
in an unrelated patch that touches completely different function.
> --- testsuite/gcc.dg/gomp/pr53992.c (revision 0)
> +++ testsuite/gcc.dg/gomp/pr53992.c (working copy)
> @@ -0,0 +1,20 @@
Please add
/* PR middle-end/53992 */
line to the beginning of the file.
> +/* { dg-do compile } */
> +/* { dg-options "-fgnu-tm -fopenmp" } */
> +/* { dg-require-effective-target fgnu_tm } */
> +
> +int main() {
> + long data[10000];
> + long i, min=10000;
> + for (i=0; i<10000; i++) data[i] = -i;
> +
> +#pragma omp parallel for
> + for (i=0; i<10000; i++) {
> + __transaction_atomic
> + {
> + if (data[i] < min)
> + min = data[i];
> + }
> + }
> +
> + return !(min == -9999);
> +}
Jakub