public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/21322] New: O2 and O3 memory access error - compiled program - incorrect debug output
@ 2005-05-01 19:11 fastsnip-gcc at yahoo dot com
  2005-05-03 20:17 ` [Bug other/21322] " jsm28 at gcc dot gnu dot org
  2005-07-06 14:29 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 4+ messages in thread
From: fastsnip-gcc at yahoo dot com @ 2005-05-01 19:11 UTC (permalink / raw)
  To: gcc-bugs

I have reviewed the gcc web page for reporting bugs and this situation is not 
covered.

I have a program that I have been compiling with the gcc 2.9 and 3.4 series.

In the past week I upgraded to gcc 4.0.0

I compiled the program and corrected the warning message about using "unsigned 
char *" when the function prototype specified "char *" and vice versa.

The program files are compiled with the following command line in the make 
file:

gcc -O3 -std=c99 -Wunused-variable -o $@  -lm $(OBJS)

There is no compiler output beyond reporting the command line invocation. No 
warning messages, no compiler errors of any kind.

The program has run for many years with no problem. Under gcc 4.0.0, I get a 
memory access error.

If I change the compile command in the make file to:

gcc -g -std=c99 -Wunused-variable -o $@  -lm $(OBJS)

The program runs with no error.

Changing the optimization option to "O" and compiling and the program again 
runs with no error.

Only when I compile with an optimization level of "O2" or "O3" does the 
program exit with a memory access error.

I have attempted to compile with "-g -O3" or "-g -O2" flags and then run under 
Kdebug. This fails with an error message from Kdebug that gdb failed to load 
the program. Thus, I am totally unable to debug the program and find the 
exact problem with the optimization.

Thus, there appears to be a fatal error in the "O2" and "O3" levels of 
optimization in gcc and a definite error in the debug output when the O2 or 
O3 optimization level is specified.

compiler output below:
gcc -O3 -save-temps -std=c99 -Wunused-variable   -c -o pipes.o pipes.c
gcc -O3 -save-temps -std=c99 -Wunused-variable   -c -o awkpact.o awkpact.c
gcc -O3 -save-temps -std=c99 -Wunused-variable   -c -o awkpcmp.o awkpcmp.c
gcc -O3 -save-temps -std=c99 -Wunused-variable   -c -o awkpdo.o awkpdo.c
gcc -O3 -save-temps -std=c99 -Wunused-variable   -c -o awkpfun.o awkpfun.c
gcc -O3 -save-temps -std=c99 -Wunused-variable   -c -o awkplus.o awkplus.c
gcc -O3 -save-temps -std=c99 -Wunused-variable   -c -o awkpmsc.o awkpmsc.c
gcc -O3 -save-temps -std=c99 -Wunused-variable   -c -o awkprd.o awkprd.c
gcc -O3 -save-temps -std=c99 -Wunused-variable   -c -o awkpwrt.o awkpwrt.c
gcc -O3 -save-temps -std=c99 -Wunused-variable   -c -o date.o date.c
gcc -O3 -save-temps -std=c99 -Wunused-variable   -c -o filefuncs.o filefuncs.c
linking
gcc -o qtawk  -lm pipes.o qtawkcpy.o awkpact.o awkpcmp.o awkpdo.o awkpfun.o
awkplus.o awkpmsc.o awkprd.o awkpwrt.o date.o filefuncs.o getopt.o
compile_routines_short.o scan_routines.o 

I have the "*.i" files as a tarred and bzip2 compressed file - need to know
where to send the file.

-- 
           Summary: O2 and O3 memory access error - compiled program -
                    incorrect debug output
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fastsnip-gcc at yahoo dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2008-01-26 11:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-21322-10543@http.gcc.gnu.org/bugzilla/>
2007-09-23 12:40 ` [Bug other/21322] O2 and O3 memory access error - compiled program - incorrect debug output rguenth at gcc dot gnu dot org
2008-01-26 11:59 ` rguenth at gcc dot gnu dot org
2005-05-01 19:11 [Bug c/21322] New: " fastsnip-gcc at yahoo dot com
2005-05-03 20:17 ` [Bug other/21322] " jsm28 at gcc dot gnu dot org
2005-07-06 14:29 ` pinskia 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).