public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: module level flags
@ 2002-10-02  0:53 Robert Dewar
  0 siblings, 0 replies; 50+ messages in thread
From: Robert Dewar @ 2002-10-02  0:53 UTC (permalink / raw)
  To: Joe.Buck, dewar; +Cc: Joe.Buck, aoliva, bkorb, gcc, zack

Joe sent a message addressed to me in which it looked as if I said

> <<It's not a matter of not wanting to learn the rules.  It's a matter
> of dealing with massive amounts of legacy code written before the
> aliasing optimizations were devised.  This is a change in the C
> language that is only a very few years old.  Silently biting people
> isn't the way to do it.
> >>

I trust everyone reaslizes that this is not the case, I was quoting from
the one person in this thread who has this viewpoint :-) :-)

^ permalink raw reply	[flat|nested] 50+ messages in thread
* Re: module level flags
@ 2002-10-01 13:58 Robert Dewar
  2002-10-01 14:54 ` Joe Buck
  2002-10-05 11:36 ` Toon Moene
  0 siblings, 2 replies; 50+ messages in thread
From: Robert Dewar @ 2002-10-01 13:58 UTC (permalink / raw)
  To: Joe.Buck, bkorb; +Cc: aoliva, dewar, gcc, zack

<<It's not a matter of not wanting to learn the rules.  It's a matter
of dealing with massive amounts of legacy code written before the
aliasing optimizations were devised.  This is a change in the C
language that is only a very few years old.  Silently biting people
isn't the way to do it.
>>

Neither is deoptimizing the code in a manner that results in 
not taking advantage of this feature of the standard.

