Re: Bootstrap failed for i386-pc-solaris2.10 and sparc-sun-solaris2.10

2010-06-04 Thread Nathan Froyd
On Fri, Jun 04, 2010 at 01:44:02PM +, Art Haas wrote:
 This morning's i386 build fails with the following error:
 
 libbackend.a(sol2.o): In function `solaris_output_init_fini':
 /home/ahaas/gnu/gcc.git/gcc/config/sol2.c:109: undefined reference to 
 `print_operand'
 /home/ahaas/gnu/gcc.git/gcc/config/sol2.c:116: undefined reference to 
 `print_operand'
 collect2: ld returned 1 exit status
 make[3]: *** [cc1-dummy] Error 1
 
 The sparc build fails like so:
 
 libbackend.a(targhooks.o): In function `default_print_operand_address':
 /export/home/arth/src/gcc.git/gcc/targhooks.c:349: undefined reference to 
 `output_operand'
 /export/home/arth/src/gcc.git/gcc/targhooks.c:349: undefined reference to 
 `output_operand'
 collect2: ld returned 1 exit status
 gmake[3]: *** [cc1-dummy] Error 1

Whoops, sorry about that.  This patch fixes at least the sparc error
(successfully built a cross to sparc-solaris) and I'm in the process of
building a cross to i686-solaris.

OK to commit if compilation succeeds?

-Nathan


* config/i386/i386-protos.h (ix86_print_operand): Declare.
* config/i386/i386.c (ix86_print_operand): Make non-static.
* config/i386/sol2.h (ASM_OUTPUT_CALL): Call ix86_print_operand.
* rtl.h (output_operand): Declare.
* final.c (output_operand): Make non-static.

Index: final.c
===
--- final.c (revision 160266)
+++ final.c (working copy)
@@ -220,7 +220,6 @@ static void output_asm_name (void);
 static void output_alternate_entry_point (FILE *, rtx);
 static tree get_mem_expr_from_op (rtx, int *);
 static void output_asm_operand_names (rtx *, int *, int);
-static void output_operand (rtx, int);
 #ifdef LEAF_REGISTERS
 static void leaf_renumber_regs (rtx);
 #endif
@@ -3478,7 +3477,7 @@ mark_symbol_refs_as_used (rtx x)
The meanings of the letters are machine-dependent and controlled
by TARGET_PRINT_OPERAND.  */
 
