public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: A prototype patch for tree.h/tree.def/calls.c
@ 1997-08-19 21:22 Ian Haggard
  1997-08-19 22:15 ` PA port & haifa Jeffrey A Law
  0 siblings, 1 reply; 15+ messages in thread
From: Ian Haggard @ 1997-08-19 21:22 UTC (permalink / raw)
  To: egcs

Jeffrey A Law wrote:
> 
>   In message <m0x0tpx-0004ecC@ocean.lucon.org>you write:
>   > > But regardless of what other parts of gcc are doing, using "unsigned"
>   > > in the prototype for xmalloc is wrong and such a change will not be
>   > > installed.
>   >
>   > It makes nosenses when the definion of xmalloc uses unsigned
>   > and its prototype uses size_t. It is much worse.
> Providing a prototype that is blatently wrong will not be accepted.
> There's no use argueing about this, an incorrect patch will not
> be accepted.

Actually, you are both sort-of right on this.  In some programs, the
definition of xmalloc takes a signed or unsigned int, and in some it
takes a size_t.  The mips-tfile.c is the worst offender:

Its definition of xmalloc starts like:

> 
> PTR_T
> xmalloc (size)
>      Size_t size;
> {

Earlier in mips-tfile.c, "Size_t" is defined as:

> #if defined(__OSF1__) || defined(__OSF__) || defined(__osf__)
> #define Size_t          long unsigned int
> #else
> #define Size_t          unsigned int
> #endif

Both cccp.c and protoize.c contain definitions of xmalloc with a size_t
argument.  And just for completeness, bi-arity.c, bi-lexer.c,
bi-opcode.c, and bi-opname.c also have the trivial inconsistency that
they contain definitions of xmalloc that expect an int, not an unsigned
int.  All other definitions of xmalloc do, however, take unsigned int.
-- 
Ian Haggard  ||  ian@shellus.com (work)  ||  IanHaggard@juno.com (home)
GNU/Linux -- "Oh, no, Mr Bill!" || #define employer_opinion !my_opinion

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

* PA port & haifa
  1997-08-19 21:22 A prototype patch for tree.h/tree.def/calls.c Ian Haggard
@ 1997-08-19 22:15 ` Jeffrey A Law
  0 siblings, 0 replies; 15+ messages in thread
From: Jeffrey A Law @ 1997-08-19 22:15 UTC (permalink / raw)
  To: egcs

In the next snapshot, the PA port will default to using the
haifa scheduler.

After some tuning of the PA backend, haifa is showing a noticable
improvement in FP intensive code.  While there are still some
cases where the generated code is slower, the majority of the
time the code is significantly faster.  For specfp92 I'm seeing
an overall improvement of about 6.5%.

I encourage others to test with haifa and tune the scheduling
parameters to get good performance from haifa.

As haifa improves in both code reliability and speed, we can
make it the default for additional cpus -- with the goal of
having the haifa scheduler replace the old scheduler.


Jeff

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

* Re: A prototype patch for tree.h/tree.def/calls.c
  1997-08-19 19:24 Ugly *.def in gcc H.J. Lu
@ 1997-08-19 19:45 ` Jeffrey A Law
  0 siblings, 0 replies; 15+ messages in thread
From: Jeffrey A Law @ 1997-08-19 19:45 UTC (permalink / raw)
  To: egcs

  In message <m0x0tpx-0004ecC@ocean.lucon.org>you write:
  > > But regardless of what other parts of gcc are doing, using "unsigned"
  > > in the prototype for xmalloc is wrong and such a change will not be
  > > installed.
  > 
  > It makes nosenses when the definion of xmalloc uses unsigned
  > and its prototype uses size_t. It is much worse.
Providing a prototype that is blatently wrong will not be accepted.
There's no use argueing about this, an incorrect patch will not
be accepted.

  > What is the working alternative? Will it ever be
  > implemented. How much will it take to do it? You
  > don't have to love something to use it.
The alternative is to get the other stuff installed first, then
analyze the situation later as a group.  Your patches for
enum rtx code and enum tree_code will not be accepted without
a review at a later date.

I want this to be a separate issue from the main body of
prototyping patches.  Please table this issue until we get
the main body of the prototype patches installed -- continueing
to discuss it only distracts from other stuff that needs to
be addressed at the current time.


  > egcs. Besides, there are many prototypes in gcc like it.
  > I just happen to like that style when I was working on it.
Sorry to hear that.

  > I don't
  > feel like to spend my time on it. I don't see why my patch
  > should be rejected just because of it.
And I don't have the time or desire to reformat your patches.

If you feel prototyping is important and you want to get it
in soon, then you'll have to do some formatting work.

Jeff

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

* Re: A prototype patch for tree.h/tree.def/calls.c
@ 1997-08-19 19:12 H.J. Lu
  0 siblings, 0 replies; 15+ messages in thread
From: H.J. Lu @ 1997-08-19 19:12 UTC (permalink / raw)
  To: egcs

> But regardless of what other parts of gcc are doing, using "unsigned"
> in the prototype for xmalloc is wrong and such a change will not be
> installed.

It makes nosenses when the definion of xmalloc uses unsigned
and its prototype uses size_t. It is much worse.

> 
> Please punt xmalloc and friends.  It can be revisited later.
> 
> The point here is to make progress.  That means punting issues
> which are tricky so that we can get the bulk of your changes
> installed.

My xmalloc prototype matches most of xmalloc definions in gcc and
is disabled. What is wrong with that?

> 
> 
>   > >   * Don't mess with the enum rtx_code and enum tree_code stuff
>   > >     right now.
>   > 
>   > Why, my change is small and working. It is very trivial
>   > to back it out. When will the greatest one be found anyway?
> I (and others) think that part of the patch is gross and disgusting.
> It will not be installed.
> 

What is the working alternative? Will it ever be
implemented. How much will it take to do it? You
don't have to love something to use it.

>   > 
>   > >   * Do some minor formatting.
>   > 
>   > I am talking about over 5,000 lines of code. I don't feel like
>   > to reformat it for something that no compilers even care. I think
>   > protoptype is for compilers, not for human. But, again, feel free
>   > to reformat it.
> Then your code will have to wait.  Maybe you should have been in
> contact with others before you wrote 5000 lines of code.

I started it weeks ago. I didn't even know there would be
egcs. Besides, there are many prototypes in gcc like it.
I just happen to like that style when I was working on it.
I thought it was an acceptabe style. In any case, they can
be easily reformatted it when the script is availabe. I don't
feel like to spend my time on it. I don't see why my patch
should be rejected just because of it.


H.J.

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

* Re: A prototype patch for tree.h/tree.def/calls.c
  1997-08-19 19:00 Some Haifa scheduler bugs Jeffrey A Law
  1997-08-19 19:00 ` A prototype patch for tree.h/tree.def/calls.c Jeffrey A Law