-fno-strict-aliasing is precicsely meant to deal with ":massive
amounts of legacy code written before the aliasing o[ptimziations were devised".
Why should you be reluctant to use it.

Mind you, the code we are talking about here is not "massive amounts of legacy
code written before ...", but jsut one program with an obvious bug
that is easily fixed!

^ permalink raw reply	[flat|nested] 50+ messages in thread
* Re: module level flags
@ 2002-09-29 14:03 Robert Dewar
  0 siblings, 0 replies; 50+ messages in thread
From: Robert Dewar @ 2002-09-29 14:03 UTC (permalink / raw)
  To: bkorb, zack; +Cc: dewar, gcc

I completely agree with Zack when he says

>  This is my last word on the subject - I don't have time for the
>  argument.  However, your repeated assertion that "the intended use" of
>  YYSTYPE is in a manner incompatible with the C standard is
>  indefensible.  You've *chosen* to define YYSTYPE as "int" in a parser
>  that actually wants to store one of several different pointer types in
>  that data type.  You should never have expected this to work.  The
>  Bison manual could perhaps be worded more strongly, but it is clear
>  enough that one must use %union and %type in a parser of this form.
>  (These directives are supported by all modern versions of Yacc, so
>  portability is not an excuse here.)

my comment that there was an error in the YACC approach was entirely
incorrect, sorry about that confusion!

^ permalink raw reply	[flat|nested] 50+ messages in thread
* Re: module level flags
@ 2002-09-29 13:42 Robert Dewar
  2002-09-29 14:52 ` Russ Allbery
  0 siblings, 1 reply; 50+ messages in thread
From: Robert Dewar @ 2002-09-29 13:42 UTC (permalink / raw)
  To: bkorb, dewar; +Cc: drow, gcc, gdr, zack

By the way it certainly seems that YACC is incorrect here in its approach,
and at the very least should discuss the implications
of its choice for YYSTYPE.

^ permalink raw reply	[flat|nested] 50+ messages in thread
* Re: module level flags
@ 2002-09-29 13:38 Robert Dewar
  0 siblings, 0 replies; 50+ messages in thread
From: Robert Dewar @ 2002-09-29 13:38 UTC (permalink / raw)
  To: bkorb, dewar; +Cc: drow, gcc, gdr, zack

<<On which platform?  The answer is:  it depends.
On my particular platform, the compliler "t_word".
It has previously seen, "typedef int t_word;".
On my Solaris 2.8 box, it would be a 64 bit sized bucket.
>>

Right, and clearly for this definition yoru code was incorrect from the
standard. If you don't like this semantics,clearly document that you are not writing
in C, and turn off strict aliasing.

^ permalink raw reply	[flat|nested] 50+ messages in thread
* Re: module level flags
@ 2002-09-29 13:36 Robert Dewar
  2002-09-29 13:38 ` Bruce Korb
  0 siblings, 1 reply; 50+ messages in thread
From: Robert Dewar @ 2002-09-29 13:36 UTC (permalink / raw)
  To: bkorb, drow; +Cc: dewar, gcc, gdr, zack

<<YYSTYPE is a bucket designed by YACC (Bison) to carry
either a pointer (of any sort) or a scalar.
>>

Well that sure evaded the question!
What is the type definition of YYSTYPE?

^ permalink raw reply	[flat|nested] 50+ messages in thread
* Re: module level flags
@ 2002-09-29 10:45 Robert Dewar
  0 siblings, 0 replies; 50+ messages in thread
From: Robert Dewar @ 2002-09-29 10:45 UTC (permalink / raw)
  To: bkorb, gdr; +Cc: dewar, gcc, zack

<<By golly, YYSTYPE darn well better be compatible with
arbitrary pointers or there are real problems.
>>

I don't see how you conclude that it is compatible from the rules in
the standard. Please enlighten. If you are just saying that you think
it should be compatible regardless of the standard rules, then that's a comment
on the language not on GCC. But I must say I don't in this case clearly 
understand your proposed modification to the rules in the standard (have
you looked at them?)

^ permalink raw reply	[flat|nested] 50+ messages in thread
* Re: module level flags
@ 2002-09-29 10:31 Robert Dewar
  0 siblings, 0 replies; 50+ messages in thread
From: Robert Dewar @ 2002-09-29 10:31 UTC (permalink / raw)
  To: bkorb, dewar; +Cc: gcc, zack

<<where 'stumble' is not of type 'mumble' must be deemed a
hard error.  If it is both not a hard error and the compiler
is reserving the "right" (??) to render the resulting pointer
ineffective, then GCC is reserving the right to destroy
the workings of a program.  This is wrong.  I don't care
if the standard says otherwise.
>>


Surely if you take this attitude you should just turn off aliasing analysis.
Really we expect gcc to implement C by default, not C + "fixes" to the
standard that Bruce Korb thinks are obviously correct.

GCC is not "reserving the right to destroy the workings of a program", 
since this program simply does not meet the semantics of C. Just because
you expect some program whose semantics is not defined by the standard
to do something, does not mean that a C compiler wlil agree with your
analysis. 

There are lots of respects in which people write non-standard C and expect 
it to work. This particular case seems to me to be one that should never
have been expected to work (i.e. I don't see any formal definition of C
that guarantees this program will work -- if I am wrong on this, please point out the document,
but do not expect me to be impressed by what some individual *thinks* the 
language should be. That's not decisive :-)

Robert Dewar

^ permalink raw reply	[flat|nested] 50+ messages in thread
* Re: module level flags
@ 2002-09-29  6:40 Robert Dewar
  2002-09-29 10:05 ` Bruce Korb
  0 siblings, 1 reply; 50+ messages in thread
From: Robert Dewar @ 2002-09-29  6:40 UTC (permalink / raw)
  To: bkorb, zack; +Cc: gcc

<<Any other interpretation is too confusing to be able to remember.
In other words, wrong.
>>

Can you justify this position from the standard?

^ permalink raw reply	[flat|nested] 50+ messages in thread
* module level flags
@ 2002-09-28 16:41 Bruce Korb
  2002-09-28 16:52 ` Tim Prince
  0 siblings, 1 reply; 50+ messages in thread
From: Bruce Korb @ 2002-09-28 16:41 UTC (permalink / raw)
  To: gcc, Automake Development


As best as I can determine, there is no easy way to say, "do
not optimize this particular module".  The best way would be
with a #pragma around the problematical function, but I'll
be happy with anything that does not disable optimization for
the entire program and does not prevent someone from overriding
CFLAGS for that module, either.  Suggestions?  Thanks!

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

end of thread, other threads:[~2002-10-06 13:09 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <orn0py67ug.fsf@free.redhat.lsd.ic.unicamp.br>
2002-10-01 11:33 ` module level flags Joe Buck
2002-10-01 12:16   ` Geoff Keating
2002-10-05 21:03     ` Kai Henningsen
2002-10-06  6:36       ` Gabriel Dos Reis
2002-10-06  8:25         ` Nathan Sidwell
2002-10-06  8:29           ` Gabriel Dos Reis
2002-10-01 12:29   ` Bruce Korb
2002-10-01 14:14     ` Alexandre Oliva
2002-10-01 14:25   ` Alexandre Oliva
2002-10-03 16:46     ` Joe Buck
2002-10-03 17:34       ` Zack Weinberg
2002-10-03 18:07         ` Richard Henderson
2002-10-02  0:53 Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
2002-10-01 13:58 Robert Dewar
2002-10-01 14:54 ` Joe Buck
2002-10-01 15:40   ` Michael Matz
2002-10-05 11:36 ` Toon Moene
2002-09-29 14:03 Robert Dewar
2002-09-29 13:42 Robert Dewar
2002-09-29 14:52 ` Russ Allbery
2002-09-29 13:38 Robert Dewar
2002-09-29 13:36 Robert Dewar
2002-09-29 13:38 ` Bruce Korb
2002-09-29 14:05   ` Russ Allbery
2002-09-29 10:45 Robert Dewar
2002-09-29 10:31 Robert Dewar
2002-09-29  6:40 Robert Dewar
2002-09-29 10:05 ` Bruce Korb
2002-09-29 10:17   ` Gabriel Dos Reis
2002-09-29 10:45     ` Bruce Korb
2002-09-29 11:36       ` Gabriel Dos Reis
2002-09-29 13:06       ` Daniel Jacobowitz
2002-09-29 13:08         ` Bruce Korb
2002-09-29 13:21           ` Daniel Jacobowitz
2002-09-29 10:49   ` Russ Allbery
2002-09-30 21:33   ` Alexandre Oliva
2002-09-30 21:42     ` Bruce Korb
2002-09-28 16:41 Bruce Korb
2002-09-28 16:52 ` Tim Prince
2002-09-28 16:53   ` Bruce Korb
2002-09-28 18:06     ` Zack Weinberg
2002-09-28 18:20       ` Bruce Korb
2002-09-28 20:56         ` Zack Weinberg
2002-09-28 22:08           ` Bruce Korb
2002-09-29 15:46             ` Geoff Keating
2002-09-29  3:20       ` Robert Dewar
2002-09-29 11:55         ` Zack Weinberg
2002-09-29 13:10           ` Bruce Korb
2002-09-29 13:59             ` Zack Weinberg
2002-09-29 17:21     ` Tom Tromey

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