[Issue 4169] building dmd with a modern gcc produces a buggy compiler

2015-06-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4169

Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

Version|unspecified |D2

--


[Issue 4169] building dmd with a modern gcc produces a buggy compiler

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4169


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

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED


--- Comment #6 from Walter Bright bugzi...@digitalmars.com 2010-05-26 
12:47:48 PDT ---
http://www.dsource.org/projects/dmd/changeset/502

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


[Issue 4169] building dmd with a modern gcc produces a buggy compiler

2010-05-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4169


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #4 from Walter Bright bugzi...@digitalmars.com 2010-05-25 
15:09:04 PDT ---
http://www.dsource.org/projects/dmd/changeset/501

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


[Issue 4169] building dmd with a modern gcc produces a buggy compiler

2010-05-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4169


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

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |


--- Comment #5 from Brad Roberts bra...@puremagic.com 2010-05-25 20:55:50 PDT 
---
Looks like you missed one file's changes:

diff --git a/src/mtype.c b/src/mtype.c
--- a/src/mtype.c
+++ b/src/mtype.c
@@ -2832,14 +2832,17 @@ Expression *TypeBasic::defaultInit(Loc loc)
  * so that uninitialised variables can be
  * detected even if exceptions are disabled.
  */
-unsigned short snan[8] = { 0, 0, 0, 0xA000, 0x7FFF };
+union {
+unsigned short us[8];
+long doubleld;
+} snan = {{ 0, 0, 0, 0xA000, 0x7FFF }};
 /*
  * Although long doubles are 10 bytes long, some
  * C ABIs pad them out to 12 or even 16 bytes, so
  * leave enough space in the snan array.
  */
 assert(REALSIZE = sizeof(snan));
-d_float80 fvalue = *(long double*)snan;
+d_float80 fvalue = snan.ld;
 #endif

 #if LOGDEFAULTINIT


The rest of the compiler builds w/o aliasing warnings on my box from tip of svn
now.

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


[Issue 4169] building dmd with a modern gcc produces a buggy compiler

2010-05-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4169



--- Comment #3 from Brad Roberts bra...@puremagic.com 2010-05-15 19:02:15 PDT 
---
Created an attachment (id=631)
fix all aliasing warnings found by gcc 4.4.3

This change sets fixes all the aliasing warnings found by gcc 4.4.3 with
-Wstrict-aliasing.  The dmd test suite passes now, where is it didn't before
unless built with -fno-strict-aliasing.

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


[Issue 4169] building dmd with a modern gcc produces a buggy compiler

2010-05-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4169


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

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #1 from Walter Bright bugzi...@digitalmars.com 2010-05-09 
19:39:10 PDT ---
Wikipedia says: To enable such optimizations in a predictable manner, the ISO
standard for the C programming language (including its newer C99 edition)
specifies that it is illegal (with some exceptions) for pointers of different
types to reference the same memory location. This rule, known as strict
aliasing, allows impressive increases in performance[citation needed], but has
been known to break some otherwise valid code. Several software projects
intentionally violate this portion of the C99 standard. For example, Python 2.x
did so to implement reference counting,[1] and required changes to the basic
object structs in Python 3 to enable this optimisation. The Linux kernel does
this because strict aliasing causes problems with optimization of inlined
code.[2] In such cases, when compiled with gcc, the option -fno-strict-aliasing
is invoked to prevent unwanted or invalid optimizations that could produce
incorrect code.

The compiler does do a lot of aliasing, so I don't know if this is a gcc bug or
a dmd bug. The way to track it down is to compile half of dmd with
no-strict-aliasing, the other half without, see if it still fails/succeeds.
This isolates it down to which half has the problem. Rinse, repeat, until the
offending source file is isolated.

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