@ 1997-08-19 19:00 ` H.J. Lu
  1 sibling, 0 replies; 15+ messages in thread
From: H.J. Lu @ 1997-08-19 19:00 UTC (permalink / raw)
  To: egcs

> 
> 
> > #define NEED_enum_rtx_code    
> > #include "rtl.def"                
> > #undef NEED_enum_rtx_code                                        
> > #define NEED_enum_machine_mode                                     
> > #include "machmode.def"               
> > #undef NEED_enum_machine_mode                       
> > 
> > .....
> > extern int ix86_expand_binary_operator 
> >         PROTO ((enum rtx_code, enum machine_mode, struct rtx_def *[]));
> > .....
> 
> This looks ugly.  I agree with Kenner's comments a while back about
> changes to the #include conventions in gcc.  Target .h files shouldn't
> need to include any gcc files.  We should minimize nested includes
> within gcc.

It does look ugly. But it works.

> 
> There are a few ways to solve the problem of the target .h file
> needing more definitions.
> 
> We could make the rtl and tree definitions visible in every gcc file
> (like the machine modes are now).  Then tm.h would have all types
> available.
> 
> We could require tm.h to test whether it is being used in a front-end
> or back-end context and not use any names not defined in that context.
> 
> Either of these requires rtl.h (less the very few target-dependent
> macros) or tree.h to be included _before_ tm.h.  The changes are
> simple but almost every file in gcc (including machine descriptions)
> would need to change.  If we plan to do a front/middle/back-end
> interface cleanup it would be best to defer the changes until then and
> make them all at once.

I have spent the time to make a patch. Why should we wait for something
which noone knows when it will be ever done? Besides my patch is small
enough that it is easy to take out.

> 
> Another option is to declare function arguments as integers instead of
> enumerated types in tm.{c,h}.
> 

I don't know if it is a good idea since those *.def are included
multiple time to have a correct match.


-- 
H.J. Lu (hjl@gnu.ai.mit.edu)

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

* Re: A prototype patch for tree.h/tree.def/calls.c
@ 1997-08-19 19:00 H.J. Lu
  1997-08-19 19:00 ` Jeffrey A Law
  0 siblings, 1 reply; 15+ messages in thread
From: H.J. Lu @ 1997-08-19 19:00 UTC (permalink / raw)
  To: egcs

> 
>   In message <m0x0r16-0004edC@ocean.lucon.org>you write:
>   > > 
>   > >   In message <m0x0opG-0004edC@ocean.lucon.org>you write:
>   > >   > I have some problem s with my emails for the past few days. I may
>   > >   > have lost some. I only remember your comments on BUFSIZ being a macro
>   > ,
>   > >   > which turned out ok. What else?
>   > > Relatively minor stuff.
>   > > 
>   > > For this pass #if 0 the prototypes for xmalloc and related funtions;
>   > > once the bulk of the prototypes are in, please submit a separate
>   > > patch to enable prototyping of xmalloc and related functions.
>   > 
>   > On my machine, they are enabled.
> Please disable them for the patch.

It is disabled in all my patches. Please double check it.

> 
>   > That is exactly the problem with size_t. How can you be
>   > sure size_t is available on all systems when xmalloc ()
>   > is used? many xmalloc () in gcc use unsigned. I think
>   > it makes some senses.
> NO!  You simply can't change from size_t to unsigned, that's
> just plain wrong.

Please check all xmalloc definitions in egcs. Many of
them use unsigned.

> 
> Seems to me the right way to do this is with autoconf.
> 

I don't know any scheme which will work on all systems.

