[Issue 7024] New: inconsistent mangling of shared in extern(C++)

2011-11-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7024

   Summary: inconsistent mangling of shared in extern(C++)
   Product: D
   Version: D2
  Platform: Other
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: d...@dawgfoto.de


--- Comment #0 from d...@dawgfoto.de 2011-11-28 02:32:50 PST ---
module fail;

extern(C++) void foo1(void*);
extern(C++) void bar1(shared void*);

pragma(msg, foo1.mangleof);
pragma(msg, bar1.mangleof); // shared is ignored here, because C++ doesn't have
shared, this make sense.

extern(C++) void foo2(void function(void*));
extern(C++) void bar2(void function(shared void*));

pragma(msg, foo2.mangleof);
pragma(msg, bar2.mangleof); // shared is ignored here, because C++ doesn't have
shared, this make sense.

extern(C++) void foo3(void function(void*), void*);
extern(C++) void bar3(void function(shared void*), void*);

pragma(msg, foo3.mangleof);
pragma(msg, bar3.mangleof); // shared generate a different mangling here.

extern(C++) void foo4(void function(void*), shared void*);
extern(C++) void bar4(void function(shared void*), shared void*);

pragma(msg, foo4.mangleof); // Same mangling as bar3.
pragma(msg, bar4.mangleof); // back to correct mangling (the one expected by
g++).

extern(C++) void foo5(void* function(void*), void*);
extern(C++) void bar5(void* function(shared void*), void*);

pragma(msg, foo5.mangleof);
pragma(msg, bar5.mangleof); // shared generate a different mangling here.

extern(C++) void foo6(void* function(void*), shared void*);
extern(C++) void bar6(void* function(shared void*), shared void*);

pragma(msg, foo6.mangleof); // shared generate a different mangling here.
pragma(msg, bar6.mangleof); // function pointer mangled as in bar5, but second
parameter get a 0 in the mangling that none of the mangling above had.



It is expected that shared be ignored as in the foo1/bar1 case.

filed on behalf of deadalnix.

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


[Issue 7024] inconsistent mangling of shared in extern(C++)

2011-11-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7024


deadalnix deadal...@gmail.com changed:

   What|Removed |Added

 CC||deadal...@gmail.com


--- Comment #1 from deadalnix deadal...@gmail.com 2011-11-28 03:26:40 PST ---
Hi,

As I said in the topic, I was using GDC to generate informations. I didn't try
with DMD so it is not sure the problem actually exists on this compiler.

I'm currently repporting the issue to GDC bugtracker.

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


[Issue 7024] inconsistent mangling of shared in extern(C++)

2011-11-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7024



--- Comment #2 from d...@dawgfoto.de 2011-11-28 05:15:24 PST ---
Yes, it exists with dmd too.

It is an error with the compression in name mangling.
http://sourcery.mentor.com/public/cxx-abi/abi.html#mangling-compression
The compiler fails to substitute 'void*' and 'shared void*'.
But for both shared is ignored for mangling.

It needs to be decided whether all qualifiers (probably except for const)
be silently stripped or if they should result in an error/warning.

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


[Issue 7006] std.math.pow (integral, integral) crashes on negative exponents

2011-11-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7006



--- Comment #2 from timon.g...@gmx.ch 2011-11-28 05:16:50 PST ---
That is like saying 1/2 should give a div by zero error because the result does
not fit in an integer and therefore it must always indicate a bug.

I want this:

assert(a ^^ -1 == 1/a);

This is only div by zero if a is zero.


(BTW: This does not give a div by zero error on my x86 machine, and I have no
clue why you think it should: void main(){auto x = -1; x = x/(x-int.max);})

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


[Issue 7025] New: strange static lib error

2011-11-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7025

   Summary: strange static lib error
   Product: D
   Version: D1  D2
  Platform: x86
OS/Version: Windows
Status: NEW
  Severity: critical
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: chang...@gmail.com


--- Comment #0 from changlon chang...@gmail.com 2011-11-28 07:07:51 PST ---
I try build a mp3 player use D,  run into a lot of strange error.

Fisrt I try use www.un4seen.com/bass.html  with dfl  tango,  got a invalid
memory address runtime exception,  then I try with dmd2  phobos  dfl,  still
thorw error .
I try dwt with dmd1.056/dmd1.071  last tango_trunk,  still throw memory error
.

bass.dll will start 6 thread  ,  and I try libzplay also has same problem .  

When I remove static lib,  throw all dwt soucre file with my project file to
dmd 1.070,  It start working with libzplay . but bass.dll is not change at all
.

The static lib is made by dmd @allfilelist.txt -lib , tango.lib and
phobos2.lib is fresh too.   optlink is 8.0.0.12 .

one libmad api return mp3 file duration,  when I build with static gui lib, 
the number allways wrong ,  when I remove static gui lib,  the number is
correct .

I also try mpg123.dll ,  just keep failure on channel set.


build bass.dll with static gui lib can start play music ,  but with a memory
error.  build bass.dll with gui source can't play music .

 The project is huge and I can't reduce the test case,  If any one try
www.un4seen.com/bass.html or libzplay should be  easy to find the problem .

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


