public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Delete unused function: cp/typeck.c (common_base_type)
@ 2007-02-11 11:37 Manuel López-Ibáñez
  2007-02-12 14:40 ` Serge Belyshev
  2007-02-20 17:46 ` [PING] " Manuel López-Ibáñez
  0 siblings, 2 replies; 10+ messages in thread
From: Manuel López-Ibáñez @ 2007-02-11 11:37 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 204 bytes --]

Another unused function.

Bootstrapped and regression tested on i686-pc-linux-gnu.

Bye bye?

2007-02-11  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

  * typeck.c (common_base_type): Delete unused function.

[-- Attachment #2: kill-common-base-type.diff --]
[-- Type: text/plain, Size: 2110 bytes --]

Index: gcc/cp/typeck.c
===================================================================
--- gcc/cp/typeck.c	(revision 121678)
+++ gcc/cp/typeck.c	(working copy)
@@ -53,7 +53,6 @@ static tree rationalize_conditional_expr
 static int comp_ptr_ttypes_real (tree, tree, int);
 static bool comp_except_types (tree, tree, bool);
 static bool comp_array_types (tree, tree, bool);
-static tree common_base_type (tree, tree);
 static tree pointer_diff (tree, tree, tree);
 static tree get_delta_difference (tree, tree, bool, bool);
 static void casts_away_constness_r (tree *, tree *);
@@ -1196,59 +1195,6 @@ comp_cv_qual_signature (tree type1, tree
   else
     return 0;
 }
-
-/* If two types share a common base type, return that basetype.
-   If there is not a unique most-derived base type, this function
-   returns ERROR_MARK_NODE.  */
-
-static tree
-common_base_type (tree tt1, tree tt2)
-{
-  tree best = NULL_TREE;
-  int i;
-
-  /* If one is a baseclass of another, that's good enough.  */
-  if (UNIQUELY_DERIVED_FROM_P (tt1, tt2))
-    return tt1;
-  if (UNIQUELY_DERIVED_FROM_P (tt2, tt1))
-    return tt2;
-
-  /* Otherwise, try to find a unique baseclass of TT1
-     that is shared by TT2, and follow that down.  */
-  for (i = BINFO_N_BASE_BINFOS (TYPE_BINFO (tt1))-1; i >= 0; i--)
-    {
-      tree basetype = BINFO_TYPE (BINFO_BASE_BINFO (TYPE_BINFO (tt1), i));
-      tree trial = common_base_type (basetype, tt2);
-
-      if (trial)
-	{
-	  if (trial == error_mark_node)
-	    return trial;
-	  if (best == NULL_TREE)
-	    best = trial;
-	  else if (best != trial)
-	    return error_mark_node;
-	}
-    }
-
-  /* Same for TT2.  */
-  for (i = BINFO_N_BASE_BINFOS (TYPE_BINFO (tt2))-1; i >= 0; i--)
-    {
-      tree basetype = BINFO_TYPE (BINFO_BASE_BINFO (TYPE_BINFO (tt2), i));
-      tree trial = common_base_type (tt1, basetype);
-
-      if (trial)
-	{
-	  if (trial == error_mark_node)
-	    return trial;
-	  if (best == NULL_TREE)
-	    best = trial;
-	  else if (best != trial)
-	    return error_mark_node;
-	}
-    }
-  return best;
-}
 \f
 /* Subroutines of `comptypes'.  */
 

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

* Re: Delete unused function: cp/typeck.c (common_base_type)
  2007-02-11 11:37 Delete unused function: cp/typeck.c (common_base_type) Manuel López-Ibáñez
@ 2007-02-12 14:40 ` Serge Belyshev
  2007-02-12 14:44   ` Manuel López-Ibáñez
  2007-02-12 14:47   ` Manuel López-Ibáñez
  2007-02-20 17:46 ` [PING] " Manuel López-Ibáñez
  1 sibling, 2 replies; 10+ messages in thread
From: Serge Belyshev @ 2007-02-12 14:40 UTC (permalink / raw)
  To: Manuel López-Ibáñez; +Cc: gcc-patches

"Manuel López-Ibáñez" <lopezibanez@gmail.com> writes:

> Another unused function.
>
> Bootstrapped and regression tested on i686-pc-linux-gnu.
>
> Bye bye?
>
> 2007-02-11  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
>
>  * typeck.c (common_base_type): Delete unused function.

... and there is yet another one:

cc1: warnings being treated as errors
/home/ssb/src/r/gcc43/gcc/alias.c:1353: warning: 'find_symbolic_term' defined but not used
make[3]: *** [alias.o] Error 1

Last usage of this one was removed by:

r17226 | law | 1997-12-25 00:39:44 +0300 (Thu, 25 Dec 1997) | 12 line


I think change to delete these two functions would qualify as obvious.

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

* Re: Delete unused function: cp/typeck.c (common_base_type)
  2007-02-12 14:40 ` Serge Belyshev
@ 2007-02-12 14:44   ` Manuel López-Ibáñez
  2007-02-12 14:47   ` Manuel López-Ibáñez
  1 sibling, 0 replies; 10+ messages in thread
From: Manuel López-Ibáñez @ 2007-02-12 14:44 UTC (permalink / raw)
  To: Serge Belyshev; +Cc: gcc-patches

I am already testing a patch for that. Also, I prefer that a mantainer
approves the changes, since there may be other things that need to be
removed / adjusted along with the function.

Thanks anyway.

Manuel.


On 12/02/07, Serge Belyshev <belyshev@depni.sinp.msu.ru> wrote:
> "Manuel López-Ibáñez" <lopezibanez@gmail.com> writes:
>
> > Another unused function.
> >
> > Bootstrapped and regression tested on i686-pc-linux-gnu.
> >
> > Bye bye?
> >
> > 2007-02-11  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
> >
> >  * typeck.c (common_base_type): Delete unused function.
>
> ... and there is yet another one:
>
> cc1: warnings being treated as errors
> /home/ssb/src/r/gcc43/gcc/alias.c:1353: warning: 'find_symbolic_term' defined but not used
> make[3]: *** [alias.o] Error 1
>
> Last usage of this one was removed by:
>
> r17226 | law | 1997-12-25 00:39:44 +0300 (Thu, 25 Dec 1997) | 12 line
>
>
> I think change to delete these two functions would qualify as obvious.
>

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

* Re: Delete unused function: cp/typeck.c (common_base_type)
  2007-02-12 14:40 ` Serge Belyshev
  2007-02-12 14:44   ` Manuel López-Ibáñez
@ 2007-02-12 14:47   ` Manuel López-Ibáñez
  2007-02-12 14:49     ` Serge Belyshev
  1 sibling, 1 reply; 10+ messages in thread
From: Manuel López-Ibáñez @ 2007-02-12 14:47 UTC (permalink / raw)
  To: Serge Belyshev; +Cc: gcc-patches

By the way, how did you get that warning?

Cheers,

Manuel.


On 12/02/07, Serge Belyshev <belyshev@depni.sinp.msu.ru> wrote:
> "Manuel López-Ibáñez" <lopezibanez@gmail.com> writes:
>
> > Another unused function.
> >
> > Bootstrapped and regression tested on i686-pc-linux-gnu.
> >
> > Bye bye?
> >
> > 2007-02-11  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
> >
> >  * typeck.c (common_base_type): Delete unused function.
>
> ... and there is yet another one:
>
> cc1: warnings being treated as errors
> /home/ssb/src/r/gcc43/gcc/alias.c:1353: warning: 'find_symbolic_term' defined but not used
> make[3]: *** [alias.o] Error 1
>
> Last usage of this one was removed by:
>
> r17226 | law | 1997-12-25 00:39:44 +0300 (Thu, 25 Dec 1997) | 12 line
>
>
> I think change to delete these two functions would qualify as obvious.
>

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

* Re: Delete unused function: cp/typeck.c (common_base_type)
  2007-02-12 14:47   ` Manuel López-Ibáñez
@ 2007-02-12 14:49     ` Serge Belyshev
  2007-02-12 14:54       ` Serge Belyshev
  0 siblings, 1 reply; 10+ messages in thread
From: Serge Belyshev @ 2007-02-12 14:49 UTC (permalink / raw)
  To: Manuel López-Ibáñez; +Cc: gcc-patches

"Manuel López-Ibáñez" <lopezibanez@gmail.com> writes:

> By the way, how did you get that warning?
>

It broke my bootstrap. :)

