Re: [Patch, fortran] PR57284 - [OOP] ICE with find_array_spec for polymorphic arrays

2019-04-21 Thread Paul Richard Thomas
Thanks, Steve.

Committed as revision 270489.

Paul

On Fri, 19 Apr 2019 at 18:28, Steve Kargl
 wrote:
>
> On Fri, Apr 19, 2019 at 06:19:00PM +0100, Paul Richard Thomas wrote:
> > The part of this patch in resolve.c had essentially already been
> > sorted out by Tobias Burnus in comment #2 of the PR. I suspect that he
> > must have been put off the trail by the segfault that occurred when
> > this was implemented. In the end, the reason for the segfault is quite
> > straight forward and comes about because the temporary declarations
> > representing class actual arguments cause gfc_conv_component_ref to
> > barf, when porcessing the _data component. However, they are amenable
> > to gfc_class_data_get and so this is used in the fix.
> >
> > Bootstrapped and regtested on FC29/x86_64 - OK for trunk?
> >
>
> Looks good to me.  Where are we in the release cycle?
> Do you need release manager approval to apply the
> patch?
>
> --
> Steve



-- 
"If you can't explain it simply, you don't understand it well enough"
- Albert Einstein


[PATCH, PR d/90130] Committed dmd fixes for big endian targets

2019-04-21 Thread Iain Buclaw
Hi,

This patch merges the D front-end implementation with dmd upstream 065fbd452.

Fixes one endian bug in CTFE, and corrects tests in the D2 testsuite
that failed on big endian targets.

Boostrapped and regression tested on x86_64-linux-gnu.

Committed to trunk as r270485.

-- 
Iain
---
diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE
index be0c5a50da2..c360fe5c2ed 100644
--- a/gcc/d/dmd/MERGE
+++ b/gcc/d/dmd/MERGE
@@ -1,4 +1,4 @@
-c185f9df1789456c7d88d047f2df23dd784f1182
+065fbd452f2aa498fc3a554be48a5495bd98aa14
 
 The first line of this file holds the git revision number of the last
 merge done from the dlang/dmd repository.
