[Issue 6672] New: [CTFE] ICE on compile time std.algorithm.sort

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6672

   Summary: [CTFE] ICE on compile time std.algorithm.sort
   Product: D
   Version: D2
  Platform: Other
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2011-09-14 23:35:53 PDT ---
import std.algorithm;

string foo(){
auto kw=["alias", "align", "asm", "assert", "auto", "body", "bool",
"break", "byte", "case", "cast", "catch", "cdouble", "cent", "cfloat", "char",
"clas\
s", "const", "continue", "creal", "dchar", "debug", "default", "delegate",
"delete", "deprecated"];
sort(kw);
return "success!";
}

pragma(msg, foo());

void main() {}


This fails with 
dmd: interpret.c:1845: virtual Expression*
ArrayLiteralExp::interpret(InterState*, CtfeGoal): Assertion
`((IndexExp*)e)->e1 != this' failed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6296] ICE(glue.c): invalid template instantiated in is(typeof()).

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6296



--- Comment #15 from Denis  2011-09-14 22:45:49 
PDT ---
However, this D1 bug is still in dmd-1.x branch.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6181] assert fails in datetime.d while runining Phobos unittest

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6181


Jonathan M Davis  changed:

   What|Removed |Added

 CC||jmdavisp...@gmx.com


--- Comment #1 from Jonathan M Davis  2011-09-14 20:55:30 
PDT ---
https://github.com/D-Programming-Language/phobos/pull/257

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4597] std.algorithm.filter fails with a const range

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4597


yebblies  changed:

   What|Removed |Added

 CC||yebbl...@gmail.com


--- Comment #3 from yebblies  2011-09-15 12:16:36 EST ---
(In reply to comment #1)
> I'm not sure how this can be addressed. A brute force solution would be to
> special-case all algorithms for certain array types, but that would be
> horrible. Ideas are welcome.

One idea is issue 6289

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6665] Regression(2.055) ICE(cg87.c): static double inside closure

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6665



--- Comment #3 from Don  2011-09-14 18:15:21 PDT ---
Compiling the first case with -inline gives an error: 
c:\dmd\windows\bin\..\..\src\phobos\std\algorithm.d(423): Error: function D
main
 is a nested function and cannot be accessed from array

which is completely wrong -- why does it think main() is a nested function???
So even on Windows this shows a serious problem with the inliner. But the
inlining bug isn't a regression, the same error message applies also as far
back as 2.035.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6062] segv in dmd/64 with assoc array literals

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6062


Walter Bright  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||FIXED


--- Comment #2 from Walter Bright  2011-09-14 
16:47:57 PDT ---
https://github.com/D-Programming-Language/dmd/commit/52757742186b775f7cc0d0e74ac9742c1c0b89ff

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4705] Redesign of std.algorithm.max()/min() + mins()/maxs()

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4705



--- Comment #12 from bearophile_h...@eml.cc 2011-09-14 15:51:52 PDT ---
Another use case. Given this struct:

struct Foo {
double x;
int[100] a;
}


This D code finds the struct with the smallest x and assigns it to good[index]:

size_t idmin = 0;
foreach (size_t i; 1 .. N)
if (foos[i].x < foos[idmin].x)
idmin = i;
good[index] = foos[idmin];


With the improvement I have proposed you are allowed to replace it with a
higher level code, that expresses the  idea clearly, is less bug-prone, and
reqires one 1 instead of 5:


good[index] = min!q{ a.x }(foos);

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6671] core.time compile error, only with -inline -release -noboundscheck

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6671


Dmitry Olshansky  changed:

   What|Removed |Added

 CC||dmitry.o...@gmail.com


--- Comment #1 from Dmitry Olshansky  2011-09-14 
15:45:40 PDT ---
Looks like http://d.puremagic.com/issues/show_bug.cgi?id=6502 ?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6671] New: core.time compile error, only with -inline -release -noboundscheck

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6671

   Summary: core.time compile error, only with -inline -release
-noboundscheck
   Product: D
   Version: D2
  Platform: x86_64
OS/Version: Mac OS X
Status: NEW
  Severity: regression
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: peter.alexander...@gmail.com


--- Comment #0 from Peter Alexander  2011-09-14 
14:27:47 PDT ---
This is a bit of a weird one. In DMD 2.055 the following code:

import core.time;
void main() {}


Gives the compile error:

> dmd test.d -release -inline -noboundscheck
/Library/Compilers/dmd2/osx/bin/../../src/druntime/import/core/time.di(253):
Error: template core.time.TickDuration.to(string units,T) if ((units ==
"seconds" || units == "msecs" || units == "usecs" || units == "hnsecs" || units
== "nsecs") && (__traits(isIntegral,T) && T.sizeof >= 4)) does not match any
function template declaration
/Library/Compilers/dmd2/osx/bin/../../src/druntime/import/core/time.di(253):
Error: template core.time.TickDuration.to(string units,T) if ((units ==
"seconds" || units == "msecs" || units == "usecs" || units == "hnsecs" || units
== "nsecs") && (__traits(isIntegral,T) && T.sizeof >= 4)) cannot deduce
template function from argument types !("seconds",long)()


It *only* happens with those three flags. Remove any one and the code compiles
fine.

This didn't happen in DMD 2.053 (haven't tried 2.054)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6014] rt_finalize Segmentation fault , dmd 2.053 on linux & freebsd

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6014



--- Comment #20 from Sean Kelly  2011-09-14 13:51:11 
PDT ---
I've added BlkAttr.NONE as a default for this enum.  Seems like an easy way to
avoid weird errors like this.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6670] Compiler seg fault using std.concurrency.atomicOp

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6670



--- Comment #1 from Peter Alexander  2011-09-14 
13:49:26 PDT ---
Actually, this is probably related to
http://d.puremagic.com/issues/show_bug.cgi?id=6669

core.atomic uses a lot of inline asm, and atomicOp just causes those functions
to be instantiated, triggering the other seg fault.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6665] Regression(2.055) ICE(cg87.c): static double inside closure

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6665



--- Comment #2 from iteronve...@gmail.com 2011-09-14 13:03:36 PDT ---
Yes, the imports are what you have listed.

This might be just a Linux issue.  Here are the results for 32-bit Linux:

Compiles but gives 'Segmentation fault'
void main(){

  auto f = (double m){ static double sum = 0.0; return sum += m * m; };
  double[] a = array(map!f(iota(1.0, 25.0, 1.0)));
  writeln(a);
}


Compiles but gives 'Segmentation fault'
void main(){

  auto f = (double m){ /* static double sum = 0.0;*/ return m * m; };
  double[] a = array(map!f(iota(1.0, 25.0, 1.0)));
  writeln(a);
}


Compiles and runs
void main(){

  auto f = (double m){ /* static double sum = 0.0;*/ return m * m; };
  double[] a = array(map!f(array(iota(1.0, 25.0, 1.0;
  writeln(a);
}


Compiles and runs
void main(){

  auto f = (double m){ static double sum = 0.0; return sum += m * m; };
  double[] a = array(map!f(array(iota(1.0, 25.0, 1.0;
  writeln(a);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6670] New: Compiler seg fault using std.concurrency.atomicOp

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6670

   Summary: Compiler seg fault using std.concurrency.atomicOp
   Product: D
   Version: D2
  Platform: x86_64
OS/Version: Mac OS X
Status: NEW
  Severity: regression
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: peter.alexander...@gmail.com


--- Comment #0 from Peter Alexander  2011-09-14 
11:50:41 PDT ---
This program causes DMD 2.055 to seg fault.

import std.concurrency;
void main()
{
  int a;
  atomicOp!"+="(a, 1);
}

It didn't seg fault in DMD 2.053 (haven't tested DMD 2.054).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6669] New: ICE in inline assembler when using square brackets

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6669

   Summary: ICE in inline assembler when using square brackets
   Product: D
   Version: D2
  Platform: x86_64
OS/Version: Mac OS X
Status: NEW
  Severity: regression
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: peter.alexander...@gmail.com


--- Comment #0 from Peter Alexander  2011-09-14 
11:26:52 PDT ---
This sample program causes DMD 2.055 to seg fault on OSX. If you remove the
brackets then it doesn't seg fault.

void main()
{
asm { mov EAX, [EAX]; }
}

It didn't seg fault on 2.053 (haven't tried 2.054), so this is a regression.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6668] New: Wrong "to" conversion stack trace

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6668

   Summary: Wrong "to" conversion stack trace
   Product: D
   Version: D2
  Platform: x86
OS/Version: Windows
Status: NEW
  Keywords: diagnostic
  Severity: minor
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-09-14 11:18:05 PDT ---
D2 code:


import std.conv;
void main() {
to!uint("-1");
}



With DMD 2.055 it gives a strange stack trace on Windows (and on one Linux),
that I am not sure is correct:


std.conv.ConvException@...\src\phobos\std\conv.d(1809): Can't convert value
`-1' of type string to type uint