> 
>   > I have spent weeks on it. I am afraid I may make some
>   > stupid mistakes if I try to reformat it. After all,
>   > those prototypes are mainly for compiler. Please feel
>   > free to reformat it. Thanks.
> Then they're not likely to go in anytime soon.  I don't have the
> time to spend reformatting all your changes.
> 
>   > Here is what I have in my i386.h:
>   > 
>   > #define NEED_enum_rtx_code    
>   > #include "rtl.def"                
>   > #undef NEED_enum_rtx_code                                        
>   > #define NEED_enum_machine_mode                                     
>   > #include "machmode.def"               
>   > #undef NEED_enum_machine_mode                       
> I had a feeling you'd done something like this -- let's punt this
> for now until we can come up with something better.
> 

I have tried many different ways. That is the smallest, working
scheme. Does anyone have a better one which doesn't involve
massive changes?

> 
> So, it seems to me you need to do 3 things:
> 
>   * #if0 the xmalloc and friends prototypes.

It is not an issue to begin with.

>   * Don't mess with the enum rtx_code and enum tree_code stuff
>     right now.

Why, my change is small and working. It is very trivial
to back it out. When will the greatest one be found anyway?

>   * Do some minor formatting.

I am talking about over 5,000 lines of code. I don't feel like
to reformat it for something that no compilers even care. I think
protoptype is for compilers, not for human. But, again, feel free
to reformat it.

> 
> We're not talking about a lot of work that you'd need to do to
> get your patches installed immediately.
> 


-- 
H.J. Lu (hjl@gnu.ai.mit.edu)

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

* Re: A prototype patch for tree.h/tree.def/calls.c
  1997-08-19 19:00 Some Haifa scheduler bugs Jeffrey A Law
@ 1997-08-19 19:00 ` Jeffrey A Law
  1997-08-19 19:00 ` H.J. Lu
  1 sibling, 0 replies; 15+ messages in thread
From: Jeffrey A Law @ 1997-08-19 19:00 UTC (permalink / raw)
  To: egcs

  In message <m0x0r16-0004edC@ocean.lucon.org>you write:
  > > 
  > >   In message <m0x0opG-0004edC@ocean.lucon.org>you write:
  > >   > I have some problem s with my emails for the past few days. I may
  > >   > have lost some. I only remember your comments on BUFSIZ being a macro
  > ,
  > >   > which turned out ok. What else?
  > > Relatively minor stuff.
  > > 
  > > For this pass #if 0 the prototypes for xmalloc and related funtions;
  > > once the bulk of the prototypes are in, please submit a separate
  > > patch to enable prototyping of xmalloc and related functions.
  > 
  > On my machine, they are enabled.
Please disable them for the patch.

  > That is exactly the problem with size_t. How can you be
  > sure size_t is available on all systems when xmalloc ()
  > is used? many xmalloc () in gcc use unsigned. I think
  > it makes some senses.
NO!  You simply can't change from size_t to unsigned, that's
just plain wrong.

Seems to me the right way to do this is with autoconf.


  > I have spent weeks on it. I am afraid I may make some
  > stupid mistakes if I try to reformat it. After all,
  > those prototypes are mainly for compiler. Please feel
  > free to reformat it. Thanks.
Then they're not likely to go in anytime soon.  I don't have the
time to spend reformatting all your changes.

  > Here is what I have in my i386.h:
  > 
  > #define NEED_enum_rtx_code    
  > #include "rtl.def"                
  > #undef NEED_enum_rtx_code                                        
  > #define NEED_enum_machine_mode                                     
  > #include "machmode.def"               
  > #undef NEED_enum_machine_mode                       
I had a feeling you'd done something like this -- let's punt this
for now until we can come up with something better.


So, it seems to me you need to do 3 things:

  * #if0 the xmalloc and friends prototypes.
  * Don't mess with the enum rtx_code and enum tree_code stuff
    right now.
  * Do some minor formatting.

We're not talking about a lot of work that you'd need to do to
get your patches installed immediately.

Jeff

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

* Re: A prototype patch for tree.h/tree.def/calls.c
  1997-08-19 19:00 H.J. Lu
