NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain/40066: gcc -O1 generates wrong code in loop optimize



The following reply was made to PR toolchain/40066; it has been noted by GNATS.

From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: toolchain-manager%NetBSD.org@localhost, gnats-admin%NetBSD.org@localhost,
        matthew green <mrg%eterna.com.au@localhost>, 
tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: toolchain/40066: gcc -O1 generates wrong code in loop optimize
         
Date: Sun, 30 Nov 2008 13:53:54 +0900

 mrg%eterna.com.au@localhost wrote:
 
 >  this problem does not occur on sparc64 or amd64 with 64 bit
 >  binaries.
 >  
 >  on amd64 with "cc -m32" it also works fine.  with "-march=i386" it fails.
 >  with "-march=i686" it works.  this is kind of bizarre.
 
 More bizarre:
 
 ---
 struct kwinst {
         int                     k_type;
         const char              *k_word;
         union kwval {
                 int64_t         u_sint;
         } k_u;
 #define k_int   k_u.u_sint
 };
 ---
 
 This causes the similar problem (garbage in *k_word)
 while the following one works:
 
 ---
 struct kwinst {
         int                     k_type;
         const char              *k_word;
         int64_t                        k_int;
 };
 ---
 
 Using int32_t instead of int64_t produces the same results,
 so the problem is around union in struct?
 Or any special behavior (un)defined in C99?
 ---
 Izumi Tsutsui
 


Home | Main Index | Thread Index | Old Index