This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/21322] O2 and O3 memory access error - compiled program - incorrect debug output


------- Additional Comments From fastsnip-bcard1 at yahoo dot com  2005-05-01 20:03 -------
Subject: Re:  O2 and O3 memory access error - compiled program - incorrect debug output

On Sunday 01 May 2005 15:19, you wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-01
> 19:19 ------- Also can you look to see you have any warnings with -W -Wall?

I have examined the output from the "-W -Wall" options.

There are five kinds:

1. A structure was defined as:
typedef struct s_tns {
    unsigned        token;
    unsigned char   trns_char;
    unsigned        trns_strg;
    unsigned char **open_tag;
    unsigned char **close_tag;
    unsigned char **pclose_tag;
    union {
        state_rep_ptr trns_state;
        unsigned      trns_num;
    } trans_state;
    state_trns_ptr  nxt_trns;
} state_trns;

In initializing the variables of this type, I did not put braces around the 
seventh component, the union. The compiler complained about this. This was in 
a header file that was generated automatically by another program I have 
written. I will change the generating program to put braces around the union 
component. I doubt that this could be the problem though.

2. The compiler complained about "suggest parentheses around assignment used 
as truth value". This should not present a problem.

3. The compiler warned about unused function parameters - the function 
parameters were passed to another function within the function and not used 
explicitly within the function where the compiler complained.

4. "static" function defined but never used. I have removed the function - but 
I seriously doubt that an unused function could cause a memory access error, 
or at least it shouldn't since the function code should never be executed.

5. warnings about variables possibly being unintialized before being used: 
"'trule' may be used uninitialized in this function". I have reviewed the 
functions where this is complained about and the code branches to an error 
reporting function before the variable is used. The error reporting function 
executes an "exit" with an error number so there is no return from the error 
reporting function. The code where the variable could be used before being 
initialized is after this branch and the variable is explicitly initialized 
before being used. Also, in another function where this warning is issued, is 
inside a "for" loop. The variable is explicitly initialized within the for 
loop and the loop logic excludes the use before initialization.

That is about it. I see nothing that could lead to a memory access error.

Thanks for investigating this.

Terry



> The warnings about unsigned vs signed were there before just enabled with
> -pedantic.
>
> Also does -fno-strict-aliasing help if so this might not be a bug in GCC
> but your code.

-- 
++++++++++++++++++++++++++++++++++++++++++++++++++++++
======================================================
******************************************************
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
******************************************************
******************************************************



-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]