[Issue 15876] "a[{keyword" causes DMD to segfault

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15876

ag0ae...@gmail.com changed:

   What|Removed |Added

   Keywords||ice
 CC||ag0ae...@gmail.com

--- Comment #1 from ag0ae...@gmail.com ---
(In reply to Alex Parrill from comment #0)
> d(={for
> typeof){for

These two don't segfault anymore with git master (6199fd3).

--


[Issue 15875] "d o(int[a]a)(){}" causes DMD segfault

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15875

ag0ae...@gmail.com changed:

   What|Removed |Added

   Keywords||ice
 CC||ag0ae...@gmail.com

--


[Issue 15877] New: [REG2.071beta] Some members are not visible by std.typecons.BlackHole

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15877

  Issue ID: 15877
   Summary: [REG2.071beta] Some members are not visible by
std.typecons.BlackHole
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Keywords: rejects-valid
  Severity: regression
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: j...@red.email.ne.jp

This came from the 2.071 change of the import rules.

I don't know whether a dmd or phobos issue.
And it is a deprecation massage, so we can suppress.

It also relates to Issue 15826.

CODE:
import std.typecons;

void main(string[] args)
{
auto a = new BlackHole!A;
a.method();
}

interface A {
abstract void method();

import std.stdio; // default is private
private alias a = int;
private void ft(R)(R range) { } // non-template is visible
}

OUTPUT:
phobos\std\traits.d(3677): Deprecation: test.A.std is not visible from module
traits
phobos\std\traits.d(3677): Deprecation: test.A.a is not visible from module
traits
phobos\std\traits.d(3677): Deprecation: test.A.ft(R)(R range) is not visible
from module traits

--


[Issue 15870] UFCS not recognized on array when passing as alias parameter

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15870

r...@rcorre.net changed:

   What|Removed |Added

 CC||r...@rcorre.net

--


[Issue 11429] Deprecate walkLength?

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11429

Jack Stouffer  changed:

   What|Removed |Added

 CC||j...@jackstouffer.com

--- Comment #1 from Jack Stouffer  ---
I think this is a bad idea, walkLength is not only a clearer name than an empty
count, but it's used quite widely. Phobos alone has 133 uses of it.

--


[Issue 15869] RVO can overwrite argument

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15869

--- Comment #2 from Yuxuan Shui  ---
I think the expected behavior here is a compile error.

--


[Issue 8755] Change the order of reduce arguments

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8755

Jack Stouffer  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||j...@jackstouffer.com
 Resolution|--- |FIXED

--- Comment #22 from Jack Stouffer  ---
https://github.com/D-Programming-Language/phobos/pull/3968

--


[Issue 13020] std.ascii.isASCII for strings too or @nogc all!isASCII

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13020

Jack Stouffer  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||j...@jackstouffer.com
 Resolution|--- |DUPLICATE

--- Comment #1 from Jack Stouffer  ---


*** This issue has been marked as a duplicate of issue 11356 ***

--


[Issue 11356] isASCII for strings

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11356

--- Comment #4 from Jack Stouffer  ---
*** Issue 13020 has been marked as a duplicate of this issue. ***

--


[Issue 13682] std.range.isRangeOf?

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13682

Jack Stouffer  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||j...@jackstouffer.com
 Resolution|--- |WONTFIX

--- Comment #1 from Jack Stouffer  ---
Marking this as won't fix because of the discussion here:
https://github.com/D-Programming-Language/phobos/pull/3786

--


[Issue 9082] Add "interleave" function

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9082

Jack Stouffer  changed:

   What|Removed |Added

 CC||j...@jackstouffer.com

--- Comment #2 from Jack Stouffer  ---
std.range.roundRobin(
[1, 2, 3],
0.repeat(2)
);

--


[Issue 13724] std.datetime.timeIt

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13724

Jack Stouffer  changed:

   What|Removed |Added

 CC||j...@jackstouffer.com

--- Comment #7 from Jack Stouffer  ---
Doesn't std.datetime.benchmark handle this?

--


[Issue 14493] std.range.walkBack too

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14493

Jack Stouffer  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||j...@jackstouffer.com
 Resolution|--- |FIXED

--- Comment #1 from Jack Stouffer  ---
This is now covered with std.range.tail

--


[Issue 14598] range primitives for popFront+return front

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14598

Jack Stouffer  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||j...@jackstouffer.com
 Resolution|--- |WONTFIX

--- Comment #2 from Jack Stouffer  ---
Marking as won't fix because of the discussion here:
https://github.com/D-Programming-Language/phobos/pull/4010

Most agree that it's not a good idea.

--


[Issue 14804] Comparing two Nullables does not check if either is null

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14804

Jack Stouffer  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||j...@jackstouffer.com
 Resolution|--- |DUPLICATE

--- Comment #5 from Jack Stouffer  ---


*** This issue has been marked as a duplicate of issue 13017 ***

--


[Issue 13017] opEquals for null std.typecons.Nullable

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13017

Jack Stouffer  changed:

   What|Removed |Added

 CC||monkeywork...@hotmail.com

--- Comment #2 from Jack Stouffer  ---
*** Issue 14804 has been marked as a duplicate of this issue. ***

--


[Issue 15722] std.algorithm sum should favour speed

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15722

Jack Stouffer  changed:

   What|Removed |Added

   Keywords||performance
 CC||j...@jackstouffer.com

--


[Issue 11229] std.string.toLower is slow

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11229

Jack Stouffer  changed:

   What|Removed |Added

   Keywords||performance

--


[Issue 15876] New: "a[{keyword" causes DMD to segfault

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15876

  Issue ID: 15876
   Summary: "a[{keyword" causes DMD to segfault
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: initrd...@gmail.com

Probably related to https://issues.dlang.org/show_bug.cgi?id=15855, though it
apparently applies to more than just the for keyword.

Example file contents (one file per line):

o[{scope(x
o[{template
d(={for
typeof){for
p[{alias
p(={alias

Similar to the linked issue, DMD spits out some error messages and then
terminates with a segfault. DMD v2.070.2

--


[Issue 15875] New: "d o(int[a]a)(){}" causes DMD segfault

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15875

  Issue ID: 15875
   Summary: "d o(int[a]a)(){}" causes DMD segfault
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: initrd...@gmail.com

File contents:

d o(int[a]a)(){}

Compiling this with `dmd -c -o- /tmp/derr.d` with DMD 2.070.2 on x86-64 Linux
causes DMD to pause for roughly two seconds, then exit with a segfault and no
other output.

Found by American Fuzzy Lop

--


[Issue 11229] std.string.toLower is slow

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11229

--- Comment #5 from Jack Stouffer  ---
isWhite and isSpace seem to already be optimized for ASCII

--


[Issue 11229] std.string.toLower is slow

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11229

--- Comment #4 from Jack Stouffer  ---
Part 2: https://github.com/D-Programming-Language/phobos/pull/4150

--


[Issue 15873] In order to implement std.simd, compile time info about CPU specifics is needed

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15873

ponce  changed:

   What|Removed |Added

 CC||alil...@gmail.com

--- Comment #5 from ponce  ---
Could DMD also generate SSE code for 32-bit targets (easily)? SSE2 is very
common.

I see two main advantages:

- it can also avoid some divergence in results between 32-bit and 64-bit
related to the unexpected higher precision of FPU operations. Using the FPU you
might think that floats are sufficient for one task when they aren't, because
they were promoted to 80-bit float internally.

- avoiding denormals. It is a recurring concern in audio code though not that
bad.

MSVC generates SSE2 in 32-bit by default I think.

--


[Issue 15873] In order to implement std.simd, compile time info about CPU specifics is needed

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15873

--- Comment #4 from Walter Bright  ---
https://github.com/D-Programming-Language/dlang.org/pull/1260

--


[Issue 15873] In order to implement std.simd, compile time info about CPU specifics is needed

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15873

--- Comment #3 from Walter Bright  ---
DMD predefines "D_SIMD" for:

1. all 64 bit code generation
2. OSX 32 bit code generation

and does generate SIMD instructions for those platforms. DMD does not have
compiler switches to select SIMD levels.

--


[Issue 15874] New: getSymbolsByUDA fails if struct has no UDAs

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15874

  Issue ID: 15874
   Summary: getSymbolsByUDA fails if struct has no UDAs
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: minor
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: uldis.kalni...@gmail.com

I think, this specific case should work, but it does not. 

struct Test {
int x;
}

struct UDA {
}

unittest {
import std.traits;
static assert(getSymbolsByUDA!(Test,UDA).length == 0);
}

This fails with:
/usr/include/dlang/dmd/std/traits.d(6721): Error: array index [0] is outside
array bounds [0 .. 0]
/usr/include/dlang/dmd/std/traits.d(6726): Error: template instance
std.traits.getSymbolsByUDA!(Test, UDA).toSymbols!() error instantiating


The issue is that toSymbols within getSymbolsByUDA does not handles case with 0
matches. I think simple change to something like this should work:

 template toSymbols(names...) {
static if (names.length == 0)
toSymbols = AliasSeq!();
else
mixin("alias toSymbols = AliasSeq!(symbol.%s,
toSymbols!(names[1..$]));"
  .format(names[0]));
 }

--


[Issue 7625] inlining only works with explicit else branch

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7625

thomas.bock...@gmail.com changed:

   What|Removed |Added

 CC||thomas.bock...@gmail.com

--- Comment #8 from thomas.bock...@gmail.com ---
Related? https://issues.dlang.org/show_bug.cgi?id=15483

--


[Issue 15873] In order to implement std.simd, compile time info about CPU specifics is needed

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15873

--- Comment #2 from Walter Bright  ---
newsgroup thread:

http://www.digitalmars.com/d/archives/digitalmars/D/Any_usable_SIMD_implementation_282806.html

github thread:

https://github.com/D-Programming-Language/phobos/pull/2862

--


[Issue 15873] In order to implement std.simd, compile time info about CPU specifics is needed

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15873

Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com

--- Comment #1 from Walter Bright  ---
For DMD, the minimum SIMD level can be ascertained by:

1. the operating system - for example, OSX is only sold on certain CPUs and
above. Also, Linux assumes SIMD in the default behavior of gcc.
2. 32 or 64 bit code being generated

The DMD compiler assumes the existence of that minimum SIMD level, and
generates SIMD code accordingly.


The SIMD capabilities can be tested at runtime:

  http://dlang.org/phobos/core_cpuid.html

This is used, for example, here:

 
https://github.com/D-Programming-Language/druntime/blob/master/src/rt/arraydouble.d#L33

The idea is to use a template to statically generated code for each supported
SIMD level. Then, test the capabilities at a high level, and select the right
branch at the high level. Then each level's implementation runs at full speed
with custom code for that level.

--


[Issue 14966] Comparing two std.xml.Document result in infinite recursion

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14966

--- Comment #6 from Rainer Schuetze  ---
> Awww, when?

I don't think this has to do with how Object.opEqual is called. The offending
lines were changed a number of times, but I'd say none of them worked correctly
(or there must have been a compiler change regarding super.calls). I suspect
the bug is also in the original commit from 2008.

--


[Issue 15869] RVO can overwrite argument

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15869

ag0ae...@gmail.com changed:

   What|Removed |Added

   Keywords||wrong-code
 CC||ag0ae...@gmail.com
   Hardware|x86_64  |All
 OS|Linux   |All
   Severity|enhancement |normal

--- Comment #1 from ag0ae...@gmail.com ---
Slightly reduced:

struct Set {
@disable this(this);
int value = 0;
}
Set clobber(Set* a) {
Set ret; // <- This overwrites *a, i.e.  is the same as a
ret.value = a.value; // <- Now a.value is 0
return ret;
}
struct XX {
Set a = Set(1);
this(int n) {
a = clobber();
}
}
void main(){
XX xx = XX(0);
assert(xx.a.value == 1); /* fails */
}


--


[Issue 15873] In order to implement std.simd, compile time info about CPU specifics is needed

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15873

Jack Stouffer  changed:

   What|Removed |Added

   Keywords||CTFE, SIMD

--


[Issue 15873] New: In order to implement std.simd, compile time info about CPU specifics is needed

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15873

  Issue ID: 15873
   Summary: In order to implement std.simd, compile time info
about CPU specifics is needed
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: blocker
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: j...@jackstouffer.com

To quote Manu,

"I still have no way to detect what simd version was supplied to the compiler
on the command line on GCC/Clang, and DMD has no such concept. The library
can't emit opcodes that violate the simd level request made to the compiler; I
need to know the level requested and then I can produce the best code for that
level using static if."

This also is blocking std.blas, to quote Ilya,

"I am working on BLAS from scratch implementation. And it is no hope to create
something useable without CT information about target.
Target cpu configuration:
- CPU architecture (done)
- Count of FP/Integer registers
- Allowed sets of instructions: for example, AVX2, FMA4
- Compiler optimization options (for math)"

--


[Issue 15865] std.file.copy(from, to) deletes the file if from and to specify the same file

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15865

--- Comment #2 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/fad13881996fabbf06704ac5a42b0f843f54630c
fix Issue 15865 - std.file.copy(from,to) deletes the file if from and to
specify the same file

Stat the target fd and check for sameness before truncating the file.

https://github.com/D-Programming-Language/phobos/commit/df99fc87075c46cefb4a6a6052056b833fb93c93
Merge pull request #4148 from CyberShadow/pull-20160404-141544

fix Issue 15865 - std.file.copy(from,to) deletes the file if from and to
specify the same file

--


[Issue 15865] std.file.copy(from, to) deletes the file if from and to specify the same file

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15865

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 15872] New: [ndslice] indexing a slice with an array causes an error inside ndslice

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15872

  Issue ID: 15872
   Summary: [ndslice] indexing a slice with an array causes an
error inside ndslice
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: minor
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: ilyayaroshe...@gmail.com

>From Mir: https://github.com/DlangScience/mir/issues/14
--
e.g. mySlice[[1,2,3]] gives

/Users/john/.dub/packages/mir-0.10.2/source/mir/ndslice/slice.d(1556): Error:
no property 'i' for type 'int[]'
/Users/john/.dub/packages/mir-0.10.2/source/mir/ndslice/slice.d(1557): Error:
no property 'j' for type 'int[]'
/Users/john/.dub/packages/mir-0.10.2/source/mir/ndslice/slice.d(1557): Error:
no property 'i' for type 'int[]'
test.d(8): Error: template instance mir.ndslice.slice.Slice!(3LU,
ulong*).Slice.opIndex!(int[]) error instantiating

it should either work or should error at the API level, not internally.

--


[Issue 15871] New: Implement SIMD-friendly set intersection

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15871

  Issue ID: 15871
   Summary: Implement SIMD-friendly set intersection
   Product: D
   Version: D2
  Hardware: x86_64
OS: All
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: dmitry.o...@gmail.com

See the paper:
http://www.vldb.org/pvldb/vol8/p293-inoue.pdf
And related SIMD galloping:
http://boytsov.info/pubs/simdcompressionarxiv.pdf

Quoting the first paper:

Our algorithm is suitable to 
replace existing standard library functions, such as
std::set_intersection in C++, thus accelerating many applications,
because the algorithm is simple and requires no preprocessing to
generate additional data structures. We implemented our
algorithm on Xeon and POWER7+. The experimental results
show our algorithm outperforms the std::set_intersection
implementation delivered with gcc by up to 5.2x using SIMD
instructions and by up to 2.1x even without using SIMD
instructions for 32-bit and 64-bit integer datasets.

Worth looking into.

--


[Issue 15865] std.file.copy(from, to) deletes the file if from and to specify the same file

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15865

Vladimir Panteleev  changed:

   What|Removed |Added

   Keywords||pull
 CC||thecybersha...@gmail.com

--- Comment #1 from Vladimir Panteleev  ---
https://github.com/D-Programming-Language/phobos/pull/4148

--


[Issue 15625] Internal error: backend/elfobj.c 1014

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15625

zunk...@gmail.com changed:

   What|Removed |Added

 CC||zunk...@gmail.com

--- Comment #1 from zunk...@gmail.com ---
Faced with the same issue:

  Internal error: backend/elfobj.c 1014

on my linux boxes:

  * tiny core linux x86_64, glibc 2.20, gcc-4.9
  * tiny core linux x86_64, glibc 2.22, gcc-5.2

--


[Issue 15863] .length for AA.byKey

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15863

Martin Nowak  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||c...@dawg.eu
 Resolution|--- |WONTFIX

--- Comment #2 from Martin Nowak  ---
You can use takeExactly for this.
http://dlang.org/phobos/std_range.html#.takeExactly

---
aa.byKey.takeExactly(aa.length)
aa.byValue.takeExactly(aa.length)
---

--


[Issue 15870] New: UFCS not recognized on array when passing as alias parameter

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15870

  Issue ID: 15870
   Summary: UFCS not recognized on array when passing as alias
parameter
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: r...@rcorre.net

Ordinarily, I don't have to slice an array to treat it as a range. However,
when passing it as template alias parameter, it seems like I do:

---
enum test(alias fun) = "it works";

immutable a = [1,2,3];

pragma(msg, test!(a[].map!(x => x))); // OK
pragma(msg, test!(a.map!(x => x)));   // map is not a member of a
pragma(msg, test!(map!(x => x)(a)));   // OK (no UFCS)

// but a.map does work at runtime ...
unittest {
auto r = a.map!(x => x);
}
---

--


[Issue 14966] Comparing two std.xml.Document result in infinite recursion

2016-04-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14966

--- Comment #5 from Sobirari Muhomori  ---
(In reply to Jacob Carlborg from comment #2)
> I suspect the issue is the super call. I'm guessing since the implementation
> of ==/!= was changed to call object.opEquals, which then calls opEquals on
> the object.

Awww, when?

--