@ 1997-08-19 19:00 ` Jeffrey A Law
  0 siblings, 0 replies; 15+ messages in thread
From: Jeffrey A Law @ 1997-08-19 19:00 UTC (permalink / raw)
  To: egcs

  In message <m0x0tCN-0004edC@ocean.lucon.org>you write:
  > > Please disable them for the patch.
  > 
  > It is disabled in all my patches. Please double check it.
OK.  Thank you.

  > > NO!  You simply can't change from size_t to unsigned, that's
  > > just plain wrong.
  > 
  > Please check all xmalloc definitions in egcs. Many of
  > them use unsigned.
I'm not saying they don't.  They are wrong and should be fixed,
but we can fix them later, we don't have to fix them now.

But regardless of what other parts of gcc are doing, using "unsigned"
in the prototype for xmalloc is wrong and such a change will not be
installed.

Please punt xmalloc and friends.  It can be revisited later.

The point here is to make progress.  That means punting issues
which are tricky so that we can get the bulk of your changes
installed.


  > >   * Don't mess with the enum rtx_code and enum tree_code stuff
  > >     right now.
  > 
  > Why, my change is small and working. It is very trivial
  > to back it out. When will the greatest one be found anyway?
I (and others) think that part of the patch is gross and disgusting.
It will not be installed.

  > 
  > >   * Do some minor formatting.
  > 
  > I am talking about over 5,000 lines of code. I don't feel like
  > to reformat it for something that no compilers even care. I think
  > protoptype is for compilers, not for human. But, again, feel free
  > to reformat it.
Then your code will have to wait.  Maybe you should have been in
contact with others before you wrote 5000 lines of code.

Just because egcs is being more open doesn't mean we're just going
to take whatever patch you whip up and install it.  You still have
to write good patches.

If you refuse to write good patches, then your patches will get
installed when we can get around to fixing them -- and with the
amount of other stuff going on, including a release in two weeks
fixing your patches certainly isn't at the top of my todo list.

All I can do is point out the things that need to be fixed, then
hope you (or someone) will fix them and then we can install the
patch.


Jeff

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

* Re: A prototype patch for tree.h/tree.def/calls.c
@ 1997-08-19 17:54 H.J. Lu
  0 siblings, 0 replies; 15+ messages in thread
From: H.J. Lu @ 1997-08-19 17:54 UTC (permalink / raw)
  To: egcs

> 
>   In message <m0x0opG-0004edC@ocean.lucon.org>you write:
>   > I have some problem s with my emails for the past few days. I may
>   > have lost some. I only remember your comments on BUFSIZ being a macro,
>   > which turned out ok. What else?
> Relatively minor stuff.
> 
> For this pass #if 0 the prototypes for xmalloc and related funtions;
> once the bulk of the prototypes are in, please submit a separate
> patch to enable prototyping of xmalloc and related functions.

On my machine, they are enabled.

> 
> This should help deal with the varying prototypes and lack of
> proper casts throughout the gcc sources.
> 
> Also, the prototypes are wrong, you changed an argument from a
> "size_t" to "unsigned".  On some systems, they're different
> sizes!
> 

That is exactly the problem with size_t. How can you be
sure size_t is available on all systems when xmalloc ()
is used? many xmalloc () in gcc use unsigned. I think
it makes some senses.

> 
> 
> Other prototypes in rtl.h (and other locations) try to get the PROTOs
> to line up in a nice column.  Can you line them up?  It will certainly
> make them easier to read later.  Seems like a nit, but it really
> makes stuff easier to read.
> 

I have spent weeks on it. I am afraid I may make some
stupid mistakes if I try to reformat it. After all,
those prototypes are mainly for compiler. Please feel
free to reformat it. Thanks.

> 
>   > The reason of
>   > odd rtl.def patch is the prototyping config.h may require
>   > enum etx_code before rtl.h is included.
> I don't understand this.
> 
> If config.h requires enum rtx_code before rtl.h is included, how
> does this change help?
> 
> I would punt this issue for this round too.  We can return to it after
> we've got the bulk of the other prototype stuff installed.

Here is what I have in my i386.h:

#define NEED_enum_rtx_code    
#include "rtl.def"                
#undef NEED_enum_rtx_code                                        
#define NEED_enum_machine_mode                                     
#include "machmode.def"               
#undef NEED_enum_machine_mode                       

.....
extern int ix86_expand_binary_operator 
        PROTO ((enum rtx_code, enum machine_mode, struct rtx_def *[]));
.....

As I said, gcc was not designed with prototyping in mind.


H.J.

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

* Re: A prototype patch for tree.h/tree.def/calls.c
@ 1997-08-19 17:52 John Carr
  0 siblings, 0 replies; 15+ messages in thread
From: John Carr @ 1997-08-19 17:52 UTC (permalink / raw)
  To: egcs

> #define NEED_enum_rtx_code    
> #include "rtl.def"                
> #undef NEED_enum_rtx_code                                        
> #define NEED_enum_machine_mode                                     
> #include "machmode.def"               
> #undef NEED_enum_machine_mode                       
> 
> .....
> extern int ix86_expand_binary_operator 
>         PROTO ((enum rtx_code, enum machine_mode, struct rtx_def *[]));
> .....

This looks ugly.  I agree with Kenner's comments a while back about
changes to the #include conventions in gcc.  Target .h files shouldn't
need to include any gcc files.  We should minimize nested includes
within gcc.

There are a few ways to solve the problem of the target .h file
needing more definitions.

We could make the rtl and tree definitions visible in every gcc file
(like the machine modes are now).  Then tm.h would have all types
available.

We could require tm.h to test whether it is being used in a front-end
or back-end context and not use any names not defined in that context.

Either of these requires rtl.h (less the very few target-dependent
macros) or tree.h to be included _before_ tm.h.  The changes are
simple but almost every file in gcc (including machine descriptions)
would need to change.  If we plan to do a front/middle/back-end
interface cleanup it would be best to defer the changes until then and
make them all at once.

Another option is to declare function arguments as integers instead of
enumerated types in tm.{c,h}.

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

* Re: A prototype patch for tree.h/tree.def/calls.c
@ 1997-08-19 17:43 D.V. Henkel-Wallace
  0 siblings, 0 replies; 15+ messages in thread
From: D.V. Henkel-Wallace @ 1997-08-19 17:43 UTC (permalink / raw)
  To: egcs

In message <m0x0opG-0004edC@ocean.lucon.org>you write:
> I have some problem s with my emails for the past few days. I may
> have lost some. I only remember your comments on BUFSIZ being a macro,
> which turned out ok. What else?

All: crash has set up hypermail which means you can go to the web page and
look up these old messages as necessary.

Cheers,
g

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

* Re: A prototype patch for tree.h/tree.def/calls.c
  1997-08-19 16:06 egcs: A new compiler project to merge the existing GCC forks H.J. Lu
@ 1997-08-19 16:06 ` Jeffrey A Law
  0 siblings, 0 replies; 15+ messages in thread
