Move optimize_minmax_comparison to match.pd

2016-06-12 Thread Marc Glisse

Hello,

this move is pretty straightforward. The transformation would probably 
work just fine for any type (floats, vectors), but I didn't want the 
headache of checking the behavior for NaN.


Bootstrap+regtest on powerpc64le-unknown-linux-gnu.

2016-06-13  Marc Glisse  

* fold-const.c (optimize_minmax_comparison): Remove.
(fold_comparison): Remove call to the above.
* match.pd (MIN (X, Y) == X, MIN (X, 5) == 0, MIN (X, C1) < C2):
New transformations.

--
Marc GlisseIndex: gcc/fold-const.c
===
--- gcc/fold-const.c	(revision 237336)
+++ gcc/fold-const.c	(working copy)
@@ -121,22 +121,20 @@ static tree eval_subst (location_t, tree
 static tree optimize_bit_field_compare (location_t, enum tree_code,
 	tree, tree, tree);
 static int simple_operand_p (const_tree);
 static bool simple_operand_p_2 (tree);
 static tree range_binop (enum tree_code, tree, tree, int, tree, int);
 static tree range_predecessor (tree);
 static tree range_successor (tree);
 static tree fold_range_test (location_t, enum tree_code, tree, tree, tree);
 static tree fold_cond_expr_with_comparison (location_t, tree, tree, tree, tree);
 static tree unextend (tree, int, int, tree);
-static tree optimize_minmax_comparison (location_t, enum tree_code,
-	tree, tree, tree);
 static tree extract_muldiv (tree, tree, enum tree_code, tree, bool *);
 static tree extract_muldiv_1 (tree, tree, enum tree_code, tree, bool *);
 static tree fold_binary_op_with_conditional_arg (location_t,
 		 enum tree_code, tree,
 		 tree, tree,
 		 tree, tree, int);
 static tree fold_div_compare (location_t, enum tree_code, tree, tree, tree);
 static bool reorder_operands_p (const_tree, const_tree);
 static tree fold_negate_const (tree, tree);
 static tree fold_not_const (const_tree, tree);
@@ -5972,124 +5970,20 @@ fold_truth_andor_1 (location_t loc, enum
 			   ll_unsignedp || rl_unsignedp, ll_reversep);
 
   ll_mask = const_binop (BIT_IOR_EXPR, ll_mask, rl_mask);
   if (! all_ones_mask_p (ll_mask, lnbitsize))
 result = build2_loc (loc, BIT_AND_EXPR, lntype, result, ll_mask);
 
   return build2_loc (loc, wanted_code, truth_type, result,
 		 const_binop (BIT_IOR_EXPR, l_const, r_const));
 }
 
