This is the mail archive of the gcc-patches@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]

Re: [middle-end] Add machine_mode to address_cost target hook


On Thu, 2012-09-06 at 09:49 +0200, Dominique Dhumieres wrote:
> Oleg,
> 
> Bootstrap fails at revision 190996 on powerpc-apple-darwin9 with:
> 
> g++ -c   -g -DIN_GCC   -fno-exceptions -fno-rtti -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../work/gcc -I../../work/gcc/. -I../../work/gcc/../include -I./../intl -I../../work/gcc/../libcpp/include -I/opt/mp/include  -I../../work/gcc/../libdecnumber -I../../work/gcc/../libdecnumber/dpd -I../libdecnumber -DCLOOG_INT_GMP  -I/opt/mp/include  \
> 	../../work/gcc/config/rs6000/rs6000.c -o rs6000.o
> ../../work/gcc/config/rs6000/rs6000.c: In function 'int rs6000_debug_address_cost(rtx, machine_mode, addr_space_t, bool)':
> ../../work/gcc/config/rs6000/rs6000.c:26077:42: error: cannot convert 'bool' to 'machine_mode' for argument '2' to 'int hook_int_rtx_mode_as_bool_0(rtx, machine_mode, addr_space_t, bool)'
>    int ret = TARGET_ADDRESS_COST (x, speed);
> 
> Obvious(?) fix
> 
> --- ../_gcc_clean/gcc/config/rs6000/rs6000.c	2012-09-05 20:25:39.000000000 +0200
> +++ ../work/gcc/config/rs6000/rs6000.c	2012-09-06 00:56:21.000000000 +0200
> @@ -26074,7 +26074,7 @@ static int
>  rs6000_debug_address_cost (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED,
>  			   addr_space_t as ATTRIBUTE_UNUSED, bool speed)
>  {
> -  int ret = TARGET_ADDRESS_COST (x, speed);
> +  int ret = TARGET_ADDRESS_COST (x, mode, as, speed);
>  
>    fprintf (stderr, "\nrs6000_address_cost, return = %d, speed = %s, x:\n",
>  	   ret, speed ? "true" : "false");
> 

Argh, sorry.  Yes, you're right.  The unused attrs can also go away in
this case:

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 190990)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -26071,10 +26071,10 @@
 /* Debug form of ADDRESS_COST that is selected if -mdebug=cost.  */
 
 static int
-rs6000_debug_address_cost (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED,
-			   addr_space_t as ATTRIBUTE_UNUSED, bool speed)
+rs6000_debug_address_cost (rtx x, enum machine_mode mode, addr_space_t as,
+			   bool speed)
 {
-  int ret = TARGET_ADDRESS_COST (x, speed);
+  int ret = TARGET_ADDRESS_COST (x, mode, as, speed);
 
   fprintf (stderr, "\nrs6000_address_cost, return = %d, speed = %s, x:\n",
 	   ret, speed ? "true" : "false");


Could you please commit this (I can't at the moment)?

Cheers,
Oleg


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