[Issue 9952] New: regression(HEAD): Attribute inference for virtual functions breaks subclasses

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9952

   Summary: regression(HEAD): Attribute inference for virtual
functions breaks subclasses
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: regression
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2013-04-17 23:46:28 PDT ---
Compiles with 2.062, error in git head:

import std.stdio;

class C(T){
T foo(){ return 2; }
}

class D : C!int{
override int foo(){ writeln(super.foo()); return 3; } // error
}

void main(){ }

This was presumably introduced by the fix for issue 7511.
(It had already been pointed out there that virtual functions shouldn't have
their attributes inferred.)

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


[Issue 9907] Struct literal with destructor should match to non-ref overload

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9907


Kenji Hara  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: ---


[Issue 5212] no escape analysis for typesafe variadic function arguments

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5212


Martin Nowak  changed:

   What|Removed |Added

 CC||c...@dawg.eu
Summary|Safer typesafe variadics|no escape analysis for
   ||typesafe variadic function
   ||arguments


--- Comment #11 from Martin Nowak  2013-04-17 22:59:40 PDT ---
Without escape analysis these functions are not memory @safe.
Maybe we should think about this in conjunction with scope ref,
http://wiki.dlang.org/DIP36#.40safe_concerns.

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


[Issue 5212] Safer typesafe variadics

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5212


Martin Nowak  changed:

   What|Removed |Added

 CC||ma...@maxim-fomin.ru


--- Comment #10 from Martin Nowak  2013-04-17 22:47:24 PDT ---
*** Issue 9527 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 9527] Escaping references to variardic parameter array are not properly checked

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9527


Martin Nowak  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||c...@dawg.eu
 Resolution||DUPLICATE


--- Comment #2 from Martin Nowak  2013-04-17 22:47:24 PDT ---
*** This issue has been marked as a duplicate of issue 5212 ***

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


[Issue 9209] ice(symbol.c) with const struct heap allocation

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9209



--- Comment #3 from github-bugzi...@puremagic.com 2013-04-17 22:32:40 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/baa93d923a8386dc8d3d3db43dd17c4115ef8b29
fix Issue 9209 - ice(symbol.c) with const struct heap allocation

https://github.com/D-Programming-Language/dmd/commit/202a28b20900a97d5a13ccbfb5a0be3cf9f28507
Merge pull request #1904 from WalterBright/fix9209

fix Issue 9209 - ice(symbol.c) with const struct heap allocation

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


[Issue 9209] ice(symbol.c) with const struct heap allocation

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9209


Kenji Hara  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: ---


[Issue 9951] DMD segfaults on indirect selective circular import

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9951


Maxim Fomin  changed:

   What|Removed |Added

 CC||ma...@maxim-fomin.ru


--- Comment #1 from Maxim Fomin  2013-04-17 21:52:16 PDT 
---
>From git-head:

b.d(1): Error: b.func at b.d(1) conflicts with foo.func at foo.d(1)
b.d(1): Error: alias b.func cannot resolve

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


[Issue 9634] [CTFE] std.regex.ctRegex chokes on (?:a+)

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9634



--- Comment #5 from Nils  2013-04-17 15:12:50 PDT 
---
Reduced the code from comment #2 further:

struct Bytecode
{
int raw;
}

Bytecode[] getIr()
{
Bytecode[] ir;

ir ~= Bytecode(42);
ir ~= ir[0 .. 1]; // add .dup and CTFE gets it
assert(&ir[0] != &ir[1]); // fails in CTFE

ir[0].raw = 13; // overwrites both ir[0] and ir[1]
assert(ir[0].raw == 13);
assert(ir[1].raw == 42); // fails in CTFE

return ir;
}

void main()
{
enum expected = [Bytecode(13), Bytecode(42)];
assert(getIr() == expected); // passes
static assert(getIr() == expected); // fails
}

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


[Issue 9951] New: DMD segfaults on indirect selective circular import

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9951

   Summary: DMD segfaults on indirect selective circular import
   Product: D
   Version: unspecified
  Platform: All
OS/Version: All
Status: NEW
  Keywords: ice
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: cbkbbej...@mailinator.com