-/* Optimize T, which is a comparison of a MIN_EXPR or MAX_EXPR with a
-   constant.  */
-
-static tree
-optimize_minmax_comparison (location_t loc, enum tree_code code, tree type,
-			tree op0, tree op1)
-{
-  tree arg0 = op0;
-  enum tree_code op_code;
-  tree comp_const;
-  tree minmax_const;
-  int consts_equal, consts_lt;
-  tree inner;
-
-  STRIP_SIGN_NOPS (arg0);
-
-  op_code = TREE_CODE (arg0);
-  minmax_const = TREE_OPERAND (arg0, 1);
-  comp_const = fold_convert_loc (loc, TREE_TYPE (arg0), op1);
-  consts_equal = tree_int_cst_equal (minmax_const, comp_const);
-  consts_lt = tree_int_cst_lt (minmax_const, comp_const);
-  inner = TREE_OPERAND (arg0, 0);
-
-  /* If something does not permit us to optimize, return the original tree.  */
-  if ((op_code != MIN_EXPR && op_code != MAX_EXPR)
-  || TREE_CODE (comp_const) != INTEGER_CST
-  || TREE_OVERFLOW (comp_const)
-  || TREE_CODE (minmax_const) != INTEGER_CST
-  || TREE_OVERFLOW (minmax_const))
-return NULL_TREE;
-
-  /* Now handle all the various comparison codes.  We only handle EQ_EXPR
- and GT_EXPR, doing the rest with recursive calls using logical
- simplifications.  */
-  switch (code)
-{
-case NE_EXPR:  case LT_EXPR:  case LE_EXPR:
-  {
-	tree tem
-	  = optimize_minmax_comparison (loc,
-	invert_tree_comparison (code, false),
-	type, op0, op1);
-	if (tem)
-	  return invert_truthvalue_loc (loc, tem);
-	return NULL_TREE;
-  }
-
-case GE_EXPR:
-  return
-	fold_build2_loc (loc, TRUTH_ORIF_EXPR, type,
-		 optimize_minmax_comparison
-		 (loc, EQ_EXPR, type, arg0, comp_const),
-		 optimize_minmax_comparison
-		 (loc, GT_EXPR, type, arg0, comp_const));
-
-case EQ_EXPR:
-  if (op_code == MAX_EXPR && consts_equal)
-	/* MAX (X, 0) == 0  ->  X <= 0  */
-	return fold_build2_loc (loc, LE_EXPR, type, inner, comp_const);
-
-  else if (op_code == MAX_EXPR && consts_lt)
-	/* MAX (X, 0) == 5  ->  X == 5   */
-	return fold_build2_loc (loc, EQ_EXPR, type, inner, comp_const);
-
-  else if (op_code == MAX_EXPR)
-	/* MAX (X, 0) == -1  ->  false  */
-	return omit_one_operand_loc (loc, type, integer_zero_node, inner);
-
-  else if (consts_equal)
-	/* MIN (X, 0) == 0  ->  X >= 0  */
-	return fold_build2_loc (loc, GE_EXPR, type, inner, comp_const);
-
-  else if (consts_lt)
-	/* MIN (X, 0) == 5  ->  false  */
-	return omit_one_operand_loc (loc, type, integer_zero_node, inner);
-
-  else
-	/* MIN (X, 0) == -1  ->  X == -1  */
-	return fold_build2_loc (loc, EQ_EXPR, type, inner, comp_const);
-
-case GT_EXPR:
-  if (op_code == MAX_EXPR && (consts_equal || consts_lt))
-	/* MAX (X, 0) > 0  ->  X > 0
-	   MAX (X, 0

Re: [PATCH] Add ggc-tests.c

2016-06-12 Thread Gerald Pfeifer
On Mon, 6 Jun 2016, David Malcolm wrote:
> OK for trunk?

As committed on Friday

  2016-06-10  David Malcolm  

* Makefile.in (OBJS): Add ggc-tests.o.
(GTFILES): Add ggc-tests.c.
* ggc-tests.c: New file.
* selftest-run-tests.c (selftest::run_tests): Call
selftest::ggc_tests_c_tests.
* selftest.h (selftest::ggc_tests_c_tests): New prototype.

this breaks bootstrap on FreeBSD as follows:

   /scratch/tmp/gerald/OBJ-0610-2205/./gcc/xgcc 
-B/scratch/tmp/gerald/OBJ-0610-2205
   /./gcc/ -xc -S -c /dev/null -fself-test 
   .../gcc-HEAD/gcc/ggc-tests.c:193: FAIL: ASSERT_FALSE 
   (need_finalization_p  ())
   cc1: internal compiler error: in fail, at selftest.c:44

If I disable one particular ASSERT (the first line of the function
below), the bootstrap succeeds:

   test_finalization ()
   {
-->  ASSERT_FALSE (need_finalization_p  ());
 ASSERT_TRUE (need_finalization_p  ());
   :
   }

And testresults look normal:

   https://gcc.gnu.org/ml/gcc-testresults/2016-06/msg01232.html


At first I thought this might be related to clang being the system
compiler on FreeBSD 10, but it also fails on FreeBSD 9 with GCC 4.2.


The source code of need_finalization_p in ggc.h reads

   template
   static inline bool
   need_finalization_p ()
   {
   #if GCC_VERSION >= 4003
 return !__has_trivial_destructor (T);
   #else
 return true;
   #endif
   }

which means your self test is broken by design for any compiler
that is not GCC in at least version 4.3, isn't it?

Okay to commit the straightforward fix for now?

Gerald


2016-06-12  Gerald Pfeifer  

* ggc-tests.c (test_finalization): Remove non-portable assertion.

Index: ggc-tests.c
===
--- ggc-tests.c (revision 237336)
+++ ggc-tests.c (working copy)
@@ -190,7 +190,6 @@
 static void
 test_finalization ()
 {
-  ASSERT_FALSE (need_finalization_p  ());
   ASSERT_TRUE (need_finalization_p  ());
 
   /* Create some garbage.  */


Vectorize 2*x as x+x if needed

2016-06-12 Thread Marc Glisse

Hello,

canonicalizing x+x to x*2 made us regress some vectorization tests on 
sparc. As suggested by Richard, this lets the vectorizer handle x*2 as x+x 
if that helps. Let me copy a few remarks I had in the PR:


« We could probably also handle x*3 as x+x+x, but where to stop?

I don't understand why the optab test for LSHIFT_EXPR was using 
optab_vector, as far as I understand we are creating vec<<3, so 
optab_scalar makes more sense.


I gave priority to x+x over x<<1, not sure if that's right, it probably 
doesn't matter much as one will probably be turned into the other in later 
passes. »


Rainer bootstrapped and regtested the patch on sparc. As a bonus, it now 
vectorizes one more loop in gcc.dg/vect/vect-iv-9.c, I'll let someone else 
tweak the test (which will temporarily appear as a FAIL).


2016-06-13  Marc Glisse  

PR tree-optimization/70923
* tree-vect-patterns.c (vect_recog_mult_pattern): Use optab_scalar
for LSHIFT_EXPR. Handle 2 * X as X + X.

--
Marc GlisseIndex: gcc/tree-vect-patterns.c
===
*** gcc/tree-vect-patterns.c	(revision 237336)
--- gcc/tree-vect-patterns.c	(working copy)
*** vect_recog_vector_vector_shift_pattern (
*** 2166,2189 
  
* Return value: A new stmt that will be used to replace the multiplication
  S1 or S2 stmt.  */
  
  static gimple *
  vect_recog_mult_pattern (vec *stmts,
  			 tree *type_in, tree *type_out)
  {
gimple *last_stmt = stmts->pop ();
tree oprnd0, oprnd1, vectype, itype;
!   gimple *pattern_stmt, *def_stmt;
optab optab;
stmt_vec_info stmt_vinfo = vinfo_for_stmt (last_stmt);
!   int power2_val, power2_neg_val;
tree shift;
  
if (!is_gimple_assign (last_stmt))
  return NULL;
  
if (gimple_assign_rhs_code (last_stmt) != MULT_EXPR)
  return NULL;
  
oprnd0 = gimple_assign_rhs1 (last_stmt);
oprnd1 = gimple_assign_rhs2 (last_stmt);
--- 2166,2189 
  
* Return value: A new stmt that will be used to replace the multiplication
  S1 or S2 stmt.  */
  
  static gimple *
  vect_recog_mult_pattern (vec *stmts,
  			 tree *type_in, tree *type_out)
  {
gimple *last_stmt = stmts->pop ();
tree oprnd0, oprnd1, vectype, itype;
!   gimple *pattern_stmt;
optab optab;
stmt_vec_info stmt_vinfo = vinfo_for_stmt (last_stmt);
!   int power2_val;
tree shift;
  
if (!is_gimple_assign (last_stmt))
  return NULL;
  
if (gimple_assign_rhs_code (last_stmt) != MULT_EXPR)
  return NULL;
  
oprnd0 = gimple_assign_rhs1 (last_stmt);
oprnd1 = gimple_assign_rhs2 (last_stmt);
*** vect_recog_mult_pattern (vec *
*** 2203,2261 
   don't attempt to optimize this.  */
optab = optab_for_tree_code (MULT_EXPR, vectype, optab_default);
if (optab != unknown_optab)
  {
machine_mode vec_mode = TYPE_MODE (vectype);
int icode = (int) optab_handler (optab, vec_mode);
if (icode != CODE_FOR_nothing)
  	return NULL;
  }
  
!   /* If target cannot handle vector left shift then we cannot
!  optimize and bail out.  */
!   optab = optab_for_tree_code (LSHIFT_EXPR, vectype, optab_vector);
!   if (!optab
!   || optab_handler (optab, TYPE_MODE (vectype)) == CODE_FOR_nothing)
! return NULL;
! 
!   power2_val = wi::exact_log2 (oprnd1);
!   power2_neg_val = wi::exact_log2 (wi::neg (oprnd1));
  
!   /* Handle constant operands that are postive or negative powers of 2.  */
!   if (power2_val != -1)
! {
!   shift = build_int_cst (itype, power2_val);
!   pattern_stmt
! 	= gimple_build_assign (vect_recog_temp_ssa_var (itype, NULL),
! 			   LSHIFT_EXPR, oprnd0, shift);
! }
!   else if (power2_neg_val != -1)
  {
/* If the target cannot handle vector NEGATE then we cannot
  	 do the optimization.  */
!   optab = optab_for_tree_code (NEGATE_EXPR, vectype, optab_vector);
if (!optab
  	  || optab_handler (optab, TYPE_MODE (vectype)) == CODE_FOR_nothing)
  	return NULL;
  
!   shift = build_int_cst (itype, power2_neg_val);
!   def_stmt
  	= gimple_build_assign (vect_recog_temp_ssa_var (itype, NULL),
! 			   LSHIFT_EXPR, oprnd0, shift);
!   new_pattern_def_seq (stmt_vinfo, def_stmt);
pattern_stmt
! 	 = gimple_build_assign (vect_recog_temp_ssa_var (itype, NULL),
! NEGATE_EXPR, gimple_assign_lhs (def_stmt));
  }
else
  return NULL;
  
/* Pattern detected.  */
if (dump_enabled_p ())
  dump_printf_loc (MSG_NOTE, vect_location,
  		 "vect_recog_mult_pattern: detected:\n");
  
if (dump_enabled_p ())
  dump_gimple_stmt_loc (MSG_NOTE, vect_location, TDF_SLIM,
  			  pattern_stmt,0);
  
stmts->safe_push (last_stmt);
--- 2203,2271 
   don't attempt to optimize this.  */
optab = optab_for_tree_code (MULT_EXPR, vectype, optab_default);
if (optab != unknown_optab)
  {
machine_mode vec_mode = TYPE_MODE (vectype);
int ico

Re: [patch] generate_libstdcxx_web_docs: Use realpath to get absolute path

2016-06-12 Thread Gerald Pfeifer

Hi Jonathan,

On Thu, 28 Apr 2016, Jonathan Wakely wrote:

When I ran maintainer-scripts/generate_libstdcxx_web_docs to make the
onlinedocs/libstdc++ for 6.1 the other day it failed because I use a
relative path for the output dir argument. This would make it work,
but is relying on GNU realpath OK?


realpath also exists on other systems, though the options you used 
are not portable.


How about going with your patch, just without the -es options?  (I 
verified that this works on FreeBSD, for example.)



I could instead use a Bashism like:

DOCSDIR=$(test "${2:0:1}" = "/" && echo "$2" || echo "$PWD/$2")


That gives me major headache. :-)


If it's OK for trunk it could go on the banches too, for generating
the 4.9.4, 5.4 and 6.2 docs.


Let's go with your patch for trunk and the GCC 6 branch.  Beyond
those, I would not care, though if you feel about it a bit more
strongly, no objection.

Note, there is a second hunk in the patch you posted (cf. the
attached) that makes sense, but will need to be added to the
ChangeLog.

Geraldcommit b46ffd26927df284ea3c4760a40ce716e8e25fa2
Author: Jonathan Wakely 
Date:   Wed Apr 27 14:52:03 2016 +0100

	* generate_libstdcxx_web_docs: Use realpath to get absolute path.

diff --git a/maintainer-scripts/generate_libstdcxx_web_docs b/maintainer-scripts/generate_libstdcxx_web_docs
index 700e522..5878dfe 100755
--- a/maintainer-scripts/generate_libstdcxx_web_docs
+++ b/maintainer-scripts/generate_libstdcxx_web_docs
@@ -3,7 +3,7 @@
 # i.e. http://gcc.gnu.org/onlinedocs/gcc-x.y.z/libstdc++*
 
 SRCDIR=${1}
-DOCSDIR=${2}
+DOCSDIR=$(realpath -es ${2})
 
 if ! [ $# -eq 2 -a -x "${SRCDIR}/configure" -a -d "${DOCSDIR}" ]
 then
@@ -34,6 +34,9 @@ set -x
 ${SRCDIR}/configure --enable-languages=c,c++ --disable-gcc $disabled_libs --docdir=/docs
 eval `grep '^target=' config.log`
 make configure-target
+# If the following step fails with an error like
+# ! LaTeX Error: File `xtab.sty' not found.
+# then you need to install the relevant TeX package e.g. texlive-xtab
 make -C $target/libstdc++-v3 doc-install-html doc-install-xml doc-install-pdf DESTDIR=$DESTDIR
 cd $DESTDIR/docs
 mkdir libstdc++


[BUILDROBOT] MPS430 build problem due to new enum (was: [PATCH 2/2] Add edge predictions pruning)

2016-06-12 Thread Jan-Benedict Glaw
Hi Martin,

On Thu, 2016-06-09 13:24:10 +0200, Martin Liška  wrote:
> On 06/08/2016 02:41 PM, Jan Hubicka wrote:
> > Adding hash for this prupose is bit of an overkill (there are
> > definitly cheaper ways of solving so), but it will hardly affect compile
> > time, so the pathc is OK.
> 
> Sending the final version where I added comments and I also changed
> dump scanning to cover the new dump format.

I just noticed a build problem my Build Robot found
(http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=569576):

g++ -fno-PIE -c   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE   
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing 
-Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual 
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings 
-fno-common  -DHAVE_CONFIG_H -I. -I. -I/scratch/4/jbglaw/regular/repos/gcc/gcc 
-I/scratch/4/jbglaw/regular/repos/gcc/gcc/. 
-I/scratch/4/jbglaw/regular/repos/gcc/gcc/../include 
-I/scratch/4/jbglaw/regular/repos/gcc/gcc/../libcpp/include  
-I/scratch/4/jbglaw/regular/repos/gcc/gcc/../libdecnumber 
-I/scratch/4/jbglaw/regular/repos/gcc/gcc/../libdecnumber/dpd -I../libdecnumber 
-I/scratch/4/jbglaw/regular/repos/gcc/gcc/../libbacktrace   -o predict.o -MT 
predict.o -MMD -MP -MF ./.deps/predict.TPo 
/scratch/4/jbglaw/regular/repos/gcc/gcc/predict.c
/scratch/4/jbglaw/regular/repos/gcc/gcc/predict.c:62:3: error: redeclaration of 
‘NONE’
   NONE,
   ^
In file included from ./options.h:8:0,
 from ./tm.h:16,
 from /scratch/4/jbglaw/regular/repos/gcc/gcc/backend.h:28,
 from /scratch/4/jbglaw/regular/repos/gcc/gcc/predict.c:33:
/scratch/4/jbglaw/regular/repos/gcc/gcc/config/msp430/msp430-opts.h:25:3: note: 
previous declaration ‘msp430_hwmult_types NONE’
   NONE,
   ^
/scratch/4/jbglaw/regular/repos/gcc/gcc/predict.c:743:23: error: could not 
convert ‘NONE’ from ‘msp430_hwmult_types’ to ‘predictor_reason’
edge ep_edge = NULL)
   ^
/scratch/4/jbglaw/regular/repos/gcc/gcc/predict.c: In function ‘void 
combine_predictions_for_insn(rtx_insn*, basic_block)’:
/scratch/4/jbglaw/regular/repos/gcc/gcc/predict.c:863:32: error: cannot convert 
‘msp430_hwmult_types’ to ‘predictor_reason’ for argument ‘5’ to ‘void 
dump_prediction(FILE*, br_predictor, int, basic_block, predictor_reason, edge)’
combined_probability, bb);
^
/scratch/4/jbglaw/regular/repos/gcc/gcc/predict.c:867:36: warning: enumeral 
mismatch in conditional expression: ‘msp430_hwmult_types’ vs ‘predictor_reason’ 
[-Wenum-compare]
  bb, !first_match ? NONE : IGNORED);
^
[...]


The new `NONE' from your enum clashes with a NONE used in a MSP430
private enum.

MfG, JBG

-- 
  Jan-Benedict Glaw  jbg...@lug-owl.de  +49-172-7608481
Signature of: They that give up essential liberty to obtain temporary safety,
the second  : deserve neither liberty nor safety.  (Ben Franklin)


signature.asc
Description: Digital signature


Re: [Patch, fotran] PR70673 - [5/6/7 Regression] ICE with module containing functions with allocatable character scalars

2016-06-12 Thread Thomas Koenig

Hi Paul,


The fix to eliminate this ICE is trivial.


Trivial once you have found it, not so trivial before...


Bootstrapped and regtested on FC21/x86_64 - OK for 5 to 7 branches?


OK.

Thanks a lot for the patch!

Thomas


Re: [wwwdocs] Follow up on usability improvements patch

2016-06-12 Thread Gerald Pfeifer
Hi Stuart,

On Fri, 10 Jun 2016, aquag...@gmail.com wrote:
> I submitted a patch for the website a few weeks ago, but received no
> response in the negative or positive. Wanted to check if it had been
> overlooked.

I've got this, but found it's a bit more involved and I have
some questions and comments.  Not overlooked (and definitely
appreciated)!

Gerald


Re: [Patch, fotran] PR70673 - [5/6/7 Regression] ICE with module containing functions with allocatable character scalars

2016-06-12 Thread Paul Richard Thomas
Hi Thomas,

Thanks a lot! I had meant to address the message to you explicitly
but, apparently, I forgot.

I'll start committing tonight.

Cheers

Paul

On 12 June 2016 at 17:21, Thomas Koenig  wrote:
> Hi Paul,
>
>> The fix to eliminate this ICE is trivial.
>
>
> Trivial once you have found it, not so trivial before...
>
>> Bootstrapped and regtested on FC21/x86_64 - OK for 5 to 7 branches?
>
>
> OK.
>
> Thanks a lot for the patch!
>
> Thomas



-- 
The difference between genius and stupidity is; genius has its limits.

Albert Einstein


Re: [PATCH, i386]: Implement PR 71246, Missing built-in functions for float128 NaNs

2016-06-12 Thread Uros Bizjak
On Sat, Jun 11, 2016 at 9:35 AM, Uros Bizjak  wrote:
> On Fri, Jun 10, 2016 at 11:55 PM, Joseph Myers  
> wrote:
>> On Fri, 10 Jun 2016, Uros Bizjak wrote:
>>
>>> Joseph, does it look OK to you? Richi, I hope I got tree stuff
>>> implemented correctly.
>>
>> It's plausible, but really needs testcases (which could examine the
>> bit-patterns of __float128 objects initialized using these built-in
>> functions, to make sure those are as expected).

Attached is the patch with the testcase I have committed.

2016-06-12  Uros Bizjak  

PR target/71241
* config/i386/i386.i386-builtin-types.def (CONST_STRING):
New primitive type.
(FLOAT128_FTYPE_CONST_STRING): New function type.
* config/i386/i386.c (enum ix86_builtins) [IX86_BUILTIN_NANQ]: New.
[IX86_BUILTIN_NANSQ]: Ditto.
(ix86_fold_builtin): Handle IX86_BUILTIN_NANQ and IX86_BUILTIN_NANSQ.
(ix86_init_builtin_types) Declare const_string_type_node.
Add __builtin_nanq and __builtin_nansq builtin functions.
(ix86_expand_builtin): Handle IX86_BUILTIN_NANQ and IX86_BUILTIN_NANSQ.
* doc/extend.texi (x86 Built-in Functions): Document
__builtin_nanq and __builtin_nansq.

testsuite/ChangeLog:

2016-06-12  Uros Bizjak  

PR target/71241
* testsuite/gcc.dg/torture/float128-nan.c: New test.

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

Committed to mainline SVN.

Uros.
Index: config/i386/i386-builtin-types.def
===
--- config/i386/i386-builtin-types.def  (revision 237337)
+++ config/i386/i386-builtin-types.def  (working copy)
@@ -73,6 +73,7 @@ DEF_PRIMITIVE_TYPE (FLOAT, float_type_node)
 DEF_PRIMITIVE_TYPE (DOUBLE, double_type_node)
 DEF_PRIMITIVE_TYPE (FLOAT80, float80_type_node)
 DEF_PRIMITIVE_TYPE (FLOAT128, float128_type_node)
+DEF_PRIMITIVE_TYPE (CONST_STRING, const_string_type_node)
 
 # MMX vectors
 DEF_VECTOR_TYPE (V2SF, FLOAT)
@@ -191,6 +192,7 @@ DEF_FUNCTION_TYPE (PVOID)
 
 DEF_FUNCTION_TYPE (FLOAT, FLOAT)
 DEF_FUNCTION_TYPE (FLOAT128, FLOAT128)
+DEF_FUNCTION_TYPE (FLOAT128, CONST_STRING)
 DEF_FUNCTION_TYPE (INT, INT)
 DEF_FUNCTION_TYPE (INT, V16QI)
 DEF_FUNCTION_TYPE (INT, V2DF)
Index: config/i386/i386.c
===
--- config/i386/i386.c  (revision 237337)
+++ config/i386/i386.c  (working copy)
@@ -32718,6 +32718,8 @@ enum ix86_builtins
   /* TFmode support builtins.  */
   IX86_BUILTIN_INFQ,
   IX86_BUILTIN_HUGE_VALQ,
+  IX86_BUILTIN_NANQ,
+  IX86_BUILTIN_NANSQ,
   IX86_BUILTIN_FABSQ,
   IX86_BUILTIN_COPYSIGNQ,
 
@@ -38105,11 +38107,28 @@ ix86_fold_builtin (tree fndecl, int n_args,
 {
   enum ix86_builtins fn_code = (enum ix86_builtins)
   DECL_FUNCTION_CODE (fndecl);
-  if (fn_code ==  IX86_BUILTIN_CPU_IS
- || fn_code == IX86_BUILTIN_CPU_SUPPORTS)
+  switch (fn_code)
{
+   case IX86_BUILTIN_CPU_IS:
+   case IX86_BUILTIN_CPU_SUPPORTS:
  gcc_assert (n_args == 1);
-  return fold_builtin_cpu (fndecl, args);
+ return fold_builtin_cpu (fndecl, args);
+
+   case IX86_BUILTIN_NANQ:
+   case IX86_BUILTIN_NANSQ:
+ {
+   tree type = TREE_TYPE (TREE_TYPE (fndecl));
+   const char *str = c_getstr (*args);
+   int quiet = fn_code == IX86_BUILTIN_NANQ;
+   REAL_VALUE_TYPE real;
+
+   if (str && real_nan (&real, str, quiet, TYPE_MODE (type)))
+ return build_real (type, real);
+   return NULL_TREE;
+ }
+
+   default:
+ break;
}
 }
 
@@ -38210,7 +38229,7 @@ ix86_init_builtins_va_builtins_abi (void)
 static void
 ix86_init_builtin_types (void)
 {
-  tree float128_type_node, float80_type_node;
+  tree float128_type_node, float80_type_node, const_string_type_node;
 
   /* The __float80 type.  */
   float80_type_node = long_double_type_node;
@@ -38230,6 +38249,10 @@ ix86_init_builtin_types (void)
   layout_type (float128_type_node);
   lang_hooks.types.register_builtin_type (float128_type_node, "__float128");
 
+  const_string_type_node
+= build_pointer_type (build_qualified_type
+ (char_type_node, TYPE_QUAL_CONST));
+
   /* This macro is built by i386-builtin-types.awk.  */
   DEFINE_BUILTIN_PRIMITIVE_TYPES;
 }
@@ -38250,6 +38273,18 @@ ix86_init_builtins (void)
   def_builtin_const (0, "__builtin_huge_valq",
 FLOAT128_FTYPE_VOID, IX86_BUILTIN_HUGE_VALQ);
 
+  t = ix86_get_builtin_func_type (FLOAT128_FTYPE_CONST_STRING);
+  t = add_builtin_function ("__builtin_nanq", t, IX86_BUILTIN_NANQ,
+   BUILT_IN_MD, "nanq", NULL_TREE);
+  TREE_READONLY (t) = 1;
+  ix86_builtins[(int) IX86_BUILTIN_NANQ] = t;
+
+  t = ix86_get_builtin_func_type (FLOAT128_FTYPE_CONST_STRING);
+  t = add_builtin_function ("__builtin_nansq", t, IX86_BUILTIN_NANSQ,
+   BUILT_IN_MD, "nansq", NULL_TREE);
+  TREE_READONLY (t) = 1;
+

[PATCH, IA64, RFT]: Implement PR 71242, Missing built-in functions for float128 NaNs

2016-06-12 Thread Uros Bizjak
Hello!

The functionality is the same as x86 version, ported to IA64.

2016-06-12  Uros Bizjak  

PR target/71242
* config/ia64/ia64.c (enum ia64_builtins) [IA64_BUILTIN_NANQ]: New.
[IA64_BUILTIN_NANSQ]: Ditto.
(ia64_fold_builtin): New function.
(TARGET_FOLD_BUILTIN): New define.
(ia64_init_builtins) Declare const_string_type node.
Add __builtin_nanq and __builtin_nansq builtin functions.
(ia64_expand_builtin): Handle IA64_BUILTIN_NANQ and IA64_BUILTIN_NANSQ.

testsuite/ChangeLog:

2016-06-12  Uros Bizjak  

PR target/71241
* testsuite/gcc.dg/torture/float128-nan.c: Also run on ia64-*-*.

Tested by building croscompiller to ia64-linux-gnu and eyeballed
resulting assembly.

Can someone please test this patch on a real IA64 ?

Uros.
Index: config/ia64/ia64.c
===
--- config/ia64/ia64.c  (revision 237337)
+++ config/ia64/ia64.c  (working copy)
@@ -323,6 +323,7 @@ static void ia64_trampoline_init (rtx, tree, rtx);
 static void ia64_override_options_after_change (void);
 static bool ia64_member_type_forces_blk (const_tree, machine_mode);
 
+static tree ia64_fold_builtin (tree, int, tree *, bool);
 static tree ia64_builtin_decl (unsigned, bool);
 
 static reg_class_t ia64_preferred_reload_class (rtx, reg_class_t);
@@ -372,6 +373,9 @@ static const struct attribute_spec ia64_attribute_
 #undef TARGET_INIT_BUILTINS
 #define TARGET_INIT_BUILTINS ia64_init_builtins
 
+#undef TARGET_FOLD_BUILTIN
+#define TARGET_FOLD_BUILTIN ia64_fold_builtin
+
 #undef TARGET_EXPAND_BUILTIN
 #define TARGET_EXPAND_BUILTIN ia64_expand_builtin
 
@@ -10325,6 +10329,8 @@ enum ia64_builtins
   IA64_BUILTIN_FLUSHRS,
   IA64_BUILTIN_INFQ,
   IA64_BUILTIN_HUGE_VALQ,
+  IA64_BUILTIN_NANQ,
+  IA64_BUILTIN_NANSQ,
   IA64_BUILTIN_max
 };
 
@@ -10353,6 +10359,9 @@ ia64_init_builtins (void)
   if (!TARGET_HPUX)
 {
   tree ftype;
+  tree const_string_type
+   = build_pointer_type (build_qualified_type
+ (char_type_node, TYPE_QUAL_CONST));
   tree float128_type = make_node (REAL_TYPE);
 
   TYPE_PRECISION (float128_type) = 128;
@@ -10372,6 +10381,21 @@ ia64_init_builtins (void)
   ia64_builtins[IA64_BUILTIN_HUGE_VALQ] = decl;
 
   ftype = build_function_type_list (float128_type,
+   const_string_type,
+   NULL_TREE);
+  decl = add_builtin_function ("__builtin_nanq", ftype,
+  IA64_BUILTIN_NANQ, BUILT_IN_MD,
+  "nanq", NULL_TREE);
+  TREE_READONLY (decl) = 1;
+  ia64_builtins[IA64_BUILTIN_NANQ] = decl;
+
+  decl = add_builtin_function ("__builtin_nansq", ftype,
+  IA64_BUILTIN_NANSQ, BUILT_IN_MD,
+  "nansq", NULL_TREE);
+  TREE_READONLY (decl) = 1;
+  ia64_builtins[IA64_BUILTIN_NANSQ] = decl;
+
+  ftype = build_function_type_list (float128_type,
float128_type,
NULL_TREE);
   decl = add_builtin_function ("__builtin_fabsq", ftype,
@@ -10427,6 +10451,41 @@ ia64_init_builtins (void)
 }
 }
 
+static tree
+ia64_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED,
+  tree *args, bool ignore ATTRIBUTE_UNUSED)
+{
+  if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
+{
+  enum ia64_builtins fn_code = (enum ia64_builtins)
+  DECL_FUNCTION_CODE (fndecl);
+  switch (fn_code)
+   {
+   case IA64_BUILTIN_NANQ:
+   case IA64_BUILTIN_NANSQ:
+ {
+   tree type = TREE_TYPE (TREE_TYPE (fndecl));
+   const char *str = c_getstr (*args);
+   int quiet = fn_code == IA64_BUILTIN_NANQ;
+   REAL_VALUE_TYPE real;
+
+   if (str && real_nan (&real, str, quiet, TYPE_MODE (type)))
+ return build_real (type, real);
+   return NULL_TREE;
+ }
+
+   default:
+ break;
+   }
+}
+
+#ifdef SUBTARGET_FOLD_BUILTIN
+  return SUBTARGET_FOLD_BUILTIN (fndecl, n_args, args, ignore);
+#endif
+
+  return NULL_TREE;
+}
+
 rtx
 ia64_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
 machine_mode mode ATTRIBUTE_UNUSED,
@@ -10469,6 +10528,8 @@ ia64_expand_builtin (tree exp, rtx target, rtx sub
return target;
   }
 
+case IA64_BUILTIN_NANQ:
+case IA64_BUILTIN_NANSQ:
 case IA64_BUILTIN_FABSQ:
 case IA64_BUILTIN_COPYSIGNQ:
   return expand_call (exp, target, ignore);
Index: testsuite/gcc.dg/torture/float128-nan.c
===
--- testsuite/gcc.dg/torture/float128-nan.c (revision 237338)
+++ testsuite/gcc.dg/torture/float128-nan.c (working copy)
@@ -1,5 +1,5 @@
 /* Test __float128 NaN generation.  */
-/* { dg-do run { target i?86-*-* x86_64-

[C++ Patch, trivial] Fix typo in pedwarn text

2016-06-12 Thread Paolo Carlini

Hi,

I'm going to fix this very, very old (for sure in 2008 it was already 
there) typo.


Thanks,
Paolo.


2016-06-12  Paolo Carlini  

* decl.c (grokdeclarator): Fix typo in pedwarn text.
Index: decl.c
===
--- decl.c  (revision 237318)
+++ decl.c  (working copy)
@@ -11365,7 +11365,7 @@ grokdeclarator (const cp_declarator *declarator,
  {
if (storage_class == sc_static)
  pedwarn (input_location, OPT_Wpedantic, 
-  "% specified invalid for function %qs "
+  "% specifier invalid for function %qs "
   "declared out of global scope", name);
else
  pedwarn (input_location, OPT_Wpedantic, 


[PATCH, i386]: Calculate FLOAT128_FTYPE_CONST_STRING function type only once ...

2016-06-12 Thread Uros Bizjak
... and match the documentation of __float128 built-in functions with reality.

2016-06-12  Uros Bizjak  

* config/i386/i386.c (ix86_init_builtins): Calculate
FLOAT128_FTYPE_CONST_STRING function type only once.
* doc/extend.texi (x86 Built-in Functions): Update text, __float128
built-in functions are available for x86-32 and x86-64 targets.

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

Committed to mainline SVN.

Uros.
Index: doc/extend.texi
===
--- doc/extend.texi (revision 237340)
+++ doc/extend.texi (working copy)
@@ -18445,12 +18445,12 @@ integers, these use @code{V4SI}.  Finally, some in
 entire vector register, interpreting it as a 128-bit integer, these use mode
 @code{TI}.
 
-In 64-bit mode, the x86-64 family of processors uses additional built-in
+The x86-32 and x86-64 family of processors use additional built-in
 functions for efficient use of @code{TF} (@code{__float128}) 128-bit
 floating point and @code{TC} 128-bit complex floating-point values.
 
-The following floating-point built-in functions are available in 64-bit
-mode.  All of them implement the function that is part of the name.
+The following floating-point built-in functions are always available.  All
+of them implement the function that is part of the name.
 
 @smallexample
 __float128 __builtin_fabsq (__float128)
@@ -18457,18 +18457,9 @@ __float128 __builtin_fabsq (__float128)
 __float128 __builtin_copysignq (__float128, __float128)
 @end smallexample
 
-The following built-in function is always available.
+The following built-in functions are always available.
 
 @table @code
-@item void __builtin_ia32_pause (void)
-Generates the @code{pause} machine instruction with a compiler memory
-barrier.
-@end table
-
-The following floating-point built-in functions are made available in the
-64-bit mode.
-
-@table @code
 @item __float128 __builtin_infq (void)
 Similar to @code{__builtin_inf}, except the return type is @code{__float128}.
 @findex __builtin_infq
@@ -18486,6 +18477,14 @@ Similar to @code{__builtin_nans}, except the retur
 @findex __builtin_nansq
 @end table
 
+The following built-in function is always available.
+
+@table @code
+@item void __builtin_ia32_pause (void)
+Generates the @code{pause} machine instruction with a compiler memory
+barrier.
+@end table
+
 The following built-in functions are always available and can be used to
 check the target platform type.
 
Index: config/i386/i386.c
===
--- config/i386/i386.c  (revision 237340)
+++ config/i386/i386.c  (working copy)
@@ -38260,7 +38260,7 @@ ix86_init_builtin_types (void)
 static void
 ix86_init_builtins (void)
 {
-  tree t;
+  tree ftype, decl;
 
   ix86_init_builtin_types ();
 
@@ -38273,31 +38273,31 @@ ix86_init_builtins (void)
   def_builtin_const (0, "__builtin_huge_valq",
 FLOAT128_FTYPE_VOID, IX86_BUILTIN_HUGE_VALQ);
 
-  t = ix86_get_builtin_func_type (FLOAT128_FTYPE_CONST_STRING);
-  t = add_builtin_function ("__builtin_nanq", t, IX86_BUILTIN_NANQ,
-   BUILT_IN_MD, "nanq", NULL_TREE);
-  TREE_READONLY (t) = 1;
-  ix86_builtins[(int) IX86_BUILTIN_NANQ] = t;
+  ftype = ix86_get_builtin_func_type (FLOAT128_FTYPE_CONST_STRING);
+  decl = add_builtin_function ("__builtin_nanq", ftype, IX86_BUILTIN_NANQ,
+  BUILT_IN_MD, "nanq", NULL_TREE);
+  TREE_READONLY (decl) = 1;
+  ix86_builtins[(int) IX86_BUILTIN_NANQ] = decl;
 
-  t = ix86_get_builtin_func_type (FLOAT128_FTYPE_CONST_STRING);
-  t = add_builtin_function ("__builtin_nansq", t, IX86_BUILTIN_NANSQ,
-   BUILT_IN_MD, "nansq", NULL_TREE);
-  TREE_READONLY (t) = 1;
-  ix86_builtins[(int) IX86_BUILTIN_NANSQ] = t;  
+  decl = add_builtin_function ("__builtin_nansq", ftype, IX86_BUILTIN_NANSQ,
+  BUILT_IN_MD, "nansq", NULL_TREE);
+  TREE_READONLY (decl) = 1;
+  ix86_builtins[(int) IX86_BUILTIN_NANSQ] = decl;
 
   /* We will expand them to normal call if SSE isn't available since
  they are used by libgcc. */
-  t = ix86_get_builtin_func_type (FLOAT128_FTYPE_FLOAT128);
-  t = add_builtin_function ("__builtin_fabsq", t, IX86_BUILTIN_FABSQ,
-   BUILT_IN_MD, "__fabstf2", NULL_TREE);
-  TREE_READONLY (t) = 1;
-  ix86_builtins[(int) IX86_BUILTIN_FABSQ] = t;
+  ftype = ix86_get_builtin_func_type (FLOAT128_FTYPE_FLOAT128);
+  decl = add_builtin_function ("__builtin_fabsq", ftype, IX86_BUILTIN_FABSQ,
+  BUILT_IN_MD, "__fabstf2", NULL_TREE);
+  TREE_READONLY (decl) = 1;
+  ix86_builtins[(int) IX86_BUILTIN_FABSQ] = decl;
 
-  t = ix86_get_builtin_func_type (FLOAT128_FTYPE_FLOAT128_FLOAT128);
-  t = add_builtin_function ("__builtin_copysignq", t, IX86_BUILTIN_COPYSIGNQ,
-   BUILT_IN_MD, "__copysigntf3", NULL_TREE);
-  TREE_READONLY (t) = 1;
-  ix86_builtins[(

Re: [PATCH,FIXINCLUDES] AIX stdlib.h #define malloc

2016-06-12 Thread Bruce Korb
BTW, OK by me :)  Now that I'm retired, it is starting to look like
less time for this stuff... ;)

On Thu, Jun 9, 2016 at 10:25 AM, David Edelsohn  wrote:

> Index: inclhack.def
> ===
> --- inclhack.def(revision 237258)
> +++ inclhack.def(working copy)


[PATCH, libquadmath]: Use built-in functions instead of fabsq, copysignq and nanq.

2016-06-12 Thread Uros Bizjak
Hello!

Attached (mostly mechanical) patch uses equivalent built-in functions
for fabsq, copysignq and nanq. The patch allows more aggressive
compiler optimizations, where for fabsq and copysignq, the compiler
will emit 128bit SSE bitops, and a 128bit constant load instead of
nanq function call.

The patch also improves detection of required builtins, so for ia64,
additional patch [1] is needed.

2016-06-12  Uros Bizjak  

* configure.ac (__float128 support): Also test _builtin_fabsq,
__builtin_copysignq, __builtin_infq and __builtin_nanq.
* configure: Regenerate.
* math/*.c: Use __builtin_fabsq instead of fabsq, __builtin_copysignq
instead of copysignq, __builtin_infq instead of __builtin_inf and
__builtin_nanq instead of nanq.

Patch was bootstrapped and regression tested on x86_64-linux-gnu
{,-m32}. I have also checked, that no fabsq, copysignq or nanq calls
remain in the library.

OK for mainline?

[1] https://gcc.gnu.org/ml/gcc-patches/2016-06/msg00888.html

Uros.
Index: configure
===
--- configure   (revision 237340)
+++ configure   (working copy)
@@ -8513,7 +8513,7 @@ _LT_EOF
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if 
(((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && 
(substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if 
(((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != 
".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if 
(((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && 
(substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
 
@@ -12514,29 +12514,53 @@ else
 
 typedef _Complex float __attribute__((mode(TC))) __complex128;
 
-__float128 foo (__float128 x)
+__float128 test_cplx (__float128 x)
 {
 
- __complex128 z1, z2;
+  __complex128 z1, z2;
 
- z1 = x;
- z2 = x / 7.Q;
- z2 /= z1;
+  z1 = x;
+  z2 = x / 7.Q;
+  z2 /= z1;
 
- return (__float128) z2;
+  return (__float128) z2;
 }
 
-__float128 bar (__float128 x)
+__float128 test_fabs (__float128 x)
 {
+  return __builtin_fabsq (x);
+}
+
+__float128 test_copysign (__float128 x, __float128 y)
+{
+  return __builtin_copysignq (x, y);
+}
+
+__float128 test_huge_val (__float128 x)
+{
   return x * __builtin_huge_valq ();
 }
 
+__float128 test_inf (__float128 x)
+{
+  return x * __builtin_infq ();
+}
+
+__float128 test_nan (__float128 x)
+{
+  return x * __builtin_nanq ("");
+}
+
 int
 main ()
 {
 
-foo (1.2Q);
-bar (1.2Q);
+test_cplx (1.2Q);
+test_fabs (1.2Q);
+test_copysign (1.2Q, -1.2Q);
+test_huge_val (1.2Q);
+test_inf (1.2Q);
+test_nan (1.2Q);
 
   ;
   return 0;
@@ -12561,29 +12585,53 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 
 typedef _Complex float __attribute__((mode(TC))) __complex128;
 
-__float128 foo (__float128 x)
+__float128 test_cplx (__float128 x)
 {
 
- __complex128 z1, z2;
+  __complex128 z1, z2;
 
- z1 = x;
- z2 = x / 7.Q;
- z2 /= z1;
+  z1 = x;
+  z2 = x / 7.Q;
+  z2 /= z1;
 
- return (__float128) z2;
+  return (__float128) z2;
 }
 
-__float128 bar (__float128 x)
+__float128 test_fabs (__float128 x)
 {
+  return __builtin_fabsq (x);
+}
+
+__float128 test_copysign (__float128 x, __float128 y)
+{
+  return __builtin_copysignq (x, y);
+}
+
+__float128 test_huge_val (__float128 x)
+{
   return x * __builtin_huge_valq ();
 }
 
+__float128 test_inf (__float128 x)
+{
+  return x * __builtin_infq ();
+}
+
+__float128 test_nan (__float128 x)
+{
+  return x * __builtin_nanq ("");
+}
+
 int
 main ()
 {
 
-foo (1.2Q);
-bar (1.2Q);
+test_cplx (1.2Q);
+test_fabs (1.2Q);
+test_copysign (1.2Q, -1.2Q);
+test_huge_val (1.2Q);
+test_inf (1.2Q);
+test_nan (1.2Q);
 
   ;
   return 0;
Index: configure.ac
===
--- configure.ac(revision 237340)
+++ configure.ac(working copy)
@@ -212,25 +212,49 @@ AC_CACHE_CHECK([whether __float128 is supported],
   [GCC_TRY_COMPILE_OR_LINK([
 typedef _Complex float __attribute__((mode(TC))) __complex128;
 
-__float128 foo (__float128 x)
+__float128 test_cplx (__float128 x)
 {
 
- __complex128 z1, z2;
+  __complex128 z1, z2;
 
- z1 = x;
- z2 = x / 7.Q;
- z2 /= z1;
+  z1 = x;
+  z2 = x / 7.Q;
+  z2 /= z1;
 
- return (__float128) z2;
+  return (

Re: [PATCH] fold-const: Don't access bit fields with too big mode (PR71310)

2016-06-12 Thread H.J. Lu
On Fri, Jun 10, 2016 at 5:12 PM, Segher Boessenkool
 wrote:
> On Fri, Jun 10, 2016 at 01:14:16PM -0600, Jeff Law wrote:
>> The change itself is fine, and it's approved with a testcase or at least
>> an explanation of why you can't turn either of the tests from the BZ
>> into a testcase in our framework.
>
> This is what I committed:
>
>
> 2016-06-11  Segher Boessenkool  
>
> PR middle-end/71310
> * fold-const.c (optimize_bit_field_compare): Don't try to use
> word_mode unconditionally for reading the bit field, look at
> DECL_BIT_FIELD_REPRESENTATIVE instead.
>
> gcc/testsuite/
> PR middle-end/71310
> * gcc.target/powerpc/pr71310.c: New testcase.
>
>

It caused:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71510


-- 
H.J.


Re: [PATCH 3/8] nvptx -muniform-simt

2016-06-12 Thread Sandra Loosemore

On 06/09/2016 10:53 AM, Alexander Monakov wrote:


[snip]

--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -19621,6 +19621,16 @@ for OpenMP offloading, but the option is exposed on 
its own for the purpose
  of testing the compiler; to generate code suitable for linking into programs
  using OpenMP offloading, use option @option{-mgomp}.

+@item -muniform-simt
+@opindex muniform-simt
+Generate code that allows to keep all lanes in each warp active, even when


Allows *what* to keep?  E.g. what is doing the keeping here?  If it is 
the generated code itself, please rephrase as


Generate code that keeps


+observable effects from execution should appear as if only one lane was


s/was/is/


+active. This is achieved by instrumenting syscalls and atomic instructions in
+a lightweight way that allows to switch behavior at runtime. This code


Same issue here  allows *what* to switch behavior?  (And how would 
you select which run-time behavior you want?)


Also, in the snippet above where it is used as a noun, please
s/runtime/run time/


+generation variant is used for OpenMP offloading, but the option is exposed on
+its own for the purpose of testing the compiler; to generate code suitable for
+linking into programs using OpenMP offloading, use option @option{-mgomp}.
+
  @end table

  @node PDP-11 Options


-Sandra



Re: [PATCH 4/8] nvptx -mgomp

2016-06-12 Thread Sandra Loosemore

On 06/09/2016 10:53 AM, Alexander Monakov wrote:


[snip]

--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -19631,6 +19631,11 @@ generation variant is used for OpenMP offloading, but 
the option is exposed on
  its own for the purpose of testing the compiler; to generate code suitable for
  linking into programs using OpenMP offloading, use option @option{-mgomp}.

+@item -mgomp
+@opindex mgomp
+Generate code for use in OpenMP offloading: enables @option{-msoft-stack} and


s/enables/enables the/


+@option{-muniform-simt} options, and selects corresponding multilib variant.


s/selects/selects the/


+
  @end table

  @node PDP-11 Options



The documentation part is OK with those changes.

-Sandra