public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/45122]  New: [4.6 Regression] -funsafe-loop-optimizations causes FAIL: gcc.c-torture/execute/pr27285.c execution
@ 2010-07-29  1:13 zsojka at seznam dot cz
  2010-07-29  1:25 ` [Bug tree-optimization/45122] " zsojka at seznam dot cz
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: zsojka at seznam dot cz @ 2010-07-29  1:13 UTC (permalink / raw)
  To: gcc-bugs

With -funsafe-loop-optimizations in flags, pr27285.c FAILs:
FAIL: gcc.c-torture/execute/pr27285.c execution,  -O1 
FAIL: gcc.c-torture/execute/pr27285.c execution,  -O2 
FAIL: gcc.c-torture/execute/pr27285.c execution,  -O3 -fomit-frame-pointer 
FAIL: gcc.c-torture/execute/pr27285.c execution,  -O3 -fomit-frame-pointer
-funroll-loops 
FAIL: gcc.c-torture/execute/pr27285.c execution,  -O3 -fomit-frame-pointer
-funroll-all-loops -finline-functions 
FAIL: gcc.c-torture/execute/pr27285.c execution,  -O3 -g 
FAIL: gcc.c-torture/execute/pr27285.c execution,  -O2 -flto 
FAIL: gcc.c-torture/execute/pr27285.c execution,  -O2 -fwhopr 

Output:
$ gcc -O -funsafe-loop-optimizations pr27285.i -Wunsafe-loop-optimizations
/mnt/svn/gcc-trunk/gcc/testsuite/gcc.c-torture/execute/pr27285.c: In function
'foo':
/mnt/svn/gcc-trunk/gcc/testsuite/gcc.c-torture/execute/pr27285.c:19:10:
warning: assuming that the loop counter does not overflow
[-Wunsafe-loop-optimizations]
/mnt/svn/gcc-trunk/gcc/testsuite/gcc.c-torture/execute/pr27285.c:17:9: warning:
assuming that the loop counter does not overflow [-Wunsafe-loop-optimizations]
$ ./a.out 
Aborted

There is no overflow in the loop.

When compiled with -funsafe-loop-optimizations, the loop is exited when 'b' has
value 1 (that is, e[a] = d[a] & c; is not executed when b == 0). 'b' has values
of 25,17,19,1 (and then the loop ends) - without -funsafe-loop-optimizations,
it has values 25,17,19,1,0.

Even though -funsafe-loop-optimizations is expected to be unsafe, this
behaviour makes it unusable. The loop is finite and the counter doesn't
overflow, so this is a wrong code generated.

Tested revisions:
r162653 - fail
r162456 - OK


-- 
           Summary: [4.6 Regression] -funsafe-loop-optimizations causes
                    FAIL: gcc.c-torture/execute/pr27285.c execution
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: zsojka at seznam dot cz
  GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2011-02-03  6:07 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-45122-4@http.gcc.gnu.org/bugzilla/>
2010-11-10 14:45 ` [Bug tree-optimization/45122] [4.6 Regression] -funsafe-loop-optimizations causes FAIL: gcc.c-torture/execute/pr27285.c execution rguenth at gcc dot gnu.org
2011-01-16  4:10 ` aoliva at gcc dot gnu.org
2011-01-16  8:30 ` aoliva at gcc dot gnu.org
2011-01-16  8:32 ` aoliva at gcc dot gnu.org
2011-01-16  8:36 ` aoliva at gcc dot gnu.org
2011-01-16  9:35 ` aoliva at gcc dot gnu.org
2011-01-19 16:39 ` rguenth at gcc dot gnu.org
2011-01-28  8:53 ` aoliva at gcc dot gnu.org
2011-01-28 11:13 ` rguenth at gcc dot gnu.org
2011-01-30 19:21 ` rakdver at gcc dot gnu.org
2011-01-31 19:44 ` jakub at gcc dot gnu.org
2011-02-01 11:02 ` jakub at gcc dot gnu.org
2011-02-01 11:28 ` rakdver at gcc dot gnu.org
2011-02-02 13:54 ` jakub at gcc dot gnu.org
2011-02-03  6:01 ` aoliva at gcc dot gnu.org
2011-02-03  6:07 ` aoliva at gcc dot gnu.org
2010-07-29  1:13 [Bug tree-optimization/45122] New: " zsojka at seznam dot cz
2010-07-29  1:25 ` [Bug tree-optimization/45122] " zsojka at seznam dot cz
2010-07-29  1:28 ` pinskia at gcc dot gnu dot org
2010-07-29  9:40 ` rguenth at gcc dot gnu dot org
2010-09-02 11:13 ` rguenth at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).