/home/ssb/src/build/build-gcc43-121844-MNH22316/./prev-gcc/xgcc -B/home/ssb/src/build/build-gcc43-121844-MNH22316/./prev-gcc/ -B/home/ssb/gcc43-121844/x86_64-unknown-linux-gnu/bin/ -c   -O2 -g -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wmissing-format-attribute -Werror -fno-common   -DHAVE_CONFIG_H -I. -I. -I/home/ssb/src/r/gcc43/gcc -I/home/ssb/src/r/gcc43/gcc/. -I/home/ssb/src/r/gcc43/gcc/../include -I/home/ssb/src/r/gcc43/gcc/../libcpp/include  -I/home/ssb/src/r/gcc43/gcc/../libdecnumber -I../libdecnumber    /home/ssb/src/r/gcc43/gcc/alias.c -o alias.o
cc1: warnings being treated as errors
/home/ssb/src/r/gcc43/gcc/alias.c:1353: warning: 'find_symbolic_term' defined but not used
make[3]: *** [alias.o] Error 1
make[3]: *** Waiting for unfinished jobs....

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

* Re: Delete unused function: cp/typeck.c (common_base_type)
  2007-02-12 14:49     ` Serge Belyshev
@ 2007-02-12 14:54       ` Serge Belyshev
  2007-02-12 15:16         ` Manuel López-Ibáñez
  0 siblings, 1 reply; 10+ messages in thread
From: Serge Belyshev @ 2007-02-12 14:54 UTC (permalink / raw)
  To: Manuel López-Ibáñez; +Cc: gcc-patches

Serge Belyshev <belyshev@depni.sinp.msu.ru> writes:

> "Manuel López-Ibáñez" <lopezibanez@gmail.com> writes:
>
>> By the way, how did you get that warning?
>>
>
> It broke my bootstrap. :)
>

Actually, it appears that I've applied your patch for bug 4076
( http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4076#c5 )
locally and forgot about it, sorry for the noise. :)

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

* Re: Delete unused function: cp/typeck.c (common_base_type)
  2007-02-12 14:54       ` Serge Belyshev