[Issue 7026] New: 64 bit optimizer bug

2011-11-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7026

   Summary: 64 bit optimizer bug
   Product: D
   Version: D2
  Platform: x86_64
OS/Version: Linux
Status: NEW
  Keywords: wrong-code
  Severity: major
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: c...@klickverbot.at


--- Comment #0 from klickverbot c...@klickverbot.at 2011-11-28 11:13:45 PST 
---
The following code (reduced varint encoding) works as expected on Linux x86_64
if built without flags or just one of -O and -release, but fails if both -O
-release are specified:
---
import core.stdc.stdio;

ubyte foo(uint n) {
  ubyte[5] buf = void;
  ubyte wsize;

  while (true) {
if ((n  ~0x7F) == 0) {
  buf[wsize++] = cast(ubyte)n;
  break;
} else {
  buf[wsize++] = cast(ubyte)((n  0x7F) | 0x80);
  n = 7;
}
  }

  printf(%hhu\n, wsize);
  return buf[0];
}

void main() {
  printf(%hhx\n, foo(3));
}
---

More specifically, the output (printf()s for shorter assembly) is »1 e0« for
the optimized build instead of »1 3«, and the program crashes most of the time
(different errors: segfaults, illegal instruction, glibc free() assert
triggers, …) – stack corruption?

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


[Issue 7027] New: Struct member trySemantic() regression in DMD Git master

2011-11-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7027

   Summary: Struct member trySemantic() regression in DMD Git
master
   Product: D
   Version: D2
  Platform: Other
OS/Version: All
Status: NEW
  Severity: regression
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: c...@klickverbot.at


--- Comment #0 from klickverbot c...@klickverbot.at 2011-11-28 14:06:51 PST 
---
Reposting this from my mailing list message so it doesn't get lost:

https://github.com/D-Programming-Language/dmd/commit/8baaaf675e7d50b1160f81b9a27aef106f584968
introduced a regression concerning __traits(compiles, …):
---
struct Foo {
  int a;
}
static assert(!__traits(compiles, { return Foo.a; }));
---

The assert doesn't pass anymore with the aforementioned commit in place, i.e.
__traits(compiles, …) returns true. If the delegate was used in actual code,
semantic analysis would later give a »need this« error.

I'm not quite sure what the best/correct fix for this is.

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


[Issue 4765] std.math.modf always returns 0

2011-11-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4765



--- Comment #4 from Lars T. Kyllingstad bugzi...@kyllingen.net 2011-11-28 
14:49:18 PST ---
https://github.com/D-Programming-Language/phobos/pull/337

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


[Issue 6790] buildPath using std.path.curdir segfaults

2011-11-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6790


Lars T. Kyllingstad bugzi...@kyllingen.net changed:

   What|Removed |Added

 CC||bugzi...@kyllingen.net


--- Comment #2 from Lars T. Kyllingstad bugzi...@kyllingen.net 2011-11-28 
15:14:39 PST ---
I am using the latest revisions of DMD, druntime and Phobos, and I can't
reproduce this.

curdir is a string enum, and the only thing that happens to it in buildPath is
the following:

return cast(string)(curdir ~ dirSeparator ~ a.out);

This should be perfectly OK, as concatenation always allocates a new string. 
Therefore, I agree with Jacob that it is/was a bug in druntime, or perhaps DMD,
but it seems to have been fixed now.

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



[Issue 6790] buildPath using std.path.curdir segfaults

2011-11-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6790



--- Comment #3 from Lars T. Kyllingstad bugzi...@kyllingen.net 2011-11-28 
15:21:19 PST ---
(In reply to comment #2)
 Therefore, I agree with Jacob [...]

Why on earth did I say Jacob? :)  I meant Jonathan, of course.

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


[Issue 3210] Inconsistency in implicit casting of integral template value parameters

2011-11-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3210


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE


--- Comment #1 from Kenji Hara k.hara...@gmail.com 2011-11-28 16:59:59 PST ---
*** This issue has been marked as a duplicate of issue 3467 ***

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


[Issue 3467] Non-int integral template parameters not correctly propagated

2011-11-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3467


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

 CC||komad...@gekkou.co.uk


--- Comment #7 from Kenji Hara k.hara...@gmail.com 2011-11-28 16:59:59 PST ---
*** Issue 3210 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 6790] buildPath using std.path.curdir segfaults

2011-11-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6790



--- Comment #4 from Jonathan Sternberg jonathansternb...@gmail.com 2011-11-28 
19:53:11 PST ---
Lars, for completeness, can you give your OS/architecture? As I said, it still
happens on x86 Linux for me.

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


[Issue 7026] 64 bit optimizer bug

2011-11-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7026


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

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


--- Comment #1 from Walter Bright bugzi...@digitalmars.com 2011-11-28 
21:12:23 PST ---
https://github.com/D-Programming-Language/dmd/commit/683624c4d7ae2f58fe2d8164ba7be77e08a4424f

https://github.com/D-Programming-Language/dmd/commit/3d21709860f771a7376eef7e7d5f924941421d02

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


[Issue 5624] std.conv unittest disabled

2011-11-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5624


Brad Roberts bra...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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