...\src\phobos\std\conv.d(1810): uint std.conv.parse!(uint,
immutable(char)[]).parse(ref immutable(char)[])
...\src\phobos\std\conv.d(1643): uint std.conv.toImpl!(uint,
immutable(char)[]).toImpl(immutable(char)[])
...\src\phobos\std\conv.d(234): uint
std.conv.to!(uint).to!(immutable(char)[]).to(immutable(char)[])
...\test.d(3): _Dmain

std.conv.ConvException@...\src\phobos\std\conv.d(1640): Can't convert value
`-1' of type string to type uint

...\src\phobos\std\conv.d(1640): uint std.conv.toImpl!(uint,
immutable(char)[]).toImpl(immutable(char)[])
...\src\phobos\std\conv.d(234): uint
std.conv.to!(uint).to!(immutable(char)[]).to(immutable(char)[])
...\test.d(3): _Dmain


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6062] segv in dmd/64 with assoc array literals

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6062


yebblies  changed:

   What|Removed |Added

   Keywords||patch
 CC||yebbl...@gmail.com
   Platform|x86_64  |All


--- Comment #1 from yebblies  2011-09-14 23:43:27 EST ---
Not specific to x86-64, caused by the new druntime interface's use of
ExpressionsToStaticArray, and re-calling TypeAArray::semantic with no scope.

https://github.com/D-Programming-Language/dmd/pull/381

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6655] Forward error with static array length

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6655


yebblies  changed:

   What|Removed |Added

 CC||yebbl...@gmail.com
   Platform|x86 |All
 OS/Version|Windows |All
   Severity|major   |critical


--- Comment #1 from yebblies  2011-09-14 23:01:52 EST ---
The problem here is that TypeAArray::getImpl is being called on bar before
semantic has, therefore there is no scope or location.  Of the three problems,
the lack of scope causes the failure to lookup N (and therefore the failure to
recognize bar as a static array), and also the lack of a file/line number.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 1692] Abstract class dynamic creation bug

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1692


yebblies  changed:

   What|Removed |Added

 CC||opantm+s...@gmail.com


--- Comment #4 from yebblies  2011-09-14 22:36:40 EST ---
*** Issue 6667 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6667] Object.factory creates instance of abstract classes.

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6667


yebblies  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||yebbl...@gmail.com
 Resolution||DUPLICATE


--- Comment #1 from yebblies  2011-09-14 22:36:40 EST ---
*** This issue has been marked as a duplicate of issue 1692 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6014] rt_finalize Segmentation fault , dmd 2.053 on linux & freebsd

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6014



--- Comment #19 from Steven Schveighoffer  2011-09-14 
05:22:43 PDT ---
(In reply to comment #17)

> There is also a deterministic bug happening due to an oversight in the
> finalization design. Finalization is done in memory order and does not take
> hierarchies into account.

Just to clarify as you discovered in your new bug report, this is by design --
a destructor cannot rely on any heap-allocated data being present.

A concept in many GC-based languages is to have two "destructors", one which is
only ever called synchronously, and one that can be called asynchronously by
the GC.  The synchronous one always calls the asynchronous one.  This is
sometimes called a finalizer (and in fact, ~this is a finalizer).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6665] Regression(2.055) ICE(cg87.c): static double inside closure

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6665


Don  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 CC||clugd...@yahoo.com.au
Summary|Internal error: |Regression(2.055)
   |../ztc/cg87.c 202   |ICE(cg87.c): static double
   ||inside closure


--- Comment #1 from Don  2011-09-14 05:16:24 PDT ---
Probably a result of the fix for bug 6505.
It may be 64 bit specific, I cannot reproduce on Windows. I'm assuming that the
imports are:

import std.algorithm;
import std.array;
import std.stdio;
import std.range;

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 5756] amap() and maybe afilter() too

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5756



--- Comment #4 from bearophile_h...@eml.cc 2011-09-14 04:55:40 PDT ---
See here for better explanations:

http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=29516

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6667] New: Object.factory creates instance of abstract classes.

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6667

   Summary: Object.factory creates instance of abstract classes.
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: opantm+s...@gmail.com


--- Comment #0 from opantm+s...@gmail.com 2011-09-14 04:55:22 PDT ---
Object.factroy successfully creates an invalid instance when used for an
abstract class. There is no way to distinguish that the instance is invalid, as
it is not null. It may be assigned, but upon first access it will result in a
segfault. This also means that (AFAIK), short of looking at the vtbl, you have
no way of knowing if a class is abstract using Typeinfo. Object.factory is
supposed to return null when errors occur. Tested on Windows 7 64-bit (compiled
as 32-bit) and Linux 64-bit.

Example:

import std.stdio;
import std.traits;
import std.conv;

abstract class C {
string AbstractMethod();
}

C[] Objects;

void main() {
TypeInfo_Class ti = typeid(C);
C MyC = cast(C)Object.factory(ti.name);
writefln("Created " ~ ti.name ~ " - IsNull: " ~ to!string(MyC is null)
~ " -  Location: " ~ to!string(&MyC) ~ ".");
Objects ~= MyC;
writefln("Added to collection.");
writefln(Objects[0].AbstractMethod());
}


Output:

Created temptest.C - IsNull: false -  Location: 7FFF15772900.
Added to collection.
Segmentation fault

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4197] ICE(glue.c): error in forward-referenced in/out contract

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4197


Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #5 from Walter Bright  2011-09-14 
00:46:13 PDT ---
D2 fix:
https://github.com/D-Programming-Language/dmd/commit/0a927f258e89f92f280c0e855a93ceb05e34a260

Partial D1 fix:
https://github.com/D-Programming-Language/dmd/commit/31d6751de3a877c72055a2096a9a9c4a9a25ec9b

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6296] ICE(glue.c): invalid template instantiated in is(typeof()).

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6296


Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #14 from Walter Bright  2011-09-14 
00:45:34 PDT ---
D2 fix:
https://github.com/D-Programming-Language/dmd/commit/0a927f258e89f92f280c0e855a93ceb05e34a260

Partial D1 fix:
https://github.com/D-Programming-Language/dmd/commit/31d6751de3a877c72055a2096a9a9c4a9a25ec9b

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 5453] ICE(statement.c): invalid switch statement forward referenced by CTFE

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5453


Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #2 from Walter Bright  2011-09-14 
00:45:54 PDT ---
D2 fix:
https://github.com/D-Programming-Language/dmd/commit/0a927f258e89f92f280c0e855a93ceb05e34a260

Partial D1 fix:
https://github.com/D-Programming-Language/dmd/commit/31d6751de3a877c72055a2096a9a9c4a9a25ec9b

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6661] Templates instantiated only through is(typeof()) shouldn't cause errors

2011-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6661


Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #1 from Walter Bright  2011-09-14 
00:45:10 PDT ---
D2 fix:
https://github.com/D-Programming-Language/dmd/commit/0a927f258e89f92f280c0e855a93ceb05e34a260

Partial D1 fix:
https://github.com/D-Programming-Language/dmd/commit/31d6751de3a877c72055a2096a9a9c4a9a25ec9b

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---