@ 2007-02-12 15:16         ` Manuel López-Ibáñez
  0 siblings, 0 replies; 10+ messages in thread
From: Manuel López-Ibáñez @ 2007-02-12 15:16 UTC (permalink / raw)
  To: Serge Belyshev; +Cc: gcc-patches

On 12/02/07, Serge Belyshev <belyshev@depni.sinp.msu.ru> wrote:
> Serge Belyshev <belyshev@depni.sinp.msu.ru> writes:
>
> > "Manuel López-Ibáñez" <lopezibanez@gmail.com> writes:
> >
> >> By the way, how did you get that warning?
> >>
> >
> > It broke my bootstrap. :)
> >
>
> Actually, it appears that I've applied your patch for bug 4076
> ( http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4076#c5 )
> locally and forgot about it, sorry for the noise. :)
>

Oh, right. That explains all. I need to clean all unused functions
before properly submitting that patch.

Thanks for testing it! ;-)

Manuel

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

* [PING] Delete unused function: cp/typeck.c (common_base_type)
  2007-02-11 11:37 Delete unused function: cp/typeck.c (common_base_type) Manuel López-Ibáñez
  2007-02-12 14:40 ` Serge Belyshev
@ 2007-02-20 17:46 ` Manuel López-Ibáñez
  2007-03-01 18:33   ` [PING^2] [C++] " Manuel López-Ibáñez
  1 sibling, 1 reply; 10+ messages in thread
