Re: How to defeat the optimizer in GDC

2019-05-20 Thread Mike Franklin via D.gnu
On Monday, 20 May 2019 at 08:21:19 UTC, Iain Buclaw wrote: Looks like you've done a typo to me. Memory should be a clobber, not an input operand. Yes, that too.

Re: How to defeat the optimizer in GDC

2019-05-20 Thread Mike Franklin via D.gnu
On Monday, 20 May 2019 at 08:11:19 UTC, Mike Franklin wrote: But I can't get GDC to do the same: https://explore.dgnu.org/z/quCjhU Is this currently possible in GDC? Gah!! Ignore that. `version (GNU)`, not `version(GDC)`. This works: void use(void* p) { version(LDC) { imp

How to defeat the optimizer in GDC

2019-05-20 Thread Mike Franklin via D.gnu
I'm trying to benchmark some code, but the optimizer is basically removing all of it, so I'm benchmarking nothing. I'd like to do something like what Chandler Carruth does here to defeat the optimizer: https://www.youtube.com/watch?v=nXaxk27zwlk&feature=youtu.be&t=2446 Here presents the fol

Re: GDC 9 and ARM Cortex-M

2019-05-19 Thread Mike Franklin via D.gnu
On Sunday, 19 May 2019 at 06:54:14 UTC, Timo Sintonen wrote: I am updating my toolset and libraries to GCC/GDC 9.1 release. First impression is that druntime needs more work than with previous versions. Many places to change and even compiler crashes when compiling some files. Before I look f

Re: Now that GDC has been officially released with GCC 9.1...

2019-05-04 Thread Mike Franklin via D.gnu
On Saturday, 4 May 2019 at 11:34:16 UTC, Iain Buclaw wrote: 1. Where is development taking place? Where is HEAD? It's happening in SVN, there are a few official git mirrors however. Is that also where I can find the latest GDC with the D frontend?

Now that GDC has been officially released with GCC 9.1...

2019-05-04 Thread Mike Franklin via D.gnu
Now that GDC has been officially released with GCC 9.1... 1. Where is development taking place? Where is HEAD? 2. Where do we file bugs? Thanks, Mike

Re: -ffreestanding option

2018-07-25 Thread Mike Franklin via D.gnu
On Wednesday, 25 July 2018 at 10:32:40 UTC, Zheng (Vic) Luo wrote: Instead of forcing developers to avoid memset-like access pattern in a freestanding environment and increasing their mental burden, a universal flags to disable these the generation of these calls will probably be a better choi

Re: -ffreestanding option

2018-07-25 Thread Mike Franklin via D.gnu
On Wednesday, 25 July 2018 at 08:37:28 UTC, Zheng (Vic) Luo wrote: Current implementation of compilers assumes the existence of some symbols from libc, which leads to an infinite loop if we want to implement primitives like "memset" with our own code because the compiler will optimize consecut

Using GCC's builtin alloca without the C standard library

2018-07-22 Thread Mike Franklin via D.gnu
I'd like to be able to use GCC's `__builtin_alloca` without the C standard library. This seems to work: --- core/stdc/stdlib.d module core.stdc.stdlib; extern(C) void* alloca(size_t n) pure; --- ...but, since I'm not actually using the C standard library, I'd prefer to avoid creating that mod

Re: Improving codegen for ARM Cortex-M

2018-07-20 Thread Mike Franklin via D.gnu
On Friday, 20 July 2018 at 11:11:12 UTC, Mike Franklin wrote: I ask for any insight you might have, should you wish to give this your attention. Regardless, I'll keep investigating. Just to follow up, after I enabled `-funroll-loops` for GDC, it was almost twice as fast as LDC, though the co

Re: Improving codegen for ARM Cortex-M

2018-07-20 Thread Mike Franklin via D.gnu
On Friday, 20 July 2018 at 12:49:59 UTC, Mike Franklin wrote: GDC --- arm-none-eabi-gdc -c -O2 -nophoboslib -nostdinc -nodefaultlibs -nostdlib -mthumb -mcpu=cortex-m4 -mtune=cortex-m4 -mfloat-abi=hard -Isource/runtime -fno-bounds-check -ffunction-sections -fdata-sections -fno-weak _D5board3

Re: Improving codegen for ARM Cortex-M

2018-07-20 Thread Mike Franklin via D.gnu
Actually the assembly output from objdump isn't quite accurate. Here's the generated assembly from the compiler. LDC --- ldc2 -conf= -disable-simplify-libcalls -c -Os -mtriple=thumb-none-eabi -float-abi=hard -mcpu=cortex-m4 -Isource/runtime -boundscheck=off _D5board3lcd8fillRectFiikktZv:

Improving codegen for ARM Cortex-M

2018-07-20 Thread Mike Franklin via D.gnu
I've finally succeeded in getting a build of my STM32 ARM Cortex-M proof of concept in LDC and GDC, thanks to the recent changes in both compilers. So, I now have a way to compare code generation between the two compilers. The project is extremely simple; it just generates a bunch of random

Re: How to report code generation weirdness

2018-03-20 Thread Mike Franklin via D.gnu
On Tuesday, 20 March 2018 at 23:06:23 UTC, Cecil Ward wrote: How do I report some extremely weird (useless) code generated by GDC when the -O3 option is used? (bizarre rats’ nest of conditional jumps). [I am an experienced professional asm programmer, now retired.] The D source is short, fort

Re: Bug after local import statement?

2018-03-07 Thread Mike Franklin via D.gnu
On Wednesday, 7 March 2018 at 12:49:30 UTC, berni wrote: The following code compiles with ldc/dmd but not with gdc: cat test.d void main() { int[] count; { import std.string; ++count[3]; } } gdc test.d test.d:8:16: error: only one index allowed to index void

Re: [Bug 126] Add support for attribute to mark data as volatile.

2014-06-24 Thread Mike Franklin via D.gnu
On Tuesday, 24 June 2014 at 14:14:18 UTC, Johannes Pfau wrote: Am Tue, 24 Jun 2014 10:46:11 + schrieb "Timo Sintonen" : To keep this thread going, I had a quick look at the reference material of the dip and picked some thoughts. In some languages volatile has a stronger meaning, like gua