From: Jeffrey A Law @ 1997-08-19 16:06 UTC (permalink / raw)
  To: egcs

  In message <m0x0opG-0004edC@ocean.lucon.org>you write:
  > I have some problem s with my emails for the past few days. I may
  > have lost some. I only remember your comments on BUFSIZ being a macro,
  > which turned out ok. What else?
Relatively minor stuff.

For this pass #if 0 the prototypes for xmalloc and related funtions;
once the bulk of the prototypes are in, please submit a separate
patch to enable prototyping of xmalloc and related functions.

This should help deal with the varying prototypes and lack of
proper casts throughout the gcc sources.

Also, the prototypes are wrong, you changed an argument from a
"size_t" to "unsigned".  On some systems, they're different
sizes!



Other prototypes in rtl.h (and other locations) try to get the PROTOs
to line up in a nice column.  Can you line them up?  It will certainly
make them easier to read later.  Seems like a nit, but it really
makes stuff easier to read.


  > The reason of
  > odd rtl.def patch is the prototyping config.h may require
  > enum etx_code before rtl.h is included.
I don't understand this.

If config.h requires enum rtx_code before rtl.h is included, how
does this change help?

I would punt this issue for this round too.  We can return to it after
we've got the bulk of the other prototype stuff installed.


jeff

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

* Re: A prototype patch for tree.h/tree.def/calls.c
@ 1997-08-19 13:19 H.J. Lu
  0 siblings, 0 replies; 15+ messages in thread
From: H.J. Lu @ 1997-08-19 13:19 UTC (permalink / raw)
  To: egcs

> 
>   In message <m0x0cfX-0004edC@ocean.lucon.org>you write:
>   > Hi,
>   > 
>   > Here is a patch for tree.h/tree.h/calls.c. I hope it will
>   > be installed soon. Otherwise, it will be very hard to submit
>   > clean patches. Thanks.
> See my comments from your last patch.  They apply to this patch
> too.  If you address those problems I'll install both patchkits.
> 

I have some problem s with my emails for the past few days. I may
have lost some. I only remember your comments on BUFSIZ being a macro,
which turned out ok. What else?

Thanks.


-- 
H.J. Lu (hjl@gnu.ai.mit.edu)

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

* Re: A prototype patch for tree.h/tree.def/calls.c
  1997-08-19  3:52 egcs: A new compiler project to merge the existing GCC forks (fwd) H.J. Lu
