Re: [AArch64][2/2] Implement -fpic for -mcmodel=small

2015-06-27 Thread Andreas Schwab
spawn -ignore SIGHUP /opt/gcc/gcc-20150627/Build/gcc/xgcc 
-B/opt/gcc/gcc-20150627/Build/gcc/ -fno-diagnostics-show-caret 
-fdiagnostics-color=never -O0 -w -fpie -c -o pr65593.o 
/opt/gcc/gcc-20150627/gcc/testsuite/gcc.c-torture/compile/pr65593.c
/tmp/cc0Pymaf.s: Assembler messages:
/tmp/cc0Pymaf.s:11: Error: unknown relocation modifier at operand 2 -- `ldr 
x0,[x0,#:gotpage_lo15:a]'
/tmp/cc0Pymaf.s:19: Error: unknown relocation modifier at operand 2 -- `ldr 
x2,[x0,#:gotpage_lo15:bar]'
compiler exited with status 1

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Re: C++ PATCH for c++/66255 (ICE with non-type template parameter of typedef type)

2015-06-27 Thread Andreas Schwab
* pt.c (check_unstripped_args): Mark parameter as unused.

diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 082e04c..ad2970d 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -1023,7 +1023,7 @@ optimize_specialization_lookup_p (tree tmpl)
gone through coerce_template_parms by now.  */
 
 static void
-check_unstripped_args (tree args)
+check_unstripped_args (tree args ATTRIBUTE_UNUSED)
 {
 #ifdef ENABLE_CHECKING
   ++processing_template_decl;
-- 
2.4.5

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Re: [AArch64][2/2] Implement -fpic for -mcmodel=small

2015-06-27 Thread Jiong Wang

Andreas Schwab writes:

> spawn -ignore SIGHUP /opt/gcc/gcc-20150627/Build/gcc/xgcc 
> -B/opt/gcc/gcc-20150627/Build/gcc/ -fno-diagnostics-show-caret 
> -fdiagnostics-color=never -O0 -w -fpie -c -o pr65593.o 
> /opt/gcc/gcc-20150627/gcc/testsuite/gcc.c-torture/compile/pr65593.c
> /tmp/cc0Pymaf.s: Assembler messages:
> /tmp/cc0Pymaf.s:11: Error: unknown relocation modifier at operand 2 -- `ldr 
> x0,[x0,#:gotpage_lo15:a]'
> /tmp/cc0Pymaf.s:19: Error: unknown relocation modifier at operand 2 --
> `ldr x2,[x0,#:gotpage_lo15:bar]'

Andreas,

  The binutils patch has been upstreamed already. Please checkout the
  latest binutils code.

  commit 99ad26cb0d4f9152dbe5ed03b74020cc52d84d94
  Author: Jiong Wang 
  Date:   Mon Jun 1 10:26:00 2015 +0100

[AArch64] BFD Support BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15

  Thanks.

-- 
Regards,
Jiong



Re: [AArch64][2/2] Implement -fpic for -mcmodel=small

2015-06-27 Thread Andreas Schwab
Jiong Wang  writes:

> Andreas Schwab writes:
>
>> spawn -ignore SIGHUP /opt/gcc/gcc-20150627/Build/gcc/xgcc 
>> -B/opt/gcc/gcc-20150627/Build/gcc/ -fno-diagnostics-show-caret 
>> -fdiagnostics-color=never -O0 -w -fpie -c -o pr65593.o 
>> /opt/gcc/gcc-20150627/gcc/testsuite/gcc.c-torture/compile/pr65593.c
>> /tmp/cc0Pymaf.s: Assembler messages:
>> /tmp/cc0Pymaf.s:11: Error: unknown relocation modifier at operand 2 -- `ldr 
>> x0,[x0,#:gotpage_lo15:a]'
>> /tmp/cc0Pymaf.s:19: Error: unknown relocation modifier at operand 2 --
>> `ldr x2,[x0,#:gotpage_lo15:bar]'
>
> Andreas,
>
>   The binutils patch has been upstreamed already. Please checkout the
>   latest binutils code.

That must work with the current binutils.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Re: [AArch64][2/2] Implement -fpic for -mcmodel=small

2015-06-27 Thread Jiong Wang

Andreas Schwab writes:

> Jiong Wang  writes:
>
>> Andreas Schwab writes:
>>
>>> spawn -ignore SIGHUP /opt/gcc/gcc-20150627/Build/gcc/xgcc 
>>> -B/opt/gcc/gcc-20150627/Build/gcc/ -fno-diagnostics-show-caret 
>>> -fdiagnostics-color=never -O0 -w -fpie -c -o pr65593.o 
>>> /opt/gcc/gcc-20150627/gcc/testsuite/gcc.c-torture/compile/pr65593.c
>>> /tmp/cc0Pymaf.s: Assembler messages:
>>> /tmp/cc0Pymaf.s:11: Error: unknown relocation modifier at operand 2 -- `ldr 
>>> x0,[x0,#:gotpage_lo15:a]'
>>> /tmp/cc0Pymaf.s:19: Error: unknown relocation modifier at operand 2 --
>>> `ldr x2,[x0,#:gotpage_lo15:bar]'
>>
>> Andreas,
>>
>>   The binutils patch has been upstreamed already. Please checkout the
>>   latest binutils code.
>
> That must work with the current binutils.

I see, agree.

Will adopt current ILP32 feature detection mechanism into -fpic.

And some new TLS patches may need similiar check also.

Thanks.

-- 
Regards,
Jiong



Re: [PATCH][5/n] Remove GENERIC stmt combining from SCCVN

2015-06-27 Thread Marc Glisse

On Fri, 26 Jun 2015, Richard Biener wrote:


+ /* Equality compare simplifications from fold_binary  */
+ (for cmp (eq ne)
+
+  /* If we have (A | C) == D where C & ~D != 0, convert this into 0.
+ Similarly for NE_EXPR.  */
+  (simplify
+   (cmp (convert?@3 (bit_ior @0 INTEGER_CST@1)) INTEGER_CST@2)
+   (if (tree_nop_conversion_p (TREE_TYPE (@3), TREE_TYPE (@0))
+&& wi::bit_and_not (@1, @2) != 0)
+{ constant_boolean_node (cmp == NE_EXPR, type); }))
+
+  /* (X ^ Y) == 0 becomes X == Y, and (X ^ Y) != 0 becomes X != Y.  */
+  (simplify
+   (cmp (bit_xor @0 @1) integer_zerop)
+   (cmp @0 @1))
+
+  /* (X ^ Y) == Y becomes X == 0.
+ Likewise (X ^ Y) == X becomes Y == 0.  */
+  (simplify
+   (cmp (bit_xor:c @0 @1) @0)


Don't you need cmp:c for this one? The transformation still somehow 
happens through forward_propagate_into_comparison, but it looks like an 
accident.



+   (cmp @1 { build_zero_cst (TREE_TYPE (@1)); }))
+
+  /* (X ^ C1) op C2 can be rewritten as X op (C1 ^ C2).  */
+  (simplify
+   (cmp (convert?@3 (bit_xor @0 INTEGER_CST@1)) INTEGER_CST@2)
+   (if (tree_nop_conversion_p (TREE_TYPE (@3), TREE_TYPE (@0)))
+(cmp @0 (bit_xor @1 (convert @2))


I guess we'll have to generalize this to vectors at some point...

--
Marc Glisse


Re: [PATCH] Move X - (X / Y) * Y folding to match.pd

2015-06-27 Thread Marc Glisse

On Fri, 26 Jun 2015, Marek Polacek wrote:


This is an attempt to move one pattern from fold-const.c to match.pd.
It ought to be 1:1, but is not, e.g. with this patch we won't fold e.g.

int
f (int a, int b)
{
 return a - (unsigned) ((a / b) * b)
}

anymore, but we're able to fold

int
ff (int a, unsigned int b)
{
 return a - ((a / b) * b);
}

and fold-const.c is not.  I played around with converts, but didn't find
anything that would work well.  Any suggestions how to make this pattern
better?


Anything wrong with this?

+/* X - (X / Y) * Y is the same as X % Y.  */
+(simplify
+ (minus (convert? @0) (convert? (mult (trunc_div @0 @1) @1)))
+ (if (INTEGRAL_TYPE_P (type) || VECTOR_INTEGER_TYPE_P (type))
+  (convert (trunc_mod @0 @1

(the other div/mod pairs could benefit from the same transformation as 
long as there are no conversions, but the conversion seems easier to 
handle with trunc_)



diff --git gcc/match.pd gcc/match.pd
index b2f8429..2bc158b 100644
--- gcc/match.pd
+++ gcc/match.pd
@@ -238,6 +238,12 @@ along with GCC; see the file COPYING3.  If not see
  && tree_nop_conversion_p (type, TREE_TYPE (@1)))
  (trunc_mod @0 (convert @1

+/* X - (X / Y) * Y is the same as X % Y.  */
+(simplify
+ (minus @0 (mult (trunc_div @0 @1) @1))
+ (if (INTEGRAL_TYPE_P (type) || VECTOR_INTEGER_TYPE_P (type))
+  (trunc_mod @0 @1)))
+
/* Optimize TRUNC_MOD_EXPR by a power of two into a BIT_AND_EXPR,
   i.e. "X % C" into "X & (C - 1)", if X and C are positive.
   Also optimize A % (C << N)  where C is a power of 2,

Marek



--
Marc Glisse


Re: [PATCH] Add support for exceptions to tsan (PR sanitizer/64265)

2015-06-27 Thread Dmitry Vyukov
Hi Jakub,

Do you plan to move forward with this patch? Is it waiting to be reviewed?
People keep asking about exception support for tsan (I guess it is
critical for a significant potion of C++ out there). I am trying to
sketch support in llvm. And I am leaning towards an approach similar
to yours, that is, add cleanup blocks in middle-end. I think it is
more portable and reliable then interception of __personality/_Unwind
routines.






On Mon, Dec 15, 2014 at 7:50 PM, Jakub Jelinek  wrote:
> Hi!
>
> As discussed in the PR, to support exceptions in -fsanitize=thread code,
> it is desirable to call __tsan_func_exit also when leaving functions by
> means of exceptions.
>
> Adding EH too late sounds too hard to me, so this patch instead adds an
> internal call during gimplification, makes sure the inliner removes the
> internal calls from the inline functions
> (we don't care about inlines, only about functions we emit), and
> for functions that didn't go through gimplify_function_tree (e.g. omp/tm
> etc. functions) just keeps using the old __tsan_func_exit additions.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux.  Ok for trunk?
>
> On:
> #include 
>
> int v;
>
> int
> foo (int x)
> {
>   if (x < 99)
> throw x;
>   v++;
>   return x;
> }
>
> void *
> tf (void *)
> {
>   for (int i = 0; i < 100; i++)
> try { foo (i); } catch (int) {}
>   return NULL;
> }
>
> int
> main ()
> {
>   pthread_t th;
>   if (pthread_create (&th, NULL, tf, NULL))
> return 0;
>   v++;
>   pthread_join (th, NULL);
>   return 0;
> }
>
> I used to get without this patch:
> ==
> WARNING: ThreadSanitizer: data race (pid=20449)
>   Read of size 4 at 0x006020e0 by thread T1:
> #0 foo(int) /usr/src/gcc/obj/gcc/ts.C:10 (ts+0x00400cb9)
> #1 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #2 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #3 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #4 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #5 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #6 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #7 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #8 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #9 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #10 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #11 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #12 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #13 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #14 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #15 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #16 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #17 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #18 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #19 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #20 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #21 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #22 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #23 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #24 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #25 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #26 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #27 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #28 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #29 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #30 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #31 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #32 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #33 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #34 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #35 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #36 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #37 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #38 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #39 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #40 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #41 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #42 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #43 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #44 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #45 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #46 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0x00400d13)
> #47 tf(void*) /usr/src/gcc/obj/gcc/ts.C:18 (ts+0

Re: [PATCH] Add support for exceptions to tsan (PR sanitizer/64265)

2015-06-27 Thread Jakub Jelinek
On Sat, Jun 27, 2015 at 04:53:22PM +0200, Dmitry Vyukov wrote:
> Do you plan to move forward with this patch? Is it waiting to be reviewed?
> People keep asking about exception support for tsan (I guess it is
> critical for a significant potion of C++ out there). I am trying to
> sketch support in llvm. And I am leaning towards an approach similar
> to yours, that is, add cleanup blocks in middle-end. I think it is
> more portable and reliable then interception of __personality/_Unwind
> routines.

It is already in GCC 5.1 and on the trunk too.

Jakub


Re: [PATCH] Add support for exceptions to tsan (PR sanitizer/64265)

2015-06-27 Thread Dmitry Vyukov
On Sat, Jun 27, 2015 at 7:12 PM, Jakub Jelinek  wrote:
> On Sat, Jun 27, 2015 at 04:53:22PM +0200, Dmitry Vyukov wrote:
>> Do you plan to move forward with this patch? Is it waiting to be reviewed?
>> People keep asking about exception support for tsan (I guess it is
>> critical for a significant potion of C++ out there). I am trying to
>> sketch support in llvm. And I am leaning towards an approach similar
>> to yours, that is, add cleanup blocks in middle-end. I think it is
>> more portable and reliable then interception of __personality/_Unwind
>> routines.
>
> It is already in GCC 5.1 and on the trunk too.

Great! Thanks
I've grepped "excep.*tsan" in ChangeLog, but found nothing. Nevermind


[PATCH] Fix PR c++/66686 (dependent template template substitution)

2015-06-27 Thread Patrick Palka
This patch makes coerce_template_template_parm consider a coercion
successful if the result of calling tsubst on a template template parm
is a dependent type even when the desired argument type is non-dependent.

For the test case below, TREE_TYPE (parm) is B and TREE_TYPE (arg) is
int.  After calling tsubst on the parm the resulting type is still B, a
dependent type.  Without checking that the resulting type is dependent,
the function would return 0 because same_type_p would return false.

Bootstrap + regtest of this change was successful on
x86_64-unknown-linux-gnu.  Does this patch look OK?

gcc/cp/ChangeLog:

* pt.c (coerce_template_template_parm) [PARM_DECL]: Don't
return 0 if tsubst returns a dependent type.

gcc/testsuite/ChangeLog:

* g++.dg/template/pr66686.C: New test.
---
 gcc/cp/pt.c | 12 +++-
 gcc/testsuite/g++.dg/template/pr66686.C | 15 +++
 2 files changed, 22 insertions(+), 5 deletions(-)
 create mode 100644 gcc/testsuite/g++.dg/template/pr66686.C

diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 2b37460..d7768a8 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -6357,11 +6357,13 @@ coerce_template_template_parm (tree parm,
   D d;
 
 i.e. the parameter list of TT depends on earlier parameters.  */
-  if (!uses_template_parms (TREE_TYPE (arg))
- && !same_type_p
-   (tsubst (TREE_TYPE (parm), outer_args, complain, in_decl),
-TREE_TYPE (arg)))
-   return 0;
+  if (!uses_template_parms (TREE_TYPE (arg)))
+   {
+ tree t = tsubst (TREE_TYPE (parm), outer_args, complain, in_decl);
+ if (!uses_template_parms (t)
+ && !same_type_p (t, TREE_TYPE (arg)))
+   return 0;
+   }
   
   if (TEMPLATE_PARM_PARAMETER_PACK (DECL_INITIAL (arg))
  && !TEMPLATE_PARM_PARAMETER_PACK (DECL_INITIAL (parm)))
diff --git a/gcc/testsuite/g++.dg/template/pr66686.C 
b/gcc/testsuite/g++.dg/template/pr66686.C
new file mode 100644
index 000..d8aea62
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/pr66686.C
@@ -0,0 +1,15 @@
+// PR c++/66686
+
+template 
+struct Y { };
+
+template  class Z> class C>
+struct X
+{
+  C a;  // { dg-bogus "mismatch" }
+};
+
+template  class>
+struct A { };
+
+X a;
-- 
2.5.0.rc0.5.g91e10c5.dirty



[wwwdocs] Adjust link for Cilk Plus

2015-06-27 Thread Gerald Pfeifer
cilk.org now has a permanent redirect to https://www.cilkplus.org.

Applied.

Gerald

Index: index.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/index.html,v
retrieving revision 1.975
diff -u -r1.975 index.html
--- index.html  26 Jun 2015 21:41:04 -  1.975
+++ index.html  27 Jun 2015 18:25:58 -
@@ -118,7 +118,7 @@
 
 Cilk Plus support in GCC
 [2014-09-02]
-Complete support for http://cilk.org";>Cilk Plus features 
was added to GCC.
+Complete support for https://www.cilkplus.org";>Cilk Plus 
features was added to GCC.
 Contributed by Jakub Jelinek, Aldy Hernandez, Balaji V. Iyer and Igor 
Zamyatin.
 
 New GCC version numbering scheme announced


[wwwdocs] Wikipedia now defaults to, and redirects to, https.

2015-06-27 Thread Gerald Pfeifer
Wikipedia now defaults to, and redirects to, https, so adjust
our links.

Applied.

Gerald

Index: codingconventions.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/codingconventions.html,v
retrieving revision 1.72
diff -u -r1.72 codingconventions.html
--- codingconventions.html  25 Jun 2015 18:31:51 -  1.72
+++ codingconventions.html  27 Jun 2015 18:44:27 -
@@ -845,7 +845,7 @@
 
 
 Use the struct keyword for
-http://en.wikipedia.org/wiki/Plain_old_data_structure";>
+https://en.wikipedia.org/wiki/Plain_old_data_structure";>
 plain old data (POD) types.
 
 
@@ -857,14 +857,14 @@
 
 
 Use the class keyword for 
-http://en.wikipedia.org/wiki/Plain_old_data_structure";>
+https://en.wikipedia.org/wiki/Plain_old_data_structure";>
 non-POD types.
 
 
 
 A non-POD type will often (but not always)
 have a declaration of a
-http://en.wikipedia.org/wiki/Special_member_functions";>
+https://en.wikipedia.org/wiki/Special_member_functions";>
 special member function.
 If any one of these is declared,
 then all should be either declared
Index: readings.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/readings.html,v
retrieving revision 1.237
diff -u -r1.237 readings.html
--- readings.html   9 Apr 2015 21:43:51 -   1.237
+++ readings.html   27 Jun 2015 18:44:27 -
@@ -634,7 +634,7 @@
   Among IEEE 754 Implementations
   by Doug Priest (included in the PostScript-format document above)
 
-  http://en.wikipedia.org/wiki/IEEE_754r";>IEEE 754r, an
+  https://en.wikipedia.org/wiki/IEEE_754r";>IEEE 754r, an
   ongoing revision to the IEEE 754 floating point standard.
 
   http://www.tru64unix.compaq.com/docs/base_doc/DOCUMENTATION/V51_HTML/SUPPDOCS/OBJSPEC/TITLE.HTM";>


[wwwdocs] The C++ ABI specification has moved again

2015-06-27 Thread Gerald Pfeifer
...so adjust all the links.  Applied.

Gerald

Index: faq.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/faq.html,v
retrieving revision 1.220
diff -u -r1.220 faq.html
--- faq.html29 Jun 2014 20:12:59 -  1.220
+++ faq.html27 Jun 2015 19:25:29 -
@@ -429,7 +429,7 @@
 
 For more details about the way that GCC implements these and other
 C++ features, please read the http://mentorembedded.github.com/cxx-abi/";>C++ ABI specification.
+href="http://mentorembedded.github.io/cxx-abi/";>C++ ABI specification.
 Note the std::type_info objects which must be
 resolved all begin with "_ZTS". Refer to ld's
 documentation for a description of the "-E" &
Index: readings.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/readings.html,v
retrieving revision 1.238
diff -u -r1.238 readings.html
--- readings.html   27 Jun 2015 18:46:13 -  1.238
+++ readings.html   27 Jun 2015 19:25:29 -
@@ -37,7 +37,7 @@
   by Joachim Nadler and Tim Josling
   t...@melbpc.org.au>.
 
-  http://mentorembedded.github.com/cxx-abi/";>
+  http://mentorembedded.github.io/cxx-abi/";>
   The V3 multi-vendor standard C++ ABI is used in GCC releases 3.0 and
   above.
 
Index: gcc-4.0/changes.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.0/changes.html,v
retrieving revision 1.66
diff -u -r1.66 changes.html
--- gcc-4.0/changes.html28 Jun 2014 22:44:28 -  1.66
+++ gcc-4.0/changes.html27 Jun 2015 19:25:30 -
@@ -182,7 +182,7 @@
 -fvisibility option.
 
 The compiler now uses the library interface specified by the http://mentorembedded.github.com/cxx-abi/";>C++ ABI for
+href="http://mentorembedded.github.io/cxx-abi/";>C++ ABI for
 thread-safe initialization of function-scope static variables.
 Most users should leave this alone, but embedded programmers may
 want to disable this by specifying


[PATCH, C++-1z] Implement N4197 - Adding u8 character literals

2015-06-27 Thread Ed Smith-Rowland

I apologize to all who got this earlier.
I forgot to send to the list.

This patch adds UTF-8 character literals to C++:

auto c = u8'c';

This is mostly a straight forward preprocessor exercise.
I only allow these characters in -std=c++1z and -std=gnu++1z.
I figure we can expand that easily with or without some pedwarn.

In c-ada-specs.c/print_ada_macros() I just write these as a char 
constant rather than spelling the token.
We could do the latter.  You'd see the "u8" then I think.  I couldn't 
find in the Ada test suite where this was exercised.


That's all that seems controversial to me.

Built and tested clean on x86_64-linux.

Ed




libcpp:

2015-06-28  Edward Smith-Rowland  <3dw...@verizon.net>

Implement N4197 - Adding u8 character literals
* include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
(struct cpp_options): Add utf8_char_literals.
* init.c (struct lang_flags): Add utf8_char_literals;
(struct lang_flags lang_defaults): Add column for utf8_char_literals.
* macro.c (stringify_arg()): Treat CPP_UTF8CHAR token; 
* expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
(cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
(eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
* lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
* charset.c (converter_for_type(), cpp_interpret_charconst()):
Treat CPP_UTF8CHAR token.


gcc/c-family:

2015-06-28  Edward Smith-Rowland  <3dw...@verizon.net>

Implement N4197 - Adding u8 character literals
* c-family/c-ada-spec.c (print_ada_macros()): Treat CPP_UTF8CHAR
like CPP_CHAR.
* c-family/c-common.c (c_parse_error()): print CPP_UTF8CHAR
and CPP_UTF8CHAR_USERDEF tokens.
* c-family/c-lex.c (c_lex_with_flags()): Treat CPP_UTF8CHAR_USERDEF
and CPP_UTF8CHAR tokens; (lex_charconst()): Treat CPP_UTF8CHAR token.


gcc/cp:

2015-06-28  Edward Smith-Rowland  <3dw...@verizon.net>

Implement N4197 - Adding u8 character literals
* parser.c (cp_parser_primary_expression()): Treat CPP_UTF8CHAR
and CPP_UTF8CHAR_USERDEF tokens;
(cp_parser_parenthesized_expression_list()): Treat CPP_UTF8CHAR token.


gcc/testsuite:

2015-06-28  Edward Smith-Rowland  <3dw...@verizon.net>

Implement N4197 - Adding u8 character literals
* g++.dg/cpp1z/utf8.C: New.
* g++.dg/cpp1z/utf8-neg.C: New.
* g++.dg/cpp1z/udlit-utf8char.C: New.


Index: libcpp/include/cpplib.h
===
--- libcpp/include/cpplib.h (revision 225099)
+++ libcpp/include/cpplib.h (working copy)
@@ -119,6 +119,7 @@
   TK(WCHAR,LITERAL) /* L'char' */  \
   TK(CHAR16,   LITERAL) /* u'char' */  \
   TK(CHAR32,   LITERAL) /* U'char' */  \
+  TK(UTF8CHAR, LITERAL) /* u8'char' */ \
   TK(OTHER,LITERAL) /* stray punctuation */\
\
   TK(STRING,   LITERAL) /* "string" */ \
@@ -133,6 +134,7 @@
   TK(WCHAR_USERDEF,LITERAL) /* L'char'_suffix - C++-0x */  \
   TK(CHAR16_USERDEF,   LITERAL) /* u'char'_suffix - C++-0x */  \
   TK(CHAR32_USERDEF,   LITERAL) /* U'char'_suffix - C++-0x */  \
+  TK(UTF8CHAR_USERDEF, LITERAL) /* u8'char'_suffix - C++-0x */ \
   TK(STRING_USERDEF,   LITERAL) /* "string"_suffix - C++-0x */ \
   TK(WSTRING_USERDEF,  LITERAL) /* L"string"_suffix - C++-0x */\
   TK(STRING16_USERDEF, LITERAL) /* u"string"_suffix - C++-0x */\
@@ -339,6 +341,9 @@
   /* Nonzero means process u/U prefix literals (UTF-16/32).  */
   unsigned char uliterals;
 
+  /* Nonzero means process u8 prefixed character literals (UTF-8).  */
+  unsigned char utf8_char_literals;
+
   /* Nonzero means process r/R raw strings.  If this is set, uliterals
  must be set as well.  */
   unsigned char rliterals;
Index: libcpp/init.c
===
--- libcpp/init.c   (revision 225099)
+++ libcpp/init.c   (working copy)
@@ -90,26 +90,27 @@
   char binary_constants;
   char digit_separators;
   char trigraphs;
+  char utf8_char_literals;
 };
 
 static const struct lang_flags lang_defaults[] =
-{ /*  c99 c++ xnum xid c11 std digr ulit rlit udlit bincst digsep 
trig */
-  /* GNUC89   */  { 0,  0,  1,  0,  0,  0,  1,   0,   0,   0,0, 0, 
0 },
-  /* GNUC99   */  { 1,  0,  1,  1,  0,  0,  1,   1,   1,   0,0, 0, 
0 },
-  /* GNUC11   */  { 1,  0,  1,  1,  1,  0,  1,   1,   1,   0,0, 0, 
0 },
-  /* STDC89   */  { 0,  0,  0,  0,  0,  1,  0,   0,   0,   0,