From: Manuel López-Ibáñez @ 2007-02-20 17:46 UTC (permalink / raw)
  To: gcc-patches

Please review: http://gcc.gnu.org/ml/gcc-patches/2007-02/msg00957.html

Thanks,

Manuel.

On 11/02/07, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
> Another unused function.
>
> Bootstrapped and regression tested on i686-pc-linux-gnu.
>
> Bye bye?
>
> 2007-02-11  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
>
>   * typeck.c (common_base_type): Delete unused function.
>
>

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

* [PING^2] [C++] Delete unused function: cp/typeck.c (common_base_type)
  2007-02-20 17:46 ` [PING] " Manuel López-Ibáñez
@ 2007-03-01 18:33   ` Manuel López-Ibáñez
  2007-03-02  6:10     ` Mark Mitchell
  0 siblings, 1 reply; 10+ messages in thread
From: Manuel López-Ibáñez @ 2007-03-01 18:33 UTC (permalink / raw)
  To: gcc-patches

This patch removes an unused function from the C++ front-end. It is
blocking the patch to fix PR4076.

PING^2: http://gcc.gnu.org/ml/gcc-patches/2007-02/msg00957.html

Thanks,

Manuel.



On 20/02/07, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
> Please review: http://gcc.gnu.org/ml/gcc-patches/2007-02/msg00957.html
>
> Thanks,
>
> Manuel.
>
> On 11/02/07, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
> > Another unused function.
> >
> > Bootstrapped and regression tested on i686-pc-linux-gnu.
> >
> > Bye bye?
> >
> > 2007-02-11  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
> >
> >   * typeck.c (common_base_type): Delete unused function.
> >
> >
>

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

* Re: [PING^2] [C++] Delete unused function: cp/typeck.c (common_base_type)
  2007-03-01 18:33   ` [PING^2] [C++] " Manuel López-Ibáñez
@ 2007-03-02  6:10     ` Mark Mitchell
  0 siblings, 0 replies; 10+ messages in thread
From: Mark Mitchell @ 2007-03-02  6:10 UTC (permalink / raw)
  To: Manuel López-Ibáñez; +Cc: gcc-patches

Manuel López-Ibáñez wrote:
> This patch removes an unused function from the C++ front-end. It is
> blocking the patch to fix PR4076.
> 
> PING^2: http://gcc.gnu.org/ml/gcc-patches/2007-02/msg00957.html

Changes to remove functions in the compiler proper (but not the runtime
libraries) that are totally unused throughout the entire GCC codebase
are hereby pre-approved for removal.  However, if the function appears
to be intended for use from a debugger, please do not remove it.  And,
if any maintainer objects, please honor their request to keep or restore
functions.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

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

end of thread, other threads:[~2007-03-02  6:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-11 11:37 Delete unused function: cp/typeck.c (common_base_type) Manuel López-Ibáñez
2007-02-12 14:40 ` Serge Belyshev
2007-02-12 14:44   ` Manuel López-Ibáñez
2007-02-12 14:47   ` Manuel López-Ibáñez
2007-02-12 14:49     ` Serge Belyshev
2007-02-12 14:54       ` Serge Belyshev
2007-02-12 15:16         ` Manuel López-Ibáñez
2007-02-20 17:46 ` [PING] " Manuel López-Ibáñez
2007-03-01 18:33   ` [PING^2] [C++] " Manuel López-Ibáñez
2007-03-02  6:10     ` Mark Mitchell

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