-static void
+void
 output_operand (rtx x, int code ATTRIBUTE_UNUSED)
 {
   if (x  GET_CODE (x) == SUBREG)
Index: ChangeLog
===
Index: rtl.h
===
--- rtl.h   (revision 160266)
+++ rtl.h   (working copy)
@@ -2417,6 +2417,7 @@ extern void simplify_using_condition (rt
 /* In final.c  */
 extern unsigned int compute_alignments (void);
 extern int asm_str_count (const char *templ);
+extern void output_operand (rtx, int);
 
 struct rtl_hooks
 {
Index: config/i386/sol2.h
===
--- config/i386/sol2.h  (revision 160266)
+++ config/i386/sol2.h  (working copy)
@@ -145,7 +145,7 @@ along with GCC; see the file COPYING3.  
   do   \
 {  \
   fprintf (FILE, \tcall\t);  \
-  print_operand (FILE, XEXP (DECL_RTL (FN), 0), 'P');  \
+  ix86_print_operand (FILE, XEXP (DECL_RTL (FN), 0), 'P'); \
   fprintf (FILE, \n);\
 }  \
   while (0)
Index: config/i386/i386-protos.h
===
--- config/i386/i386-protos.h   (revision 160266)
+++ config/i386/i386-protos.h   (working copy)
@@ -60,6 +60,7 @@ extern bool legitimate_pic_operand_p (rt
 extern int legitimate_pic_address_disp_p (rtx);
 
 extern void print_reg (rtx, int, FILE*);
+extern void ix86_print_operand (FILE *, rtx, int);
 extern bool output_addr_const_extra (FILE*, rtx);
 
 extern void split_di (rtx[], int, rtx[], rtx[]);
Index: config/i386/i386.c
===
--- config/i386/i386.c  (revision 160266)
+++ config/i386/i386.c  (working copy)
@@ -11579,7 +11579,7 @@ get_some_local_dynamic_name (void)
; -- print a semicolon (after prefixes due to bug in older gas).
  */
 
-static void
+void
 ix86_print_operand (FILE *file, rtx x, int code)
 {
   if (code)


Re: Bootstrap failed for i386-pc-solaris2.10 and sparc-sun-solaris2.10

2010-06-04 Thread Ian Lance Taylor
Nathan Froyd froy...@codesourcery.com writes:

   * config/i386/i386-protos.h (ix86_print_operand): Declare.
   * config/i386/i386.c (ix86_print_operand): Make non-static.
   * config/i386/sol2.h (ASM_OUTPUT_CALL): Call ix86_print_operand.
   * rtl.h (output_operand): Declare.
   * final.c (output_operand): Make non-static.

The changes in config/i386 are OK.

I don't understand the point of the changes to rtl.h and final.c.

Thanks.

Ian


Re: Bootstrap failed for i386-pc-solaris2.10 and sparc-sun-solaris2.10

2010-06-04 Thread Nathan Froyd
On Fri, Jun 04, 2010 at 07:45:20AM -0700, Ian Lance Taylor wrote:
 Nathan Froyd froy...@codesourcery.com writes:
  * config/i386/i386-protos.h (ix86_print_operand): Declare.
  * config/i386/i386.c (ix86_print_operand): Make non-static.
  * config/i386/sol2.h (ASM_OUTPUT_CALL): Call ix86_print_operand.
  * rtl.h (output_operand): Declare.
  * final.c (output_operand): Make non-static.
 
 The changes in config/i386 are OK.
 
 I don't understand the point of the changes to rtl.h and final.c.

The changes to rtl.h and final.c are necessary because PRINT_OPERAND* on
some platforms freely calls output_operand.  But now that PRINT_OPERAND*
has been hookized, that call to output_operand no longer appears
textually in final.c, but somewhere else (targhooks.c if the port has
not done the conversion PRINT_OPERAND* - TARGET_PRINT_OPERAND*,
config/$PORT/$PORT.c if the port has), output_operand needs to be
exported.

Looking at things a little more closely, output_address is exported in
output.h.  I suppose output_operand should be exported there as well?

-Nathan


Re: Bootstrap failed for i386-pc-solaris2.10 and sparc-sun-solaris2.10

2010-06-04 Thread Ian Lance Taylor
Nathan Froyd froy...@codesourcery.com writes:

 On Fri, Jun 04, 2010 at 07:45:20AM -0700, Ian Lance Taylor wrote:
 Nathan Froyd froy...@codesourcery.com writes:
 * config/i386/i386-protos.h (ix86_print_operand): Declare.
 * config/i386/i386.c (ix86_print_operand): Make non-static.
 * config/i386/sol2.h (ASM_OUTPUT_CALL): Call ix86_print_operand.
 * rtl.h (output_operand): Declare.
 * final.c (output_operand): Make non-static.
 
 The changes in config/i386 are OK.
 
 I don't understand the point of the changes to rtl.h and final.c.

 The changes to rtl.h and final.c are necessary because PRINT_OPERAND* on
 some platforms freely calls output_operand.  But now that PRINT_OPERAND*
 has been hookized, that call to output_operand no longer appears
 textually in final.c, but somewhere else (targhooks.c if the port has
 not done the conversion PRINT_OPERAND* - TARGET_PRINT_OPERAND*,
 config/$PORT/$PORT.c if the port has), output_operand needs to be
 exported.

I get it.

 Looking at things a little more closely, output_address is exported in
 output.h.  I suppose output_operand should be exported there as well?

Yes, put the declaration there, by output_operand_lossage.

Thanks.

Ian


Re: Bootstrap failed for i386-pc-solaris2.10 and sparc-sun-solaris2.10

2010-06-04 Thread Nathan Froyd
On Fri, Jun 04, 2010 at 08:32:26AM -0700, Ian Lance Taylor wrote:
 Nathan Froyd froy...@codesourcery.com writes:
  Looking at things a little more closely, output_address is exported in
  output.h.  I suppose output_operand should be exported there as well?
 
 Yes, put the declaration there, by output_operand_lossage.

This is what I committed.

-Nathan

* config/i386/i386-protos.h (ix86_print_operand): Declare.
* config/i386/i386.c (ix86_print_operand): Make non-static.
* config/i386/sol2.h (ASM_OUTPUT_CALL): Call ix86_print_operand.
* output.h (output_operand): Declare.
* final.c (output_operand): Make non-static.

Index: final.c
===
--- final.c (revision 160285)
+++ final.c (working copy)
@@ -220,7 +220,6 @@ static void output_asm_name (void);
 static void output_alternate_entry_point (FILE *, rtx);
 static tree get_mem_expr_from_op (rtx, int *);
 static void output_asm_operand_names (rtx *, int *, int);
-static void output_operand (rtx, int);
 #ifdef LEAF_REGISTERS
 static void leaf_renumber_regs (rtx);
 #endif
@@ -3478,7 +3477,7 @@ mark_symbol_refs_as_used (rtx x)
The meanings of the letters are machine-dependent and controlled
by TARGET_PRINT_OPERAND.  */
 
-static void
+void
 output_operand (rtx x, int code ATTRIBUTE_UNUSED)
 {
   if (x  GET_CODE (x) == SUBREG)
Index: ChangeLog
===
Index: output.h
===
--- output.h(revision 160285)
+++ output.h(working copy)
@@ -77,6 +77,9 @@ extern rtx final_scan_insn (rtx, FILE *,
subreg of.  */
 extern rtx alter_subreg (rtx *);
 
+/* Print an operand using machine-dependent assembler syntax.  */
+extern void output_operand (rtx, int);
+
 /* Report inconsistency between the assembler template and the operands.
In an `asm', it's the user's fault; otherwise, the compiler's fault.  */
 extern void output_operand_lossage (const char *, ...) ATTRIBUTE_PRINTF_1;
Index: config/i386/sol2.h
===
--- config/i386/sol2.h  (revision 160285)
+++ config/i386/sol2.h  (working copy)
@@ -145,7 +145,7 @@ along with GCC; see the file COPYING3.  
   do   \
 {  \
   fprintf (FILE, \tcall\t);  \
-  print_operand (FILE, XEXP (DECL_RTL (FN), 0), 'P');  \
+  ix86_print_operand (FILE, XEXP (DECL_RTL (FN), 0), 'P'); \
   fprintf (FILE, \n);\
 }  \
   while (0)
Index: config/i386/i386-protos.h
===
--- config/i386/i386-protos.h   (revision 160285)
+++ config/i386/i386-protos.h   (working copy)
@@ -60,6 +60,7 @@ extern bool legitimate_pic_operand_p (rt
 extern int legitimate_pic_address_disp_p (rtx);
 
 extern void print_reg (rtx, int, FILE*);
+extern void ix86_print_operand (FILE *, rtx, int);
 extern bool output_addr_const_extra (FILE*, rtx);
 
 extern void split_di (rtx[], int, rtx[], rtx[]);
Index: config/i386/i386.c
===
--- config/i386/i386.c  (revision 160285)
+++ config/i386/i386.c  (working copy)
@@ -11579,7 +11579,7 @@ get_some_local_dynamic_name (void)
; -- print a semicolon (after prefixes due to bug in older gas).
  */
 
-static void
+void
 ix86_print_operand (FILE *file, rtx x, int code)
 {
   if (code)


RE: Bootstrap failed for i386-pc-solaris2.10 and sparc-sun-solaris2.10

2010-06-04 Thread Arthur Haas
Hi.

The patch resolves the build failures.

Thanks.

Art Haas

-Original Message-
From: Nathan Froyd [mailto:froy...@codesourcery.com]
Sent: Friday, June 04, 2010 12:29 PM
To: Ian Lance Taylor
Cc: Arthur Haas; gcc@gcc.gnu.org
Subject: Re: Bootstrap failed for i386-pc-solaris2.10 and sparc-sun-solaris2.10

On Fri, Jun 04, 2010 at 08:32:26AM -0700, Ian Lance Taylor wrote:
 Nathan Froyd froy...@codesourcery.com writes:
  Looking at things a little more closely, output_address is exported in
  output.h.  I suppose output_operand should be exported there as well?

 Yes, put the declaration there, by output_operand_lossage.

This is what I committed.

-Nathan

* config/i386/i386-protos.h (ix86_print_operand): Declare.
* config/i386/i386.c (ix86_print_operand): Make non-static.
* config/i386/sol2.h (ASM_OUTPUT_CALL): Call ix86_print_operand.
* output.h (output_operand): Declare.
* final.c (output_operand): Make non-static.

Index: final.c
===
--- final.c (revision 160285)
+++ final.c (working copy)
@@ -220,7 +220,6 @@ static void output_asm_name (void);
 static void output_alternate_entry_point (FILE *, rtx);
 static tree get_mem_expr_from_op (rtx, int *);
 static void output_asm_operand_names (rtx *, int *, int);
-static void output_operand (rtx, int);
 #ifdef LEAF_REGISTERS
 static void leaf_renumber_regs (rtx);
 #endif
@@ -3478,7 +3477,7 @@ mark_symbol_refs_as_used (rtx x)
The meanings of the letters are machine-dependent and controlled
by TARGET_PRINT_OPERAND.  */

-static void
+void
 output_operand (rtx x, int code ATTRIBUTE_UNUSED)
 {
   if (x  GET_CODE (x) == SUBREG)
Index: ChangeLog
===
Index: output.h
===
--- output.h(revision 160285)
+++ output.h(working copy)
@@ -77,6 +77,9 @@ extern rtx final_scan_insn (rtx, FILE *,
subreg of.  */
 extern rtx alter_subreg (rtx *);

+/* Print an operand using machine-dependent assembler syntax.  */
+extern void output_operand (rtx, int);
+
 /* Report inconsistency between the assembler template and the operands.
In an `asm', it's the user's fault; otherwise, the compiler's fault.  */
 extern void output_operand_lossage (const char *, ...) ATTRIBUTE_PRINTF_1;
Index: config/i386/sol2.h
===
--- config/i386/sol2.h  (revision 160285)
+++ config/i386/sol2.h  (working copy)
@@ -145,7 +145,7 @@ along with GCC; see the file COPYING3.
   do   \
 {  \
   fprintf (FILE, \tcall\t);  \
-  print_operand (FILE, XEXP (DECL_RTL (FN), 0), 'P');  \
+  ix86_print_operand (FILE, XEXP (DECL_RTL (FN), 0), 'P'); \
   fprintf (FILE, \n);\
 }  \
   while (0)
Index: config/i386/i386-protos.h
===
--- config/i386/i386-protos.h   (revision 160285)
+++ config/i386/i386-protos.h   (working copy)
@@ -60,6 +60,7 @@ extern bool legitimate_pic_operand_p (rt
 extern int legitimate_pic_address_disp_p (rtx);

 extern void print_reg (rtx, int, FILE*);
+extern void ix86_print_operand (FILE *, rtx, int);
 extern bool output_addr_const_extra (FILE*, rtx);

 extern void split_di (rtx[], int, rtx[], rtx[]);
Index: config/i386/i386.c
===
--- config/i386/i386.c  (revision 160285)
+++ config/i386/i386.c  (working copy)
@@ -11579,7 +11579,7 @@ get_some_local_dynamic_name (void)
; -- print a semicolon (after prefixes due to bug in older gas).
  */

-static void
+void
 ix86_print_operand (FILE *file, rtx x, int code)
 {
   if (code)