--- Comment #0 from Nick Sabalausky  2013-04-17 
14:54:40 PDT ---
a.d:
---
import b;
import foo;
---

b.d:
---
import a : func;
---

foo.d:
---
void func(){}
---

$ dmd a.d
Segmentation fault

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


[Issue 9634] [CTFE] std.regex.ctRegex chokes on (?:a+)

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9634



--- Comment #4 from Dmitry Olshansky  2013-04-17 
14:29:31 PDT ---
(In reply to comment #3)
> (In reply to comment #2)
> > //uncomment to see that it's a 3rd element of 2 arrays that differs
> > /*
> > import std.stdio;
> > writeln("RT version");
> > writeln(re);
> > writeln("\n\nCT version");
> > writeln(re2);
> > */
> 
> For me, it's the second element that differs (DMD32 D Compiler
> v2.063-devel-0630526):
> ---
> RT version
> [Bytecode(10), Bytecode(11), Bytecode(12), Bytecode(13), Bytecode(-1)]
> 
> 
> CT version
> [Bytecode(10), Bytecode(13), Bytecode(12), Bytecode(13), Bytecode(-1)]
> ---

You're right that must a mistake on my part.
It's 2nd one that is different as I'm seeing this exact output.

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


[Issue 9634] [CTFE] std.regex.ctRegex chokes on (?:a+)

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9634



--- Comment #3 from Nils  2013-04-17 14:20:35 PDT 
---
(In reply to comment #2)
> //uncomment to see that it's a 3rd element of 2 arrays that differs
> /*
> import std.stdio;
> writeln("RT version");
> writeln(re);
> writeln("\n\nCT version");
> writeln(re2);
> */

For me, it's the second element that differs (DMD32 D Compiler
v2.063-devel-0630526):
---
RT version
[Bytecode(10), Bytecode(11), Bytecode(12), Bytecode(13), Bytecode(-1)]


CT version
[Bytecode(10), Bytecode(13), Bytecode(12), Bytecode(13), Bytecode(-1)]
---

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


[Issue 9907] Struct literal with destructor should match to non-ref overload

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9907



--- Comment #2 from github-bugzi...@puremagic.com 2013-04-17 14:08:04 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/065514be2bc214f70575e2877f971da11a3d8637
fix Issue 9907 - Struct literal with destructor should match to non-ref
overload

https://github.com/D-Programming-Language/dmd/commit/e5ca01905d59fbbccce45ef66803ee8f05a2ef70
Merge pull request #1873 from 9rnsr/fix9907

Issue 9907 - Struct literal with destructor should match to non-ref overload

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


[Issue 9938] ICE using global interface variable in CTFE

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9938



--- Comment #2 from github-bugzi...@puremagic.com 2013-04-17 14:03:12 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/de3a12435a92b6309ab11684c149eb527e458b75
Fix issue 9938 ICE using global interface variable in CTFE

Can't just use getValue() to get the value of the 'this', it might
be a global.

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


[Issue 7147] [CTFE] typeid() should be supported in CTFE

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7147


Walter Bright  changed:

   What|Removed |Added

   Platform|Other   |All
 OS/Version|Windows |All


--- Comment #1 from Walter Bright  2013-04-17 
14:00:26 PDT ---
https://github.com/D-Programming-Language/dmd/pull/1905

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


[Issue 9938] ICE using global interface variable in CTFE

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9938


Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #1 from Walter Bright  2013-04-17 
14:02:39 PDT ---
https://github.com/D-Programming-Language/dmd/pull/1906

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


[Issue 7147] [CTFE] typeid() should be supported in CTFE

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7147



--- Comment #2 from github-bugzi...@puremagic.com 2013-04-17 14:01:30 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/5d3aff1cc85b89bceaf09c5efa3174f1c823a0e0
Fix issue 7147 typeid() should be supported in CTFE

Recognize the lowering which happens in the front-end, and change
it to a reference to the static 'typeinfo' variable.

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


[Issue 9634] [CTFE] std.regex.ctRegex chokes on (?:a+)

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9634


Dmitry Olshansky  changed:

   What|Removed |Added

Summary|std.regex.ctRegex chokes on |[CTFE] std.regex.ctRegex
   |(?:a+)  |chokes on (?:a+)
   Severity|normal  |critical


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


[Issue 9634] std.regex.ctRegex chokes on (?:a+)

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9634



--- Comment #2 from Dmitry Olshansky  2013-04-17 
13:18:11 PDT ---
(In reply to comment #1)
> Created an attachment (id=1200) [details]
> Stripped down regex parser that shows the bug
> 

I think I've pinpointed the issue in an even smaller test case (~90 LOCs).
It directly relates to dealing with arrays of structs at CTFE.

Interesting point is that the assertion in main passes in the code below if you
switch 'Bytecode' struct that is nothing more then one int to simply int. Hence
my thought about structs being the trigger.


struct Bytecode
{
int raw;
}

struct Parser
{
dchar _current;
bool empty;
string pat;  
Bytecode[] ir; 

this(string pattern)
{
pat = pattern;
next();
uint fix;//fixup pointer
for(;;)
{
switch(current)
{
case '(':
next();
fix = cast(uint)ir.length;
assert(current == '?');
next();
assert(current == ':');
ir ~= Bytecode(-1);
next();
break;
case ')': //CRITICAL POINT: the last closing paren
//return; // up to this point generated bytecode is the same
next();
//return; //still OK
{ //CRITICAL POINT
size_t cnt = ir.length-fix-1;
//even simple write loop is failing with awful results
for(size_t i = 0; i < cnt; i++)
{
auto bc = Bytecode(i+10);
ir[fix+i] = bc;
}
}
return; // and here it differs
default:
uint start = cast(uint)ir.length;
ir ~= Bytecode(10*current);
next();
uint len = cast(uint)ir.length - start;
next();
ir ~= Bytecode(-4);
ir ~= ir[start .. start+len];
ir ~= Bytecode(-1);
}
}
}

@property dchar current(){ return _current; }

bool next()
{
if(pat.length == 0)
{
empty = true;
return false;
}
_current = pat[0];
pat = pat[1..$];
return true;
}
}

public auto getIr(string pattern)
{
auto ir = Parser(pattern).ir;
return ir;
}

void main()
{
auto re = getIr("(?:a+)");
static re2 = getIr("(?:a+)");  
//uncomment to see that it's a 3rd element of 2 arrays that differs
/*
import std.stdio;
writeln("RT version");
writeln(re);
writeln("\n\nCT version");
writeln(re2);
*/
assert(re == re2);
}

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


[Issue 7648] std.stdio expects file names to be encoded in CP_ACP on Windows instead of UTF-8

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7648



--- Comment #9 from github-bugzi...@puremagic.com 2013-04-17 13:13:08 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/c372571d1f868abd2294944b617f3863184462fe
Add note about Issue 7648 to `std.stdio.File`.

Issue URL: http://d.puremagic.com/issues/show_bug.cgi?id=7648

https://github.com/D-Programming-Language/phobos/commit/176976a57baf2505db894a314921dbaf8e347154
Merge pull request #1238 from denis-sh/add-note-about-Issue-7648

Add note about Issue 7648 to `std.stdio.File`.

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


[Issue 9950] std.json should return empty string/array instead of null on empty input

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9950


Andrej Mitrovic  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #1 from Andrej Mitrovic  2013-04-17 
08:44:15 PDT ---
https://github.com/D-Programming-Language/phobos/pull/1239

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


[Issue 9950] New: std.json should return empty string/array instead of null on empty input

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9950

   Summary: std.json should return empty string/array instead of
null on empty input
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Keywords: pull
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic  2013-04-17 
08:44:01 PDT ---
These should pass:

auto str = parseJSON(`""`).str;
assert(str !is null);
assert(str == "");

auto arr = parseJSON(`[]`).array;
assert(array !is null); 
assert(array.length == 0)

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


[Issue 9949] New: template initialization when alias cannot be read at compile time

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9949

   Summary: template initialization when alias cannot be read at
compile time
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: luka8...@owave.net


--- Comment #0 from luka8088  2013-04-17 06:17:01 PDT ---
The following code compiles aldo s is not readable at compile time:

struct S (alias T) {
  typeof(T) value;
}

void main () {
  auto s = "some";
  s ~= "string";
  S!s value;
}


The side effect of this is the following error:

// Error: function literal __lambda3 (S!(s) a) is not
// callable using argument types (S!(s))

module program;

import std.stdio;

struct S (alias T) {
  typeof(T) value;
}

void f (alias l = x => 1) (string s) {
  l(S!(s).init);
}

void main () {
  auto s = "some";
  s ~= "string";
  f!((S!s a) { return 1; })(s);
}


I am not sure what the correct behavior should be, I think that the first code
should not compile. But if it should, and this is the correct behavior than the
error message should definitely be improved because.

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


[Issue 7016] local import does not create -deps dependency

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7016



--- Comment #7 from jfanati...@gmx.at 2013-04-17 06:10:03 PDT ---
(In reply to comment #6)
> jfanatiker, the compiler is supposed to print the dependencies between all
> modules when given just the starting point. This is the purpose of the -deps
> switch, it is not intended to be run once for every module in the program. The
> same goes for the verbose output (-v).

I see. You are right of course, I viewed it from an incremental build tool
perspective, where it would not matter, but for rdmd this bug is of course a
problem.

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


[Issue 7016] local import does not create -deps dependency

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7016



--- Comment #6 from Vladimir Panteleev  2013-04-17 
15:53:52 EEST ---
jfanatiker, the compiler is supposed to print the dependencies between all
modules when given just the starting point. This is the purpose of the -deps
switch, it is not intended to be run once for every module in the program. The
same goes for the verbose output (-v).

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


[Issue 7016] local import does not create -deps dependency

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7016


jfanati...@gmx.at changed:

   What|Removed |Added

 CC||jfanati...@gmx.at


--- Comment #5 from jfanati...@gmx.at 2013-04-17 05:46:19 PDT ---
I am not sure this really needs to be fixed:

b.d either needs to be built at some point, then the dependency is printed and
can be gathered by tools or it does not get built, in this case it does not
matter either, because any use of the function would need to be inlined,
causing the dependency to be printed. If the function is not used at all, then
the dependency also does not matter.

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


[Issue 9948] New: -deps dependency printing incorrect for templates

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9948

   Summary: -deps dependency printing incorrect for templates
   Product: D
   Version: unspecified
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: jfanati...@gmx.at


--- Comment #0 from jfanati...@gmx.at 2013-04-17 05:49:39 PDT ---
Currently the emitted dependencies are incorrect for templates:

Dependencies are emitted for the module that references the dependency, even if
this reference is within a template. This is incorrect, as only the code
instantiating the template really depends on the template dependencies, there
is no need to rebuild a module, if an import within a template changes.

Consider this simplified example, which makes the issue most clear:
```D
// module a
void templateFunc(string myImport)() {
   mixin(myImport);
// 
}

// module b:
void main() {
   templateFunc("import std.string;")();
}
```
It seems a bit artificial, but in fact it is not (consider Diet templates for
example). In this example the dependencies for module "a" change, depending on
what code it uses.

The effect is not severe, it will just make build tools less efficient, because
modules need to be compiled needlessly, it should nevertheless be fixed.

I have a patch in the works already.

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


[Issue 9931] Mac OS X ABI not followed when returning structs for extern (C)

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9931



--- Comment #17 from Jacob Carlborg  2013-04-17 05:17:36 PDT ---
(In reply to comment #15)

> Much better. Changed it.

Cool, thanks.

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


[Issue 9931] Mac OS X ABI not followed when returning structs for extern (C)

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9931



--- Comment #16 from Jacob Carlborg  2013-04-17 05:17:13 PDT ---
(In reply to comment #14)

> Based on how the codegen changes with adding a temporary variable in linux, it
> should be safe. Disassembly from OS X could confirm that.
> 
> BUT:
> 
> That's only for this particular example, with a particular set of compiler
> setting. It's exactly the sort of thing optimisers mess around with. 
> Personally
> I would not risk it.

I suspected that. The thing is that I'm stuck with a D1 code base. I want to
finished that before I port it to D2. So I'm hoping that a fix for this will be
applied to the D1 branch as well.

Otherwise I guess I'll have to avoid any optimizations until I've ported it to
D2.

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


[Issue 9931] Mac OS X ABI not followed when returning structs for extern (C)

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9931



--- Comment #15 from John Colvin  2013-04-17 
12:56:05 BST ---
(In reply to comment #13)
> Would "Mac OS X ABI not followed when returning structs for extern (C)" be a
> better title for the issue. Can I changed that?

Much better. Changed it.

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


[Issue 9931] Mac OS X ABI not followed when returning structs for extern (C)

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9931



--- Comment #14 from John Colvin  2013-04-17 
12:55:37 BST ---
(In reply to comment #12)
> I'm still wondering though:
> 
> * Why does it work on Mac OS X 10.6.3, luck?

http://forum.dlang.org/post/ixoawrwanlopvgzlj...@forum.dlang.org

> * Is using a temporary variable in "bar" a safe workaround?

Based on how the codegen changes with adding a temporary variable in linux, it
should be safe. Disassembly from OS X could confirm that.

BUT:

That's only for this particular example, with a particular set of compiler
setting. It's exactly the sort of thing optimisers mess around with. Personally
I would not risk it.

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


[Issue 9931] Bus error interfacing with C function returning structs with floats

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9931



--- Comment #13 from Jacob Carlborg  2013-04-17 04:20:57 PDT ---
Would "Mac OS X ABI not followed when returning structs for extern (C)" be a
better title for the issue. Can I changed that?

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


[Issue 9931] Bus error interfacing with C function returning structs with floats

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9931


Jacob Carlborg  changed:

   What|Removed |Added

Version|D2  |D1 & D2
   Severity|normal  |critical


--- Comment #11 from Jacob Carlborg  2013-04-17 04:16:38 PDT ---
Raising to critical.

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


[Issue 9931] Bus error interfacing with C function returning structs with floats

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9931



--- Comment #12 from Jacob Carlborg  2013-04-17 04:18:45 PDT ---
I'm still wondering though:

* Why does it work on Mac OS X 10.6.3, luck?
* Is using a temporary variable in "bar" a safe workaround?

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


[Issue 9931] Bus error interfacing with C function returning structs with floats

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9931



--- Comment #10 from John Colvin  2013-04-17 
10:58:11 BST ---
(In reply to comment #9)
> (In reply to comment #7)
> > 0x267c : call   0x26a0 
> > 0x2681 : add$0xc,%esp
> > 0x2684 : mov%eax,%esi // <- EAX is 
> > trashed
> > 0x2686 : mov-0x4(%ebp),%edi
> > 0x2689 : movsl  %ds:(%esi),%es:(%edi)
> > 0x268a : movsl  %ds:(%esi),%es:(%edi)
> > 0x268b : movsl  %ds:(%esi),%es:(%edi)
> 
> You're reading it the wrong way around, at&t is src,des

Sorry, my mistake, I misunderstood you. Martin, you are completely correct. Dmd
is presuming that the pointer to the struct is returned in eax but foo sets
that to 0, as it is entitled to. Hence movs is reading from 0.

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


[Issue 9931] Bus error interfacing with C function returning structs with floats

2013-04-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9931


John Colvin  changed:

   What|Removed |Added

 CC||john.loughran.colvin@gmail.
   ||com


--- Comment #9 from John Colvin  2013-04-17 
08:04:52 BST ---
(In reply to comment #7)
> 0x267c : call   0x26a0 
> 0x2681 : add$0xc,%esp
> 0x2684 : mov%eax,%esi // <- EAX is trashed
> 0x2686 : mov-0x4(%ebp),%edi
> 0x2689 : movsl  %ds:(%esi),%es:(%edi)
> 0x268a : movsl  %ds:(%esi),%es:(%edi)
> 0x268b : movsl  %ds:(%esi),%es:(%edi)

You're reading it the wrong way around, at&t is src,des

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