public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/2635: Incorrect output in SIMPLE program when using -O2 (Both Linux and Solaris) gcc version 2.95.2 19991024 (release)gcc version 2.95.2 19991024 (release)
@ 2001-06-09  7:30 jsm28
  0 siblings, 0 replies; 2+ messages in thread
From: jsm28 @ 2001-06-09  7:30 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, jsm28, nobody, rossc

Synopsis: Incorrect output in SIMPLE program when using -O2 (Both Linux and Solaris) gcc version 2.95.2 19991024 (release)gcc version 2.95.2 19991024 (release)

State-Changed-From-To: feedback->closed
State-Changed-By: jsm28
State-Changed-When: Sat Jun  9 07:30:11 2001
State-Changed-Why:
    Fixed in 3.0 (and it seems in 2.95.3 as well).

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2635&database=gcc


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

* c/2635: Incorrect output in SIMPLE program when using -O2 (Both Linux and Solaris) gcc version 2.95.2 19991024 (release)gcc version 2.95.2 19991024 (release)
@ 2001-04-25  5:06 rossc
  0 siblings, 0 replies; 2+ messages in thread
From: rossc @ 2001-04-25  5:06 UTC (permalink / raw)
  To: gcc-gnats

>Number:         2635
>Category:       c
>Synopsis:       Incorrect output in SIMPLE program when using -O2 (Both Linux and Solaris) gcc version 2.95.2 19991024 (release)gcc version 2.95.2 19991024 (release)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 25 05:06:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Charles Ross (rossc@cs.colostate.edu)
>Release:        gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
Redhat Linux 6.2 (kernel 2.2.17-14) AND Solaris 5.8
These are the only two I have tested it on, 
so I assume it is a platform independant bug.
>Description:
I have created a small (19 line) example which includes
NO other files.

The program is quite simple.  Note that it is basically
4 copies of the same 3 line program interlaced.. If you 
replicate it further (ie: 100 copies of the same 3 line
program interlaced), then the ouput gets even stranger I
have made a meta program which generates them. I am 
including it as well in b.c, but I doubt you'll need it.

There need to be 4 (or more) copies in the linux version 
to show the error, but the solaris version shows it with
only 1 copy.

It was origionally a piece of code which was doing page
size calculations.. 4096 is the page size on linux, and
I was attempting to compute the number of pages needed for
a piece of data.  Hoever I was able to decompose it down to
this code.


The output is correct when no optimizations are used,
but fail when -O2 is used.
Output is different on Linux and solaris when -O2 is used,
but both are incorrect.

I have included the .c file (a.c)
(no .i file, cause there are no includes)
and the output when using the -v option (a.v)
the a.v file was generated under linux.
>How-To-Repeat:
gcc -O2 a.c
a.out

>Fix:
Um... dont use -O2 I guess... but that seems more like
a cheezy workarround than a fix.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="b.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="b.c"


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

end of thread, other threads:[~2001-06-09  7:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-09  7:30 c/2635: Incorrect output in SIMPLE program when using -O2 (Both Linux and Solaris) gcc version 2.95.2 19991024 (release)gcc version 2.95.2 19991024 (release) jsm28
  -- strict thread matches above, loose matches on Subject: below --
2001-04-25  5:06 rossc

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