diff --git a/gcc/d/dmd/constfold.c b/gcc/d/dmd/constfold.c
index ddd356bb966..ed3e7491983 100644
--- a/gcc/d/dmd/constfold.c
+++ b/gcc/d/dmd/constfold.c
@@ -1752,14 +1752,16 @@ UnionExp Cat(Type *type, Expression *e1, Expression *e2)
 }
 else if (e1->op == TOKint64 && e2->op == TOKstring)
 {
-// Concatenate the strings
+// [w|d]?char ~ string --> string
+// We assume that we only ever prepend one char of the same type
+// (wchar,dchar) as the string's characters.
 StringExp *es2 = (StringExp *)e2;
 size_t len = 1 + es2->len;
 unsigned char sz = es2->sz;
 dinteger_t v = e1->toInteger();
 
 void *s = mem.xmalloc((len + 1) * sz);
-memcpy((char *)s, &v, sz);
+Port::valcpy((char *)s, v, sz);
 memcpy((char *)s + sz, es2->string, es2->len * sz);
 
 // Add terminating 0
diff --git a/gcc/testsuite/gdc.test/runnable/mars1.d b/gcc/testsuite/gdc.test/runnable/mars1.d
index 1f4e55d9ac4..91d93dbf81e 100644
--- a/gcc/testsuite/gdc.test/runnable/mars1.d
+++ b/gcc/testsuite/gdc.test/runnable/mars1.d
@@ -238,13 +238,13 @@ void test13023(ulong n)
 
 struct U { int a; union { char c; int d; } long b; }
 
-U f = { b:3, d:2, a:1 };
+U f = { b:3, d:0x, a:1 };
 
 void testU()
 {
 assert(f.b == 3);
-assert(f.d == 2);
-assert(f.c == 2);
+assert(f.d == 0x);
+assert(f.c == 0x22);
 assert(f.a == 1);
 assert(f.sizeof == 16);
 assert(U.sizeof == 16);
diff --git a/gcc/testsuite/gdc.test/runnable/test12.d b/gcc/testsuite/gdc.test/runnable/test12.d
index 7656de70af6..2b1fb0e62f7 100644
--- a/gcc/testsuite/gdc.test/runnable/test12.d
+++ b/gcc/testsuite/gdc.test/runnable/test12.d
@@ -622,9 +622,12 @@ struct S29 {
 
 int hoge(S29 s) {
 char[10] b;
-printf("%x\n", s);
-sprintf(b.ptr, "%x", s);
-assert(b[0 .. 7] == "4030201");
+printf("%x\n", *cast(int*)&s);
+sprintf(b.ptr, "%x", *cast(int*)&s);
+version (LittleEndian)
+assert(b[0 .. 7] == "4030201");
+version (BigEndian)
+assert(b[0 .. 7] == "1020304");
 return 0;
 }
 
diff --git a/gcc/testsuite/gdc.test/runnable/test23.d b/gcc/testsuite/gdc.test/runnable/test23.d
index ee17be0b00f..f43f6a46091 100644
--- a/gcc/testsuite/gdc.test/runnable/test23.d
+++ b/gcc/testsuite/gdc.test/runnable/test23.d
@@ -553,19 +553,22 @@ void test24()
 
 void test25()
 {
-  char[6] cstr = "123456"c;
-  auto str1 = cast(wchar[3])(cstr);
-
-  writefln("str1: ", (cast(char[])str1).length , " : ", (cast(char[])str1));
-  assert(cast(char[])str1 == "123456"c);
-
-  auto str2 = cast(wchar[3])("789abc"c);
-  writefln("str2: ", (cast(char[])str2).length , " : ", (cast(char[])str2));
-  assert(cast(char[])str2 == "789abc"c);
-
-  auto str3 = cast(wchar[3])("defghi");
-  writefln("str3: ", (cast(char[])str3).length , " : ", (cast(char[])str3));
-  assert(cast(char[])str3 == "d\000e\000f\000"c);
+char[6] cstr = "123456"c;
+auto str1 = cast(wchar[3])(cstr);
+
+writefln("str1: ", (cast(char[])str1).length , " : ", (cast(char[])str1));
+assert(cast(char[])str1 == "123456"c);
+
+auto str2 = cast(wchar[3])("789abc"c);
+writefln("str2: ", (cast(char[])str2).length , " : ", (cast(char[])str2));
+assert(cast(char[])str2 == "789abc"c);
+
+auto str3 = cast(wchar[3])("defghi");
+writefln("str3: ", (cast(char[])str3).length , " : ", (cast(char[])str3));
+version (LittleEndian)
+assert(cast(char[])str3 == "d\000e\000f\000"c);
+version (BigEndian)
+assert(cast(char[])str3 == "\000d\000e\000f"c);
 }
 
 /***/


[PATCH] LRA: Revert "Remove useless move insns"

2019-04-21 Thread H.J. Lu
On Sat, Apr 20, 2019 at 2:54 PM Vladimir Makarov  wrote:
>
>
> On 4/20/19 4:55 AM, Uros Bizjak wrote:
> > On 4/20/19, Vladimir Makarov  wrote:
> >> On 11/21/18 2:33 PM, Uros Bizjak wrote:
> >>> Hello!
> >>>
> >>> Before the recent patch to post-reload mode switching, vzeroupper
> >>> insertion depended on the existence of the return copy instructions
> >>> pair in functions that return a value. The first instruction in the
> >>> pair represents a move to a function return hard register, and the
> >>> second was a USE of the function return hard register. Sometimes a nop
> >>> move was generated (e.g. %eax->%eax) for the first instruction of the
> >>> return copy instructions pair and the patch [1] teached LRA  to remove
> >>> these useless instructions on the fly.
> >>>
> >>> The removal caused optimize mode switching to trigger the assert,
> >>> since the first instruction of a return pair was not found. The
> >>> relevant part of the patch was later reverted. With the recent
> >>> optimize mode switching patch, this is no longer necessary for
> >>> vzeroupper insertion pass, so attached patch reverts the revert.
> >>>
> >>> 2018-11-21  Uros Bizjak  
> >>>
> >>>   Revert the revert:
> >>>   2013-10-26  Vladimir Makarov  
> >>>
> >>>   Revert:
> >>>   2013-10-25  Vladimir Makarov  
> >>>
> >>>   * lra-spills.c (lra_final_code_change): Remove useless move insns.
> >>>
> >>> Patch was bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.
> >>>
> >>> OK for mainline?
> >> Sure, Uros. I support the patch.  But I think it would be wise to
> >> postpone its committing after releasing GCC-9.  Simply it is hard to
> >> predict the patch effect to other targets and I would avoid any risk at
> >> this stage.
> > Actually, the "revert of the revert" patch was already committed to
> > mainline some time ago.
>
> Sorry for confusion, Uros. I did not check the date of your original
> posting.  Insn removal was added to RA just to avoid wasting CPU cycles
> on such insn processing afterwards.  Such insns are removed anyway later
> in the pass pipeline.  The CPU time savings are tiny but the removal
> creates too many problems including new one PR90178.  I should have
> avoided to put this code in the first place.
>
> I think we should remove this code forever. It is not convenient for me
> to do this now because I am traveling.  If somebody wants to remove the
> code, i am approving this in advance.

I am checking in this patch.

Thanks.

>
> > To clear the possible misunderstanding, let me summarise the issue:
> >
> > - the original patch that remove useless move insn caused a breakage
> > in vzeroupper pass.
> > - the original patch was reverted due to the above breakage
> > - the vzeroupper pass was later adjusted to tolerate removed useless
> > move instructions, and this cleared the way to revert the revert. Now
> > LRA removes useless move insns.
> >
> > An orthogonal issue (PR90178) was discovered, showing that some passes
> > also depend on the presence of useless move insn.
> >
> > The bisection stumbled on the "revert of the revert" patch that
> > (obviously) re-introduced the issue. I'm not in the position to decide
> > if useless move insn can be removed or if these later passes should be
> > fixed, I can only say that the vzeroupper pass is now agnostic to the
> > presence of useless move insns.
> >
> > Uros.



-- 
H.J.
From ec029333fe6b3bed32c72dd4192c54a005e3fcb3 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" 
Date: Sun, 21 Apr 2019 11:00:24 -0700
Subject: [PATCH] LRA: Revert "Remove useless move insns"

Useless move insn removal was added to LRA just to avoid wasting CPU
cycles on such insn processing afterwards.  Such insns are removed
anyway later in the pass pipeline.  The CPU time savings are tiny but
the removal creates too many problems including PR target/90178.
Vladimir pre-approved the patch to remove the code:

https://gcc.gnu.org/ml/gcc-patches/2019-04/msg00834.html

gcc/

	PR target/90178
	Revert:
	2018-11-21  Uros Bizjak  

	Revert the revert:
	2013-10-26  Vladimir Makarov  

	Revert:
	2013-10-25  Vladimir Makarov  

	* lra-spills.c (lra_final_code_change): Remove useless move insns.

gcc/testsuite/

	PR target/90178
	* gcc.target/i386/pr90178.c: New test.
---
 gcc/ChangeLog   | 14 ++
 gcc/lra-spills.c| 15 ---
 gcc/testsuite/ChangeLog |  5 +
 gcc/testsuite/gcc.target/i386/pr90178.c | 13 +
 4 files changed, 32 insertions(+), 15 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/i386/pr90178.c

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8b09eecfbfe..d2446815605 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,17 @@
+2019-04-21  H.J. Lu  
+
+	PR target/90178
+	Revert:
+	2018-11-21  Uros Bizjak  
+
+	Revert the revert:
+	2013-10-26  Vladimir Makarov  
+
+	Revert:
+	2013-10-25  Vladimir Makarov  
+
+	* lra-spills.c (lra_final_code_change): Remove us

Re: [PATCH] PR fortran/90166 -- check F2018:C1547

2019-04-21 Thread Steve Kargl
On Sat, Apr 20, 2019 at 09:51:11PM +0200, Dominique d'Humières wrote:
> OK I missed the previous error. However I am still puzzled by (2):
> 
> +
> +found outside of a module
> 

Why are you puzzled?  Did you read the patch?  The
entire error message is 

+   gfc_error ("MODULE prefix at %C found outside of a module, "
+"submodule, or interface");

In 

   program foo
 contains
 module subroutine foo
 end subroutine foo
   end program foo

The "MODULE prefix" attached to "subroutine foo" is
found outside of a module, a submodule, or interface.

-- 
Steve


Re: [PATCH] Fix PR90131, wrong-debug

2019-04-21 Thread Richard Biener
On Fri, 19 Apr 2019, Jeff Law wrote:

> On 4/19/19 3:26 AM, Jakub Jelinek wrote:
> > On Thu, Apr 18, 2019 at 11:20:32AM +0200, Richard Biener wrote:
> >>
> >> This fixes another case similar to the fixed PR89892, mergephi
> >> via remove_forwarder_block_with_phi caused out-of-date debug
> >> binds to become live and thus needs similar treatment as
> >> remove_forwarder_block.  Previously it didn't even bother
> >> to move debug stmts because the destination always has
> >> multiple predecessors.  Now we have to move and reset them.
> >>
> >> Fixed by factoring out a worker from remove_forwarder_block and
> >> using that from remove_forwarder_block_with_phi as well.
> >>
> >> Bootstrap & regtest running on x86_64-unknown-linux-gnu.
> > 
> > This regressed quite a few guality tests on both x86_64 and i686:
> > +FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 
> > x == 36
> > +FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 
> > y == 25
> > +FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 
> > z == 6
> > +FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 
> > x == 98
> > +FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 
> > y == 117
> > +FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 
> > z == 8
> > +FAIL: gcc.dg/guality/pr54519-2.c   -O2 -flto -fuse-linker-plugin 
> > -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 17 x == 6
> > +FAIL: gcc.dg/guality/pr54519-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 
> > x == 6
> > +FAIL: gcc.dg/guality/pr54519-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 
> > y == 25
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 20 x 
> > == 36
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 20 y 
> > == 25
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 20 z 
> > == 6
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 23 x 
> > == 98
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 23 y 
> > == 117
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 23 z 
> > == 8
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fno-use-linker-plugin 
> > -flto-partition=none  -DPREVENT_OPTIMIZATION line 20 x == 36
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fno-use-linker-plugin 
> > -flto-partition=none  -DPREVENT_OPTIMIZATION line 23 x == 98
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fuse-linker-plugin 
> > -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 20 x == 36
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fuse-linker-plugin 
> > -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 23 x == 98
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 
> > x == 36
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 
> > y == 25
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 
> > z == 6
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 
> > x == 98
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 
> > y == 117
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 
> > z == 8
> > +FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 20 x 
> > == 36
> > +FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 20 y 
> > == 25
> > +FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 20 z 
> > == 6
> > +FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 23 x 
> > == 98
> > +FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 23 y 
> > == 117
> > +FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 23 z 
> > == 8
> > +FAIL: gcc.dg/guality/pr54519-4.c   -O2  -DPREVENT_OPTIMIZATION  line 17 x 
> > == 6
> > +FAIL: gcc.dg/guality/pr54519-4.c   -O2  -DPREVENT_OPTIMIZATION  line 17 y 
> > == 25
> > +FAIL: gcc.dg/guality/pr54519-4.c   -O2 -flto -fno-use-linker-plugin 
> > -flto-partition=none  -DPREVENT_OPTIMIZATION line 17 x == 6
> > +FAIL: gcc.dg/guality/pr54519-4.c   -O2 -flto -fuse-linker-plugin 
> > -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 17 x == 6
> > +FAIL: gcc.dg/guality/pr54519-4.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 
> > x == 6
> > +FAIL: gcc.dg/guality/pr54519-4.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 
> > y == 25
> > +FAIL: gcc.dg/guality/pr54519-4.c   -Os  -DPREVENT_OPTIMIZATION  line 17 x 
> > == 6
> > +FAIL: gcc.dg/guality/pr54519-4.c   -Os  -DPREVENT_OPTIMIZATION  line 17 y 
> > == 25
> > +FAIL: gcc.dg/guality/pr54519-5.c   -O2 -flto -fuse-linker-plugin 
> > -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 17 x == 6
> > +FAIL: gcc.dg/guality/pr54519-5.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 
> > x == 6
> > +FAIL: gcc.dg/guality/pr54519-5.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 1

[PATCH, libphobos] Committed merge with upstream phobos 428460ddd

2019-04-21 Thread Iain Buclaw
Hi,

This patch merges the libphobos library with upstream phobos 428460ddd.

Defines growDownwards on SPARC64, fixing PR d/90064, and backports
another fix to std.process, allowing permissions tests to be skipped
when running as root.

Bootstrapped and regression tested on x86_64-linux-gnu.

Committed to trunk as r270483.

-- 
Iain
---
diff --git a/libphobos/src/MERGE b/libphobos/src/MERGE
index b4d44b55624..3935c059403 100644
--- a/libphobos/src/MERGE
+++ b/libphobos/src/MERGE
@@ -1,4 +1,4 @@
-cf95639ffd9ed6f3b9d10d98461b2fbd31615757
+428460ddd8087fa28815e613ff04facb51108a7b
 
 The first line of this file holds the git revision number of the last
 merge done from the dlang/phobos repository.
diff --git a/libphobos/src/std/experimental/allocator/building_blocks/region.d b/libphobos/src/std/experimental/allocator/building_blocks/region.d
index 3d8431c23ca..43dfdb788e5 100644
--- a/libphobos/src/std/experimental/allocator/building_blocks/region.d
+++ b/libphobos/src/std/experimental/allocator/building_blocks/region.d
@@ -395,6 +395,7 @@ struct InSituRegion(size_t size, size_t minAlign = platformAlignment)
 else version (RISCV32) enum growDownwards = Yes.growDownwards;
 else version (RISCV64) enum growDownwards = Yes.growDownwards;
 else version (SPARC) enum growDownwards = Yes.growDownwards;
+else version (SPARC64) enum growDownwards = Yes.growDownwards;
 else version (SystemZ) enum growDownwards = Yes.growDownwards;
 else static assert(0, "Dunno how the stack grows on this architecture.");
 
diff --git a/libphobos/src/std/process.d b/libphobos/src/std/process.d
index a1cac2c9fdf..b0310a870d9 100644
--- a/libphobos/src/std/process.d
+++ b/libphobos/src/std/process.d
@@ -1188,13 +1188,16 @@ version (Posix) @system unittest
 // can't run in directory if user does not have search permission on this directory
 version (Posix)
 {
-import core.sys.posix.sys.stat : S_IRUSR;
-auto directoryNoSearch = uniqueTempPath();
-mkdir(directoryNoSearch);
-scope(exit) rmdirRecurse(directoryNoSearch);
-setAttributes(directoryNoSearch, S_IRUSR);
-assertThrown!ProcessException(spawnProcess(prog.path, null, Config.none, directoryNoSearch));
-assertThrown!ProcessException(spawnProcess(prog.path, null, Config.detached, directoryNoSearch));
+if (core.sys.posix.unistd.getuid() != 0)
+{
+import core.sys.posix.sys.stat : S_IRUSR;
+auto directoryNoSearch = uniqueTempPath();
+mkdir(directoryNoSearch);
+scope(exit) rmdirRecurse(directoryNoSearch);
+setAttributes(directoryNoSearch, S_IRUSR);
+assertThrown!ProcessException(spawnProcess(prog.path, null, Config.none, directoryNoSearch));
+assertThrown!ProcessException(spawnProcess(prog.path, null, Config.detached, directoryNoSearch));
+}
 }
 }
 


[PATCH, libphobos] Committed merge with upstream druntime 4b2674b3

2019-04-21 Thread Iain Buclaw
Hi,

This patch merges the libdruntime sub-library with upstream druntime 4b2674b3.

Adds version (BacktraceExternal) for using libexecinfo instead of
internal implementation on FreeBSD, NetBSD, and DragonFly.

Bootstrapped and regression tested on x86_64-linux-gnu, with
preliminary build testing done on x86_64-freebsd11.2,
x86_64-dragonfly5.4, and x86_64-netbsd8.0.

Committed to trunk as r270482.

-- 
Iain
---
diff --git a/libphobos/libdruntime/MERGE b/libphobos/libdruntime/MERGE
index dd5f621082f..405be921eb3 100644
--- a/libphobos/libdruntime/MERGE
+++ b/libphobos/libdruntime/MERGE
@@ -1,4 +1,4 @@
-70b9fea60246e63d936ad6826b1b48b6e0f1de8f
+4b2674b36b1f6aac75db2a5aa38d67d4be55a987
 
 The first line of this file holds the git revision number of the last
 merge done from the dlang/druntime repository.
diff --git a/libphobos/libdruntime/core/runtime.d b/libphobos/libdruntime/core/runtime.d
index 0ead04752e4..1fd54407aa5 100644
--- a/libphobos/libdruntime/core/runtime.d
+++ b/libphobos/libdruntime/core/runtime.d
@@ -519,9 +519,8 @@ extern (C) bool runModuleUnitTests()
 {
 static enum MAXFRAMES = 128;
 void*[MAXFRAMES]  callstack;
-int   numframes;
 
-numframes = backtrace( callstack.ptr, MAXFRAMES );
+auto numframes = backtrace( callstack.ptr, MAXFRAMES );
 backtrace_symbols_fd( callstack.ptr, numframes, 2 );
 }
 
diff --git a/libphobos/libdruntime/core/sys/dragonflybsd/execinfo.d b/libphobos/libdruntime/core/sys/dragonflybsd/execinfo.d
index 9d2d615f786..9f91a0be6ca 100644
--- a/libphobos/libdruntime/core/sys/dragonflybsd/execinfo.d
+++ b/libphobos/libdruntime/core/sys/dragonflybsd/execinfo.d
@@ -9,125 +9,139 @@
 module core.sys.dragonflybsd.execinfo;
 
 version (DragonFlyBSD):
+extern (C):
+nothrow:
 
-extern (C) nothrow @system:
+version (GNU)
+version = BacktraceExternal;
 
-import core.sys.dragonflybsd.dlfcn;
-
-// Use extern (D) so that these functions don't collide with libexecinfo.
-
-extern (D) int backtrace(void** buffer, int size)
+version (BacktraceExternal)
 {
-import core.thread : thread_stackBottom;
-
-void** p, pend=cast(void**)thread_stackBottom();
-version (D_InlineAsm_X86)
-asm nothrow @trusted { mov p[EBP], EBP; }
-else version (D_InlineAsm_X86_64)
-asm nothrow @trusted { mov p[RBP], RBP; }
-else
-static assert(false, "Architecture not supported.");
-
-int i;
-for (; i < size && p < pend; ++i)
-{
-buffer[i] = *(p + 1);
-auto pnext = cast(void**)*p;
-if (pnext <= p) break;
-p = pnext;
-}
-return i;
+size_t backtrace(void**, size_t);
+char** backtrace_symbols(const(void*)*, size_t);
+void backtrace_symbols_fd(const(void*)*, size_t, int);
+char** backtrace_symbols_fmt(const(void*)*, size_t, const char*);
+int backtrace_symbols_fd_fmt(const(void*)*, size_t, int, const char*);
 }
+else
+{
+import core.sys.dragonflybsd.dlfcn;
 
+// Use extern (D) so that these functions don't collide with libexecinfo.
 
-extern (D) char** backtrace_symbols(const(void*)* buffer, int size)
-{
-static void* realloc(void* p, size_t len) nothrow
+extern (D) int backtrace(void** buffer, int size)
 {
-static import cstdlib=core.stdc.stdlib;
-auto res = cstdlib.realloc(p, len);
-if (res is null) cstdlib.free(p);
-return res;
+import core.thread : thread_stackBottom;
+
+void** p, pend=cast(void**)thread_stackBottom();
+version (D_InlineAsm_X86)
+asm nothrow @trusted { mov p[EBP], EBP; }
+else version (D_InlineAsm_X86_64)
+asm nothrow @trusted { mov p[RBP], RBP; }
+else
+static assert(false, "Architecture not supported.");
+
+int i;
+for (; i < size && p < pend; ++i)
+{
+buffer[i] = *(p + 1);
+auto pnext = cast(void**)*p;
+if (pnext <= p) break;
+p = pnext;
+}
+return i;
 }
 
-if (size <= 0) return null;
-
-size_t pos = size * (char*).sizeof;
-char** p = cast(char**)realloc(null, pos);
-if (p is null) return null;
 
-Dl_info info;
-foreach (i, addr; buffer[0 .. size])
+extern (D) char** backtrace_symbols(const(void*)* buffer, int size)
 {
-if (dladdr(addr, &info) == 0)
-(cast(ubyte*)&info)[0 .. info.sizeof] = 0;
-fixupDLInfo(addr, info);
-
-immutable len = formatStackFrame(null, 0, addr, info);
-assert(len > 0);
-
-p = cast(char**)realloc(p, pos + len);
+static void* realloc(void* p, size_t len) nothrow
+{
+static import cstdlib=core.stdc.stdlib;
+auto res = cstdlib.realloc(p, len);
+if (res is null) cstdlib.free(p);
+return res;
+}
+
+if (size <= 0) return null;
+
+size_t pos = size * (char*).sizeof;
+char** p =

New French PO file for 'gcc' (version 9.1-b20190414)

2019-04-21 Thread Translation Project Robot
Hello, gentle maintainer.

This is a message from the Translation Project robot.

A revised PO file for textual domain 'gcc' has been submitted
by the French team of translators.  The file is available at:

https://translationproject.org/latest/gcc/fr.po

(This file, 'gcc-9.1-b20190414.fr.po', has just now been sent to you in
a separate email.)

All other PO files for your package are available in:

https://translationproject.org/latest/gcc/

Please consider including all of these in your next release, whether
official or a pretest.

Whenever you have a new distribution with a new version number ready,
containing a newer POT file, please send the URL of that distribution
tarball to the address below.  The tarball may be just a pretest or a
snapshot, it does not even have to compile.  It is just used by the
translators when they need some extra translation context.

The following HTML page has been updated:

https://translationproject.org/domain/gcc.html

If any question arises, please contact the translation coordinator.

Thank you for all your work,

The Translation Project robot, in the
name of your translation coordinator.




{PATCH, committed] Update Darwin maintainers entry.

2019-04-21 Thread Iain Sandoe
Hi

As per subject,
Iain

/
2019-04-21  Iain Sandoe  

* MAINTAINERS: Add myself as co-maintainer for Darwin.

diff --git a/MAINTAINERS b/MAINTAINERS
index cece720..fa51ba5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -126,6 +126,7 @@ xtensa port Sterling Augustine  

 
 aixDavid Edelsohn  
 Android sub-port   Maxim Kuvyrkov  
+darwin portIain Sandoe 
 darwin portMike Stump  
 DJGPP  DJ Delorie  
 freebsdAndreas Tobler  



[PATCH, d] Committed use guard to prevent declaration pass from running multiple times

2019-04-21 Thread Iain Buclaw
Hi,

This patch adds checks for semanticRun in the Declaration visitor
passes.  While it shouldn't happen during normal traversal of the AST
provided from the front-end, there are some cases where declarations
need to be visited out of order, such as what is being done in PR
d/89017, it then becomes necessary to guard against this.

Regression tested on x86_64-linux-gnu.

Committed to trunk as r270478.

-- 
Iain
---
gcc/d/ChangeLog:

2019-04-21  Iain Buclaw  

* decl.cc (DeclVisitor::visit(Import)): Set semanticRun after
completion, guard against being called more than once.
(DeclVisitor::visit(StructDeclaration)): Likewise.
(DeclVisitor::visit(ClassDeclaration)): Likewise.
(DeclVisitor::visit(InterfaceDeclaration)): Likewise.
(DeclVisitor::visit(VarDeclaration)): Likewise.
(DeclVisitor::visit(TypeInfoDeclaration)): Likewise.

---
diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc
index fffed97727f..84c17ab36f7 100644
--- a/gcc/d/decl.cc
+++ b/gcc/d/decl.cc
@@ -147,6 +147,9 @@ public:
 
   void visit (Import *d)
   {
+if (d->semanticRun >= PASSobj)
+  return;
+
 /* Implements import declarations by telling the debug back-end we are
importing the NAMESPACE_DECL of the module or IMPORTED_DECL of the
declaration into the current lexical scope CONTEXT.  NAME is set if
@@ -188,6 +191,8 @@ public:
 	debug_hooks->imported_module_or_decl (decl, name, context,
 	  false, false);
   }
+
+d->semanticRun = PASSobj;
   }
 
   /* Expand any local variables found in tuples.  */
@@ -325,6 +330,9 @@ public:
 
   void visit (StructDeclaration *d)
   {
+if (d->semanticRun >= PASSobj)
+  return;
+
 if (d->type->ty == Terror)
   {
 	error_at (make_location_t (d->loc),
@@ -376,6 +384,8 @@ public:
 
 if (d->xhash)
   d->xhash->accept (this);
+
+d->semanticRun = PASSobj;
   }
 
   /* Finish semantic analysis of functions in vtbl for class CD.  */
@@ -453,6 +463,9 @@ public:
 
   void visit (ClassDeclaration *d)
   {
+if (d->semanticRun >= PASSobj)
+  return;
+
 if (d->type->ty == Terror)
   {
 	error_at (make_location_t (d->loc),
@@ -518,6 +531,8 @@ public:
 tree ctype = TREE_TYPE (build_ctype (d->type));
 if (TYPE_NAME (ctype))
   d_pushdecl (TYPE_NAME (ctype));
+
+d->semanticRun = PASSobj;
   }
 
   /* Write out compiler generated TypeInfo and vtables for the given interface
@@ -525,6 +540,9 @@ public:
 
   void visit (InterfaceDeclaration *d)
   {
+if (d->semanticRun >= PASSobj)
+  return;
+
 if (d->type->ty == Terror)
   {
 	error_at (make_location_t (d->loc),
@@ -557,6 +575,8 @@ public:
 tree ctype = TREE_TYPE (build_ctype (d->type));
 if (TYPE_NAME (ctype))
   d_pushdecl (TYPE_NAME (ctype));
+
+d->semanticRun = PASSobj;
   }
 
   /* Write out compiler generated TypeInfo and initializer for the given
@@ -606,6 +626,9 @@ public:
 
   void visit (VarDeclaration *d)
   {
+if (d->semanticRun >= PASSobj)
+  return;
+
 if (d->type->ty == Terror)
   {
 	error_at (make_location_t (d->loc),
@@ -731,6 +754,8 @@ public:
 	  }
 	  }
   }
+
+d->semanticRun = PASSobj;
   }
 
   /* Generate and compile a static TypeInfo declaration, but only if it is
@@ -738,12 +763,16 @@ public:
 
   void visit (TypeInfoDeclaration *d)
   {
+if (d->semanticRun >= PASSobj)
+  return;
+
 if (speculative_type_p (d->tinfo))
   return;
 
 tree t = get_typeinfo_decl (d);
 DECL_INITIAL (t) = layout_typeinfo (d);
 d_finish_decl (t);
+d->semanticRun = PASSobj;
   }
 
   /* Finish up a function declaration and compile it all the way


[PATCH, d] Committed ensure all unittests are registered against the original module.

2019-04-21 Thread Iain Buclaw
Hi,

This patch is a follow-up fix for PR d/89255, as any unittest
functions registered against the testing module when compiling with
-fbuilding-libphobos-tests are ignored during the generation of the
ModuleInfo data.

Regression tested on x86_64-linux-gnu.

Committed to trunk as r270477.

-- 
Iain
---
gcc/d/ChangeLog:

2019-04-21  Iain Buclaw  

* modules.cc (register_module_decl): Don't register unittests against
the ModuleInfo symbol for -fbuilding-libphobos-tests.

---
diff --git a/gcc/d/modules.cc b/gcc/d/modules.cc
index 315f5d82356..35050c8e17a 100644
--- a/gcc/d/modules.cc
+++ b/gcc/d/modules.cc
@@ -836,7 +836,8 @@ register_module_decl (Declaration *d)
 	 compiling in unittests are kept track of separately so they are
 	 not omitted when compiling with -fbuilding-libphobos-tests.  */
   module_info *minfo;
-  if (flag_building_libphobos_tests && DECL_IN_UNITTEST_CONDITION_P (decl))
+  if (flag_building_libphobos_tests && !fd->isUnitTestDeclaration ()
+	  && DECL_IN_UNITTEST_CONDITION_P (decl))
 	minfo = current_testing_module;
   else
 	minfo = current_moduleinfo;