[Bug c/50254] gcc-4.5 -fstrict-aliasing -fschedule-insns optimization produces wrong code

2011-09-01 Thread vzapolskiy at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50254

Vladimir Zapolskiy  changed:

   What|Removed |Added

 Status|RESOLVED|CLOSED

--- Comment #3 from Vladimir Zapolskiy  2011-09-01 
09:37:33 UTC ---
Closed, thanks.


[Bug c/50254] gcc-4.5 -fstrict-aliasing -fschedule-insns optimization produces wrong code

2011-09-01 Thread vzapolskiy at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50254

Vladimir Zapolskiy  changed:

   What|Removed |Added

  Attachment #25154|0   |1
is obsolete||

--- Comment #2 from Vladimir Zapolskiy  2011-09-01 
09:37:00 UTC ---
Created attachment 25157
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25157
test code

(In reply to comment #1)
> qentry->next  = (void *)qhead;
> 
> is voiolating strict aliasing rules if you ever end up loading/storing
> qentry->next->{prev,next}.

Thank you very much for the quick response.

I managed to reduce a test case and hopefully understand strict aliasing rules.


[Bug c/50254] New: gcc-4.5 -fstrict-aliasing -fschedule-insns optimization produces wrong code

2011-08-31 Thread vzapolskiy at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50254

 Bug #: 50254
   Summary: gcc-4.5 -fstrict-aliasing -fschedule-insns
optimization produces wrong code
Classification: Unclassified
   Product: gcc
   Version: 4.5.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: vzapols...@gmail.com


Created attachment 25154
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25154
test code

Hello,

recently my team found a problem in our code after a gcc compiler update from
gcc-4.4 to gcc-4.5. I've extracted the problematic code snippet, you can find
it in the attachement.

The problem is unveiled, if you try to compile the test with various
combinations of base optimization and strict-aliasing and fschedule-insns
flags.

For instance that's what I get on my amd64/gcc-4.6.0:

$ gcc -O0  test.c -o test && ./test
$ gcc -O0  -fschedule-insnstest.c -o test && ./test
$ gcc -O0 -fstrict-aliasingtest.c -o test && ./test
$ gcc -O0 -fstrict-aliasing-fschedule-insnstest.c -o test && ./test
Aborted
$ gcc -O1  test.c -o test && ./test
$ gcc -O1  -fschedule-insnstest.c -o test && ./test
$ gcc -O1 -fstrict-aliasingtest.c -o test && ./test
Aborted
$ gcc -O1 -fstrict-aliasing-fschedule-insnstest.c -o test && ./test
Aborted
$ gcc -O2  test.c -o test && ./test
Aborted
$ gcc -O2 -fno-strict-aliasing test.c -o test && ./test
$ gcc -O2  -fno-schedule-insns test.c -o test && ./test
Aborted
$ gcc -O2 -fno-strict-aliasing -fno-schedule-insns test.c -o test && ./test
$ 


The problem described above is reproducible on armv7, i386, amd64 target
architectures with gcc-4.5 and gcc-4.6 compilers.

The issue might be invalid, but because it hasn't been known with gcc-4.4, I'd
greatly appreciate to get some comments from GCC team on it.

Thank you in advance.


[Bug libstdc++/39238] trunk revision 144279 - cfenv:54: error: �::fenv_t� has not been declared

2009-08-27 Thread vzapolskiy at gmail dot com


--- Comment #10 from vzapolskiy at gmail dot com  2009-08-27 16:00 ---
I have encountered the same problem with reverse cross compilation of gcc-4.3
branch on Linux for powerpc target. The problem was introduced in #38000
(revision 143194), and safe solution is just to revert the changes on the next
files:
* libstdc++-v3/include/c_global/cfenv
* libstdc++-v3/include/tr1/cfenv
* libstdc++-v3/include/tr1_impl/cfenv
* libstdc++-v3/include/c_compatibility/fenv.h

Proposed patch for gcc-4_4-branch (revision 151142) is attached.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39238



[Bug libstdc++/39238] trunk revision 144279 - cfenv:54: error: �::fenv_t� has not been declared

2009-08-27 Thread vzapolskiy at gmail dot com


--- Comment #9 from vzapolskiy at gmail dot com  2009-08-27 15:59 ---
Created an attachment (id=18438)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18438&action=view)
proposed patch for the problem resolution on gcc-4_4-branch


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39238