public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/5781: "-O -funroll-loops" breaks machine code output
@ 2002-02-26 17:20 rodrigc
  0 siblings, 0 replies; 3+ messages in thread
From: rodrigc @ 2002-02-26 17:20 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, jodaman, nobody

Synopsis: "-O -funroll-loops" breaks machine code output

State-Changed-From-To: open->closed
State-Changed-By: rodrigc
State-Changed-When: Tue Feb 26 17:00:19 2002
State-Changed-Why:
    Fixed in gcc 3.1.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5781


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

* Re: optimization/5781: "-O -funroll-loops" breaks machine code output
@ 2002-02-25 21:46 Andrew Pinski
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Pinski @ 2002-02-25 21:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Andrew Pinski <pinskia@physics.uc.edu>
To: jodaman@cegt201.bradley.edu
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: optimization/5781: "-O -funroll-loops" breaks machine code output
Date: Tue, 26 Feb 2002 00:17:49 -0500

 This has been fixed in at least 3.1 (20020223) so you can close this bug 
 report since 3.1
 is scheduled to be released on April 15.
 Thanks,
 Andrew Pinski
 
 
 On Monday, February 25, 2002, at 10:11 , jodaman@cegt201.bradley.edu 
 wrote:
 
 >
 >> Number:         5781
 >> Category:       optimization
 >> Synopsis:       "-O -funroll-loops" breaks machine code output
 >> Confidential:   no
 >> Severity:       serious
 >> Priority:       medium
 >> Responsible:    unassigned
 >> State:          open
 >> Class:          wrong-code
 >> Submitter-Id:   net
 >> Arrival-Date:   Mon Feb 25 19:16:01 PST 2002
 >> Closed-Date:
 >> Last-Modified:
 >> Originator:     jodaman@ee1.bradley.edu
 >> Release:        gcc version 3.0.4
 >> Organization:
 >> Environment:
 > Linux version 2.2.20 #1 Wed Feb 6 06:07:24 CST 2002
 > arch: i686
 >> Description:
 > Under certain conditions, the loop unrolling optimization
 > will yield faulty code.  The resulting code may overwrite
 > the bounds of an array in a loop.  Attached is a small test
 > case that will crash because of this problem.
 >
 > Another problem test case is the LAME audio encoder
 > (http://lame.sourceforge.net/) with "-O3 -funroll-loops"
 > or "-O2 -funroll-loops" enabled.  The developers of LAME
 > are aware of the this gcc issue and have recently removed
 > "-funroll-loops" for all gcc version 3 compiles.
 >
 > Disabling "-funroll-loops" until this problem is resolved
 > may be wise because of the nature of the problem.  In some
 > cases, GCC may silently overstep the bounds of an array
 > without any apparent immediate failure.  All code compiled
 > with optimization and "-funroll-loops" with GCC 3.0.3 or
 > 3.0.4 is suspect.  (GCC 3.0.2 might not have this problem.)
 >> How-To-Repeat:
 > Test case fails (crashes):
 >  gcc-3.0.4 -O -funroll-loops test-O_unroll.c -o test; ./test
 >
 > Test case completes:
 >  gcc-3.0.4 -O test-O_unroll.c -o test; ./test
 >> Fix:
 >
 >> Release-Note:
 >> Audit-Trail:
 >> Unformatted:
 > ----gnatsweb-attachment----
 > Content-Type: application/octet-stream; name="test-O_unroll.c"
 > Content-Transfer-Encoding: base64
 > Content-Disposition: attachment; filename="test-O_unroll.c"
 >
 > LyoqCiAqIEBmaWxlICAgdGVzdC1PX3Vucm9sbC5jCiAqIEBhdXRob3IgSm9obiBEYWhsc3Ryb20g
 > PGpvZGFtYW5AZWUxLmJyYWRsZXkuZWR1PgogKgogKiB0ZXN0IGNhc2UgZm9yICItTyAtZnVucm9s
 > bC1sb29wcyIgYnVnIG9mIGdjYyAzLjAuMyBhbmQgMy4wLjQKICovCgppbnQgKmdldEEoKTsKaW50
 > ICoqZ2V0QigpOwoKaW50IG1haW4oKSB7CiAgaW50IHg7CiAgaW50IGk7CiAgaW50ICphICA9IGdl
 > dEEoKTsKICBpbnQgKipiID0gZ2V0QigpOyAKCiAgZm9yKCB4ID0gMDsgeCA8IDQ7IHgrKyApCiAg
 > ICBmb3IoIGkgPSAxOTsgLS1pID49IDA7ICkKICAgICAgaWYoYVtpXSA8IHgpCiAgICAgICAgYlt4
 > XVtpXSA9IHg7CgogIHJldHVybiAwOwp9CgpzdGF0aWMgaW50IGF6WzMyXSA9IHsgLTEsLTEsLTEs
 > LTEsIC0xLC0xLC0xLC0xLCAgMCwgMCwgMCwgMCwgIDEsIDEsIDEsIDEsCiAgICAgICAgICAgICAg
 > ICAgICAgICAgMSwgMiwgMiwgMiwgIDIsIDIsIDMsIDMsICAzLCA0LC0xLC0xLCAtMSwtMSwtMSwt
 > MSB9OwpzdGF0aWMgc3RydWN0IHsKICBpbnQgKmJbNF07CiAgaW50IGJiWzQgKiAzMl07Cn0gYno7
 > CgppbnQgKmdldEEoKSB7CiAgcmV0dXJuKCAmYXpbOF0gKTsKfQoKaW50ICoqZ2V0QigpIHsKICBp
 > bnQgaTsKICBmb3IoIGkgPSAwOyBpIDwgNDsgaSsrICkKICAgIGJ6LmJbaV0gPSAmYnouYmJbaSAq
 > IDMyXTsKICByZXR1cm4oIGJ6LmIgKTsKfQo=
 >
 >
 


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

* optimization/5781: "-O -funroll-loops" breaks machine code output
@ 2002-02-25 19:56 jodaman
  0 siblings, 0 replies; 3+ messages in thread
From: jodaman @ 2002-02-25 19:56 UTC (permalink / raw)
  To: gcc-gnats


>Number:         5781
>Category:       optimization
>Synopsis:       "-O -funroll-loops" breaks machine code output
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 25 19:16:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     jodaman@ee1.bradley.edu
>Release:        gcc version 3.0.4
>Organization:
>Environment:
Linux version 2.2.20 #1 Wed Feb 6 06:07:24 CST 2002
arch: i686
>Description:
Under certain conditions, the loop unrolling optimization
will yield faulty code.  The resulting code may overwrite
the bounds of an array in a loop.  Attached is a small test
case that will crash because of this problem.

Another problem test case is the LAME audio encoder
(http://lame.sourceforge.net/) with "-O3 -funroll-loops"
or "-O2 -funroll-loops" enabled.  The developers of LAME
are aware of the this gcc issue and have recently removed
"-funroll-loops" for all gcc version 3 compiles.

Disabling "-funroll-loops" until this problem is resolved
may be wise because of the nature of the problem.  In some
cases, GCC may silently overstep the bounds of an array
without any apparent immediate failure.  All code compiled
with optimization and "-funroll-loops" with GCC 3.0.3 or
3.0.4 is suspect.  (GCC 3.0.2 might not have this problem.)
>How-To-Repeat:
Test case fails (crashes):
 gcc-3.0.4 -O -funroll-loops test-O_unroll.c -o test; ./test

Test case completes:
 gcc-3.0.4 -O test-O_unroll.c -o test; ./test
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="test-O_unroll.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test-O_unroll.c"

LyoqCiAqIEBmaWxlICAgdGVzdC1PX3Vucm9sbC5jCiAqIEBhdXRob3IgSm9obiBEYWhsc3Ryb20g
PGpvZGFtYW5AZWUxLmJyYWRsZXkuZWR1PgogKgogKiB0ZXN0IGNhc2UgZm9yICItTyAtZnVucm9s
bC1sb29wcyIgYnVnIG9mIGdjYyAzLjAuMyBhbmQgMy4wLjQKICovCgppbnQgKmdldEEoKTsKaW50
ICoqZ2V0QigpOwoKaW50IG1haW4oKSB7CiAgaW50IHg7CiAgaW50IGk7CiAgaW50ICphICA9IGdl
dEEoKTsKICBpbnQgKipiID0gZ2V0QigpOyAKCiAgZm9yKCB4ID0gMDsgeCA8IDQ7IHgrKyApCiAg
ICBmb3IoIGkgPSAxOTsgLS1pID49IDA7ICkKICAgICAgaWYoYVtpXSA8IHgpCiAgICAgICAgYlt4
XVtpXSA9IHg7CgogIHJldHVybiAwOwp9CgpzdGF0aWMgaW50IGF6WzMyXSA9IHsgLTEsLTEsLTEs
LTEsIC0xLC0xLC0xLC0xLCAgMCwgMCwgMCwgMCwgIDEsIDEsIDEsIDEsCiAgICAgICAgICAgICAg
ICAgICAgICAgMSwgMiwgMiwgMiwgIDIsIDIsIDMsIDMsICAzLCA0LC0xLC0xLCAtMSwtMSwtMSwt
MSB9OwpzdGF0aWMgc3RydWN0IHsKICBpbnQgKmJbNF07CiAgaW50IGJiWzQgKiAzMl07Cn0gYno7
CgppbnQgKmdldEEoKSB7CiAgcmV0dXJuKCAmYXpbOF0gKTsKfQoKaW50ICoqZ2V0QigpIHsKICBp
bnQgaTsKICBmb3IoIGkgPSAwOyBpIDwgNDsgaSsrICkKICAgIGJ6LmJbaV0gPSAmYnouYmJbaSAq
IDMyXTsKICByZXR1cm4oIGJ6LmIgKTsKfQo=


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

end of thread, other threads:[~2002-02-27  1:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-26 17:20 optimization/5781: "-O -funroll-loops" breaks machine code output rodrigc
  -- strict thread matches above, loose matches on Subject: below --
2002-02-25 21:46 Andrew Pinski
2002-02-25 19:56 jodaman

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).