public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* possible compiler bug
@ 2005-05-01 18:16 Friends
  2005-05-01 18:33 ` Diego Novillo
  0 siblings, 1 reply; 3+ messages in thread
From: Friends @ 2005-05-01 18:16 UTC (permalink / raw)
  To: gcc

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.

Are these known errors?

is the problem with the debug output known? Are there plans to fix this 
problem?

If at all possible, please respond so that I know that you either can do 
nothing without further information or that you believe you know of these 
bugs or how to get the necessary information to you to solve these problems. 
The web page states that you want the compiler command and any compiler 
output. Unfortunately, there is no compiler output, the program itself simply 
fails with a memory access error with optimization levels of "O2" or "O3" 
under gcc 4.0.0 whereas the program functioned normally with these 
optimization levels under gcc 2.9 series and 3.4 series (3.4.3 being the last 
I used).

One last piece of information: I downloaded the gcc 4.0.0 source and compiled 
using gcc 3.4.3 - could that be a problem???? Also, I am running Linux kernal 
2.24.20

Pending a solution I will have to drop back to gcc 3.4.3 (hopefully that is 
still an option for me).

Thanks,
Terry D. Boldt

-- 
++++++++++++++++++++++++++++++++++++++++++++++++++++++
======================================================
******************************************************
If you are always rushing towards the future,
Then you never have any past.

Terry Boldt
******************************************************
As you contemplate the Now,
The Now becomes the past.

There is no future,
There is no past,
There is only Now.
    Unknown
******************************************************

"A human being is part of the whole called by us the 
Universe. We experience ourselves, our thoughts and 
feelings as something separated from the rest --a kind 
of optical delusion of consciousness.
This delusion is a kind of prison for us, restricting 
us to our personal desires and to affection for a few 
persons nearest us. Our task must be to free ourselves 
from this prison by widening our circle of compassion 
to embrace all living creatures, and the whole of 
nature in its beauty."

Albert Einstein.
                  
"We can't solve problems by using the same kind of 
thinking we used when we created them." 
--Albert Einstein

******************************************************

We have the best government money can buy, and it has.

Terry Boldt.     

******************************************************

You must decide: 

Are you a body with a soul or a soul with a body?

Terry Boldt

******************************************************

When you change the way you look at things, 
the things you look at change.

******************************************************
Paraphrasing Ben Franklin:

Those who sacrifice freedom for safety, have neither.

The exact quote:               

They that can give up essential liberty to obtain a little
temporary safety deserve neither liberty nor safety.
  Benjamin Franklin (1706 - 1790),
  US author, diplomat, inventor, physicist, politician, & printer
  Historical Review of Pennsylvania, 1759

******************************************************
A thought often repeated becomes an act, an act often
repeated becomes a habit, a habit often repeated,
a character and a settled character molds the very
destiny of man.

Man is the master of his own destiny.

"The Voice of Babaji", Page 236
******************************************************
What man thinks, that he becomes

Upanishad
******************************************************
Common sense is so very extraordinary 
for being for so very uncommon.

Terry Boldt
******************************************************
To say what is real,
Must be exactly what we feel,
To speak of the truth,
And be open this way,
Is to say what you mean,
And mean what you say.

Pearl Boldt
******************************************************
"If you don't know, you cannot teach, except by faith.
And faith implies doubt. Doubt and the resulting
repression of doubt breed fanaticism and intolerance.
Worse, they breed ignorance pretending to infallibility,
which breeds charlatans and blind followers."

"Muddy Tracks", Frank DeMarco, page xxv
******************************************************
"for without time,no thought of anything is possible;
without space, no conception of anything is possible and
without causation no consideration of anything is possible. And
again, time space and causation generally appear inter-related
in our consciousness not dependent of one another.
So the mind lives, moves and has its existence in these
three notions, which are necessarily finite, owing to
their perceptional value and without which we cannot think,
conceive or imagine anything. Deprived of these three,
the constitution of the mind breaks down."

"The Voice of Babaji", Page 442-443
******************************************************
"The definition of and the mystery and meaning of faith,
will open like a flower, only while sitting in silence.
Faith in something greater than oneself is tantamount to
a veil being withdrawn from the depths and distances
glimmering within, and a feeling of eternal hunger for
peace and fullness, for all that the distracted world
of today denies. It is not possible to discover the Real
and abide in it, except by our own experience."

"The Voice of Babaji", Page 444
******************************************************
******************************************************

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

* Re: possible compiler bug
  2005-05-01 18:16 possible compiler bug Friends
@ 2005-05-01 18:33 ` Diego Novillo
  2005-05-01 20:35   ` Robert Dewar
  0 siblings, 1 reply; 3+ messages in thread
From: Diego Novillo @ 2005-05-01 18:33 UTC (permalink / raw)
  To: Friends; +Cc: gcc

On Sun, May 01, 2005 at 02:16:27PM -0400, Friends wrote:

> Only when I compile with an optimization level of "O2" or "O3" does the 
> program exit with a memory access error.
> 
It may be a bug in GCC and it may also be a bug in your program
(some problems like aliasing bugs only are exposed at higher
levels of optimization).

Without more detailed information it is impossible for us to
diagnose your problem.  Please report a bug following the
instructions in http://gcc.gnu.org/bugs.html.

> The web page states that you want the compiler command and any compiler 
> output. Unfortunately, there is no compiler output, the program itself simply 
>
The best way is to compile your code with -save-temps and give
us the .i file so that we can examine it.  The bug reporting page
has detailed info of what we need to help you with this problem.


Diego.

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

* Re: possible compiler bug
  2005-05-01 18:33 ` Diego Novillo
@ 2005-05-01 20:35   ` Robert Dewar
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Dewar @ 2005-05-01 20:35 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Friends, gcc

Diego Novillo wrote:
> On Sun, May 01, 2005 at 02:16:27PM -0400, Friends wrote:
> 
> 
>>Only when I compile with an optimization level of "O2" or "O3" does the 
>>program exit with a memory access error.
>>
> 
> It may be a bug in GCC and it may also be a bug in your program
> (some problems like aliasing bugs only are exposed at higher
> levels of optimization).

Also uninitialized variable problems often show up only with
optimization turned on (registers tend to be "more" uninitialized
than memory :-)

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

end of thread, other threads:[~2005-05-01 20:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-01 18:16 possible compiler bug Friends
2005-05-01 18:33 ` Diego Novillo
2005-05-01 20:35   ` Robert Dewar

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