@ 1997-08-19  5:08 ` Jeffrey A Law
  0 siblings, 0 replies; 15+ messages in thread
From: Jeffrey A Law @ 1997-08-19  5:08 UTC (permalink / raw)
  To: egcs

  In message <m0x0cfX-0004edC@ocean.lucon.org>you write:
  > Hi,
  > 
  > Here is a patch for tree.h/tree.h/calls.c. I hope it will
  > be installed soon. Otherwise, it will be very hard to submit
  > clean patches. Thanks.
See my comments from your last patch.  They apply to this patch
too.  If you address those problems I'll install both patchkits.

Jeff

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

* A prototype patch for tree.h/tree.def/calls.c
@ 1997-08-18 23:56 H.J. Lu
  0 siblings, 0 replies; 15+ messages in thread
From: H.J. Lu @ 1997-08-18 23:56 UTC (permalink / raw)
  To: egcs

Hi,

Here is a patch for tree.h/tree.h/calls.c. I hope it will
be installed soon. Otherwise, it will be very hard to submit
clean patches. Thanks.


-- 
H.J. Lu (hjl@gnu.ai.mit.edu)
--
Mon Aug 18 17:30:26 1997  H.J. Lu  (hjl@gnu.ai.mit.edu)

	* tree.h (STDIO_PROTO): Changed to PROTO. Use "#ifdef BUFSIZ" to
	decide whether to provide prototype.
	(floor_log2, exact_log2): Cast arg to unsigned HOST_WIDE_INT.

	* tree.def, tree.h: Finish prototyping.

	* calls.c (expand_call): Pass 1 as the missing arg to
	any_pending_cleanups ().

Index: tree.h
===================================================================
RCS file: /home/work/cvs/gnu/egcs/tree.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 tree.h
--- tree.h	1997/08/16 03:48:43	1.1.1.1
+++ tree.h	1997/08/19 00:37:30
@@ -25,17 +25,9 @@
 #endif
 
 /* Codes of tree nodes */
-
-#define DEFTREECODE(SYM, STRING, TYPE, NARGS)   SYM,
-
-enum tree_code {
+#define NEED_enum_tree_code
 #include "tree.def"
-
-  LAST_AND_UNUSED_TREE_CODE	/* A convenient way to get a value for
-				   NUM_TREE_CODE.  */
-};
-
-#undef DEFTREECODE
+#undef NEED_enum_tree_code
 
 /* Number of tree codes.  */
 #define NUM_TREE_CODES ((int)LAST_AND_UNUSED_TREE_CODE)
@@ -1197,16 +1189,16 @@
    defined here and in rtl.h.  */
 
 #ifndef exact_log2
-#define exact_log2(N) exact_log2_wide ((HOST_WIDE_INT) (N))
-#define floor_log2(N) floor_log2_wide ((HOST_WIDE_INT) (N))
+#define exact_log2(N) exact_log2_wide ((unsigned HOST_WIDE_INT) (N))
+#define floor_log2(N) floor_log2_wide ((unsigned HOST_WIDE_INT) (N))
 #endif
+extern int exact_log2_wide		PROTO((unsigned HOST_WIDE_INT));
+extern int floor_log2_wide		PROTO((unsigned HOST_WIDE_INT));
 
 #if 0
-/* At present, don't prototype xrealloc, since all of the callers don't
-   cast their pointers to char *, and all of the xrealloc's don't use
-   void * yet.  */
-extern char *xmalloc			PROTO((size_t));
-extern char *xrealloc			PROTO((void *, size_t));
+extern GENERIC_PTR xmalloc		PROTO((unsigned));
+extern GENERIC_PTR xrealloc		PROTO((GENERIC_PTR, unsigned));
+extern GENERIC_PTR xcalloc		PROTO((unsigned, unsigned));
 #else
 extern char *xmalloc ();
 extern char *xrealloc ();
@@ -1302,7 +1294,7 @@
    put the prototype here.  Rtl.h does declare the prototype if
    tree.h had been included.  */
 
-extern tree make_tree ();
+extern tree make_tree PROTO((tree, struct rtx_def *));
 \f
 /* Return a type like TTYPE except that its TYPE_ATTRIBUTES
    is ATTRIBUTE.
@@ -1650,12 +1642,12 @@
      2: and any other information that might be interesting, such as function
         parameter types in C++.  */
 
-extern char *(*decl_printable_name) (/* tree decl, int verbosity */);
+extern char *(*decl_printable_name) PROTO((tree, int));
 
 /* Pointer to function to finish handling an incomplete decl at the
    end of compilation.  */
 
-extern void (*incomplete_decl_finalize_hook) ();
+extern void (*incomplete_decl_finalize_hook) PROTO((tree));
 \f
 /* In tree.c */
 extern char *perm_calloc			PROTO((int, long));
@@ -1826,3 +1818,214 @@
 
 /* Pop the obstack selection stack.  */
 extern void pop_obstacks PROTO((void));
+
+/* In tree.c */
+extern int really_constant_p PROTO((tree));
+extern void push_obstacks PROTO((struct obstack *, struct obstack *));
+extern void pop_momentary_nofree PROTO((void));
+extern void preserve_momentary PROTO((void));
+extern void saveable_allocation PROTO((void));
+extern void temporary_allocation PROTO((void));
+extern void resume_temporary_allocation PROTO((void));
+extern tree get_file_function_name PROTO((int));
+extern void set_identifier_size PROTO((int));
+extern int int_fits_type_p PROTO((tree, tree));
+extern int tree_log2 PROTO((tree));
+extern void preserve_initializer PROTO((void));
+extern void preserve_data PROTO((void));
+extern int object_permanent_p PROTO((tree));
+extern int type_precision PROTO((tree));
+extern int simple_cst_equal PROTO((tree, tree));
+extern int type_list_equal PROTO((tree, tree));
+extern int chain_member PROTO((tree, tree));
+extern int chain_member_purpose PROTO((tree, tree));
+extern int chain_member_value PROTO((tree, tree));
+extern tree listify PROTO((tree));
+extern tree type_hash_lookup PROTO((int, tree));
+extern void type_hash_add PROTO((int, tree));
+extern int type_hash_list PROTO((tree));
+extern int simple_cst_list_equal PROTO((tree, tree));
+extern void debug_obstack PROTO((char *));
+extern void rtl_in_current_obstack PROTO((void));
+extern void rtl_in_saveable_obstack PROTO((void));
+extern void init_tree_codes PROTO((void));
+extern void dump_tree_statistics PROTO((void));
+extern void print_obstack_statistics
+	PROTO((char *, struct obstack *));
+#ifdef BUFSIZ
+extern void print_obstack_name
+	PROTO((char *, FILE *, char *));
+#endif
+extern void expand_function_end PROTO((char *, int, int));
+extern void expand_function_start PROTO((tree, int));
+extern int real_onep PROTO((tree));
+extern int real_twop PROTO((tree));
+extern void start_identifier_warnings PROTO((void));
+extern void gcc_obstack_init PROTO((struct obstack *));
+extern void init_obstacks PROTO((void));
+extern void obfree PROTO((char *));
+
+/* In function.c */
+extern void setjmp_protect_args PROTO((void));
+extern void setjmp_protect PROTO((tree));
+extern void expand_main_function PROTO((void));
+extern void mark_varargs PROTO((void));
+extern void init_function_start PROTO((tree, char *, int));
+extern void assign_parms PROTO((tree, int));
+extern void put_var_into_stack PROTO((tree));
+extern void uninitialized_vars_warning PROTO((tree));
+extern void setjmp_args_warning PROTO((void));
+extern void mark_all_temps_used PROTO((void));
+extern void init_temp_slots PROTO((void));
+extern void combine_temp_slots PROTO((void));
+extern void free_temp_slots PROTO((void));
+extern void pop_temp_slots PROTO((void));
+extern void push_temp_slots PROTO((void));
+extern void preserve_temp_slots PROTO((struct rtx_def *));
+extern int aggregate_value_p PROTO((tree));
+extern tree reorder_blocks PROTO((tree *, tree, struct rtx_def *));
+extern void free_temps_for_rtl_expr PROTO((tree));
+extern void instantiate_virtual_regs PROTO((tree, struct rtx_def *));
+extern int max_parm_reg_num PROTO((void));
+extern void bc_expand_function_start PROTO((tree, int));
+extern void bc_expand_function_end PROTO((void));
+extern void push_function_context PROTO((void));
+extern void pop_function_context PROTO((void));
+extern void push_function_context_to PROTO((tree));
+extern void pop_function_context_from PROTO((tree));
+
+/* In print-rtl.c */
+#ifdef BUFSIZ
+extern void print_rtl PROTO((FILE *, struct rtx_def *));
+#endif
+
+/* In print-tree.c */
+extern void debug_tree PROTO((tree));
+#ifdef BUFSIZ
+extern void print_node PROTO((FILE *, char *, tree, int));
+extern void print_node_brief PROTO((FILE *, char *, tree, int));
+extern void indent_to PROTO((FILE *, int));
+#endif
+
+/* In expr.c */
+extern void emit_queue PROTO((void));
+extern int apply_args_register_offset PROTO((int));
+extern char * bc_gen_constr_label PROTO((void));
+extern struct rtx_def * bc_allocate_variable_array PROTO((tree));
+extern struct rtx_def * expand_builtin_return_addr
+	PROTO((enum built_in_function, int, struct rtx_def *));
+extern void do_pending_stack_adjust PROTO((void));
+extern struct rtx_def * expand_assignment PROTO((tree, tree, int, int));
+extern struct rtx_def * store_expr PROTO((tree, struct rtx_def *, int));
+
+/* In emit-rtl.c */
+extern void start_sequence_for_rtl_expr PROTO((tree));
+extern struct rtx_def *emit_line_note_after
+	PROTO((char *, int, struct rtx_def *));
+extern struct rtx_def *emit_line_note PROTO((char *, int));
+extern struct rtx_def *emit_line_note_force PROTO((char *, int));
+
+/* In c-typeck.c */
+extern int mark_addressable PROTO((tree));
+extern void incomplete_type_error PROTO((tree, tree));
+
+/* In c-lang.c */
+extern void print_lang_statistics PROTO((void));
+
+/* In c-common.c */
+extern tree truthvalue_conversion PROTO((tree));
+extern int min_precision PROTO((tree, int));
+extern void split_specs_attrs PROTO((tree, tree *, tree *));
+
+/* In c-decl.c */
+#ifdef BUFSIZ
+extern void print_lang_decl PROTO((FILE *, tree, int));
+extern void print_lang_type PROTO((FILE *, tree, int));
+extern void print_lang_identifier PROTO((FILE *, tree, int));
+#endif
+extern int global_bindings_p PROTO((void));
+extern void insert_block PROTO((tree));
+
+/* In integrate.c */
+extern void save_for_inline_nocopy PROTO((tree));
+extern void save_for_inline_copying PROTO((tree));
+extern void set_decl_abstract_flags PROTO((tree, int));
+extern void output_inline_function PROTO((tree));
+
+/* In c-lex.c */
+extern void set_yydebug PROTO((int));
+
+/* In stor-layout.c */
+extern void fixup_signed_type PROTO((tree));
+
+/* varasm.c */
+extern void make_decl_rtl PROTO((tree, char *, int));
+extern void make_decl_one_only PROTO((tree));
+extern void variable_section PROTO((tree, int));
+
+/* toplev.c */
+extern void print_time PROTO((char *, int));                       
+extern int get_run_time PROTO((void));
+extern void debug_start_source_file PROTO((char *));
+extern void debug_end_source_file PROTO((unsigned));
+extern void debug_define PROTO((unsigned, char *));
+extern void debug_undef PROTO((unsigned, char *));
+extern void rest_of_decl_compilation PROTO((tree, char *, int, int));
+extern void rest_of_type_compilation PROTO((tree, int));
+extern void rest_of_compilation PROTO((tree));
+extern void fatal PVPROTO((char *, ...));
+extern void fatal_io_error PROTO((char *));
+#if 0
+extern void warning PVPROTO((char *, ...));
+extern void error PVPROTO((char *, ...));
+#endif
+extern void pedwarn PVPROTO((char *, ...));
+extern void pedwarn_with_decl PVPROTO((tree, char *, ...));
+extern void pedwarn_with_file_and_line 
+	PVPROTO((char *, int, char *, ...));
+extern void warning_with_file_and_line
+	PVPROTO((char *, int, char *, ...));
+extern void warning_with_decl PVPROTO((tree, char *, ...));
+extern void error_with_decl PVPROTO((tree, char *, ...));
+extern void error_with_file_and_line
+	PVPROTO((char *, int, char *, ...));
+extern void sorry PVPROTO((char *s, ...));
+extern void default_print_error_function PROTO((char *));
+extern void report_error_function PROTO((char *));
+extern void announce_function PROTO((tree));
+
+/* In fold-const.c */
+extern int div_and_round_double	PROTO((enum tree_code, int,
+				       HOST_WIDE_INT, HOST_WIDE_INT,
+				       HOST_WIDE_INT, HOST_WIDE_INT,
+				       HOST_WIDE_INT *,
+				       HOST_WIDE_INT *,
+				       HOST_WIDE_INT *,
+				       HOST_WIDE_INT *));
+
+/* In stmt.c */
+extern void emit_nop PROTO((void));
+extern void expand_computed_goto PROTO((tree));
+extern void remember_end_note PROTO((tree));
+extern struct rtx_def *label_rtx PROTO((tree));
+extern void expand_asm_operands	PROTO((tree, tree, tree, tree, int,
+				       char *, int));
+extern int any_pending_cleanups PROTO((int));
+extern void init_stmt PROTO((void));
+extern void init_stmt_for_function PROTO((void));
+extern void remember_end_note PROTO((tree));
+extern int drop_through_at_end_p PROTO((void));
+extern void expand_start_target_temps PROTO((void));
+extern void expand_end_target_temps PROTO((void));
+extern void expand_elseif PROTO((tree));
+extern void expand_decl PROTO((tree));
+extern int expand_decl_cleanup PROTO((tree, tree));
+extern void expand_anon_union_decl PROTO((tree, tree, tree));
+extern void move_cleanups_up PROTO((void));
+extern void expand_start_case_dummy PROTO((void));
+extern void expand_end_case_dummy PROTO((void));
+extern tree case_index_expr_type PROTO((void));
+extern HOST_WIDE_INT all_cases_count PROTO((tree, int *));
+extern void mark_seen_cases PROTO((tree, unsigned char *, long, int));
+extern void check_for_full_enumeration_handling PROTO((tree));
+extern void declare_nonlocal_label PROTO((tree));
Index: tree.def
===================================================================
RCS file: /home/work/cvs/gnu/egcs/tree.def,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 tree.def
--- tree.def	1997/08/16 03:48:43	1.1.1.1
+++ tree.def	1997/08/19 00:26:25
@@ -19,7 +19,19 @@
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
- 
+#if !defined (NEED_enum_tree_code) || !defined(DEFINE_enum_tree_code)
+
+#ifdef NEED_enum_tree_code
+
+#ifndef DEFINE_enum_tree_code
+#define DEFINE_enum_tree_code
+#endif
+
+enum tree_code
+{
+#define DEFTREECODE(SYM, STRING, TYPE, NARGS)   SYM,
+#endif
+
 /* The third argument can be:
    "x" for an exceptional code (fits no category).
    "t" for a type object code.
@@ -738,6 +750,16 @@
    It must contain an EXIT_EXPR or is an infinite loop.
    The type should be void and the value should be ignored.  */
 DEFTREECODE (LOOP_EXPR, "loop_expr", "s", 1)
+
+#ifdef NEED_enum_tree_code
+#undef DEFTREECODE
+
+/* A convenient way to get a value for NUM_TREE_CODE. */
+LAST_AND_UNUSED_TREE_CODE
+};
+#endif
+
+#endif /* !NEED_enum_tree_code || !DEFINE_enum_tree_code */
 
 /*
 Local variables:
Index: calls.c
===================================================================
RCS file: /home/work/cvs/gnu/egcs/calls.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 calls.c
--- calls.c	1997/08/16 03:48:37	1.1.1.1
+++ calls.c	1997/08/19 00:32:50
@@ -2038,7 +2038,7 @@
 
   /* If there are cleanups to be called, don't use a hard reg as target.
      We need to double check this and see if it matters anymore.  */
-  if (any_pending_cleanups ()
+  if (any_pending_cleanups (1)
       && target && REG_P (target)
       && REGNO (target) < FIRST_PSEUDO_REGISTER)
     target = 0;

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

end of thread, other threads:[~1997-08-19 22:15 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-08-19 21:22 A prototype patch for tree.h/tree.def/calls.c Ian Haggard
1997-08-19 22:15 ` PA port & haifa Jeffrey A Law
  -- strict thread matches above, loose matches on Subject: below --
1997-08-19 19:24 Ugly *.def in gcc H.J. Lu
1997-08-19 19:45 ` A prototype patch for tree.h/tree.def/calls.c Jeffrey A Law
1997-08-19 19:12 H.J. Lu
1997-08-19 19:00 H.J. Lu
1997-08-19 19:00 ` Jeffrey A Law
1997-08-19 19:00 Some Haifa scheduler bugs Jeffrey A Law
1997-08-19 19:00 ` A prototype patch for tree.h/tree.def/calls.c Jeffrey A Law
1997-08-19 19:00 ` H.J. Lu
1997-08-19 17:54 H.J. Lu
1997-08-19 17:52 John Carr
1997-08-19 17:43 D.V. Henkel-Wallace
1997-08-19 16:06 egcs: A new compiler project to merge the existing GCC forks H.J. Lu
1997-08-19 16:06 ` A prototype patch for tree.h/tree.def/calls.c Jeffrey A Law
1997-08-19 13:19 H.J. Lu
1997-08-19  3:52 egcs: A new compiler project to merge the existing GCC forks (fwd) H.J. Lu
1997-08-19  5:08 ` A prototype patch for tree.h/tree.def/calls.c Jeffrey A Law
1997-08-18 23:56 H.J. Lu

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