From: SourceForge.net <no...@so...> - 2009-07-31 16:33:06
|
Bugs item #2830386, was opened at 2009-07-31 11:54 Message generated for change (Settings changed) made by earnie You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2830386&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: None >Group: 64 bit feature request >Status: Closed >Resolution: Invalid Priority: 5 Private: No Submitted By: Paul Pluzhnikov (ppluzhnikov) Assigned to: Nobody/Anonymous (nobody) Summary: stat produces incorrect result with w64-mingw under -O2 Initial Comment: This is a continuation of http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40909 Test: --- t.c --- #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> int main(int argc, char *argv[]) { struct stat st; if (0 == stat(argv[0], &st)) printf("mode = %x\n", st.st_mode); return 0; } --- t.c --- Using x86_64-w64-mingw32-gcc (GCC) 4.5.0 20090726 (experimental) from here: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-cygwin-1.5.25-15_20090726.tar.bz2/download /usr/local/mingw-w64/bin/x86_64-w64-mingw32-gcc -g t.c -O2 && ./a.exe mode = 0 /usr/local/mingw-w64/bin/x86_64-w64-mingw32-gcc -g t.c -O0 && ./a.exe mode = 81ff /usr/local/mingw-w64/bin/x86_64-w64-mingw32-gcc -g t.c -O2 -fno-strict-aliasing && ./a.exe mode = 81ff According to GCC developers, this: extern __inline__ int __attribute__((__cdecl__)) stat(const char *_Filename,struct stat *_Stat) { return _stat64i32(_Filename,(struct _stat64i32 *)_Stat); is an aliasing violation. ---------------------------------------------------------------------- Comment By: Paul Pluzhnikov (ppluzhnikov) Date: 2009-07-31 12:06 Message: >From sezeroz at gmail dot com: Wrong project tracker. Please go to https://sourceforge.net/tracker/?group_id=202880 for the mingw-w64 tracker. BTW, I worked around the issue in our svn by adding optimize("0") attributes to those one-line inlines for now. Use revision 1108 and it'll be fine. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2830386&group_id=2435 |