* [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P
@ 2011-04-27 18:43 Anatoly Sokolov
2011-04-28 16:18 ` Richard Henderson
0 siblings, 1 reply; 14+ messages in thread
From: Anatoly Sokolov @ 2011-04-27 18:43 UTC (permalink / raw)
To: gcc-patches; +Cc: rth, ebotcazou
Hello.
This patch removes obsolete PRINT_OPERAND, PRINT_OPERAND_ADDRESS and
PRINT_OPERAND_PUNCT_VALID_P macros from SPARC back end in the GCC and
introduces equivalent TARGET_PRINT_OPERAND, TARGET_PRINT_OPERAND_ADDRESS and
TARGET_PRINT_OPERAND_PUNCT_VALID_P target hooks.
Bootstrapped and regression tested on sparc64-unknown-linux-gnu.
OK to install?
* config/sparc/sparc.h (PRINT_OPERAND, PRINT_OPERAND_ADDRESS,
PRINT_OPERAND_PUNCT_VALID_P): Remove.
* config/sparc/sparc-protos.h (print_operand): Remove declaration.
* config/sparc/sparc.c (TARGET_PRINT_OPERAND_PUNCT_VALID_P,
TARGET_PRINT_OPERAND, TARGET_PRINT_OPERAND_ADDRESS): Define.
(print_operand): Rename to...
(sparc_print_operand): ...this. Make static. Adjust
sparc_print_operand function call.
(sparc_print_operand_punct_valid_p, sparc_print_operand_address): New
functions.
Index: gcc/config/sparc/sparc-protos.h
===================================================================
--- gcc/config/sparc/sparc-protos.h (revision 172733)
+++ gcc/config/sparc/sparc-protos.h (working copy)
@@ -76,7 +76,6 @@
extern const char *output_probe_stack_range (rtx, rtx);
extern bool emit_scc_insn (rtx []);
extern void emit_conditional_branch_insn (rtx []);
-extern void print_operand (FILE *, rtx, int);
extern int mems_ok_for_ldd_peep (rtx, rtx, rtx);
extern int arith_double_4096_operand (rtx, enum machine_mode);
extern int arith_4096_operand (rtx, enum machine_mode);
Index: gcc/config/sparc/sparc.c
===================================================================
--- gcc/config/sparc/sparc.c (revision 172733)
+++ gcc/config/sparc/sparc.c (working copy)
@@ -468,6 +468,9 @@
static void sparc_trampoline_init (rtx, tree, rtx);
static enum machine_mode sparc_preferred_simd_mode (enum machine_mode);
static reg_class_t sparc_preferred_reload_class (rtx x, reg_class_t rclass);
+static bool sparc_print_operand_punct_valid_p (unsigned char);
+static void sparc_print_operand (FILE *, rtx, int);
+static void sparc_print_operand_address (FILE *, rtx);
\f
#ifdef SUBTARGET_ATTRIBUTE_TABLE
/* Table of valid machine attributes. */
@@ -663,6 +666,13 @@
#undef TARGET_TRAMPOLINE_INIT
#define TARGET_TRAMPOLINE_INIT sparc_trampoline_init
+#undef TARGET_PRINT_OPERAND_PUNCT_VALID_P
+#define TARGET_PRINT_OPERAND_PUNCT_VALID_P sparc_print_operand_punct_valid_p
+#undef TARGET_PRINT_OPERAND
+#define TARGET_PRINT_OPERAND sparc_print_operand
+#undef TARGET_PRINT_OPERAND_ADDRESS
+#define TARGET_PRINT_OPERAND_ADDRESS sparc_print_operand_address
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Validate and override various options, and do some machine dependent
@@ -7326,12 +7336,29 @@
return 1;
}
\f
-/* Print operand X (an rtx) in assembler syntax to file FILE.
+/* Implement TARGET_PRINT_OPERAND_PUNCT_VALID_P. */
+
+static bool
+sparc_print_operand_punct_valid_p (unsigned char code)
+{
+ if(code == '#'
+ || code == '*'
+ || code == '('
+ || code == ')'
+ || code == '_'
+ || code == '&')
+ return true;
+
+ return false;
+}
+
+/* Implement TARGET_PRINT_OPERAND.
+ Print operand X (an rtx) in assembler syntax to file FILE.
CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
For `%' followed by punctuation, CODE is the punctuation and X is null. */
-void
-print_operand (FILE *file, rtx x, int code)
+static void
+sparc_print_operand (FILE *file, rtx x, int code)
{
switch (code)
{
@@ -7609,7 +7636,7 @@
}
else if (GET_CODE (x) == LO_SUM)
{
- print_operand (file, XEXP (x, 0), 0);
+ sparc_print_operand (file, XEXP (x, 0), 0);
if (TARGET_CM_MEDMID)
fputs ("+%l44(", file);
else
@@ -7633,6 +7660,89 @@
output_operand_lossage ("floating point constant not a valid immediate operand");
else { output_addr_const (file, x); }
}
+
+/* Implement TARGET_PRINT_OPERAND_ADDRESS. */
+
+static void
+sparc_print_operand_address (FILE *file, rtx x)
+{
+ register rtx base, index = 0;
+ int offset = 0;
+ register rtx addr = x;
+
+ if (REG_P (addr))
+ fputs (reg_names[REGNO (addr)], file);
+ else if (GET_CODE (addr) == PLUS)
+ {
+ if (CONST_INT_P (XEXP (addr, 0)))
+ offset = INTVAL (XEXP (addr, 0)), base = XEXP (addr, 1);
+ else if (CONST_INT_P (XEXP (addr, 1)))
+ offset = INTVAL (XEXP (addr, 1)), base = XEXP (addr, 0);
+ else
+ base = XEXP (addr, 0), index = XEXP (addr, 1);
+ if (GET_CODE (base) == LO_SUM)
+ {
+ gcc_assert (USE_AS_OFFSETABLE_LO10
+ && TARGET_ARCH64
+ && ! TARGET_CM_MEDMID);
+ output_operand (XEXP (base, 0), 0);
+ fputs ("+%lo(", file);
+ output_address (XEXP (base, 1));
+ fprintf (file, ")+%d", offset);
+ }
+ else
+ {
+ fputs (reg_names[REGNO (base)], file);
+ if (index == 0)
+ fprintf (file, "%+d", offset);
+ else if (REG_P (index))
+ fprintf (file, "+%s", reg_names[REGNO (index)]);
+ else if (GET_CODE (index) == SYMBOL_REF
+ || GET_CODE (index) == LABEL_REF
+ || GET_CODE (index) == CONST)
+ fputc ('+', file), output_addr_const (file, index);
+ else gcc_unreachable ();
+ }
+ }
+ else if (GET_CODE (addr) == MINUS
+ && GET_CODE (XEXP (addr, 1)) == LABEL_REF)
+ {
+ output_addr_const (file, XEXP (addr, 0));
+ fputs ("-(", file);
+ output_addr_const (file, XEXP (addr, 1));
+ fputs ("-.)", file);
+ }
+ else if (GET_CODE (addr) == LO_SUM)
+ {
+ output_operand (XEXP (addr, 0), 0);
+ if (TARGET_CM_MEDMID)
+ fputs ("+%l44(", file);
+ else
+ fputs ("+%lo(", file);
+ output_address (XEXP (addr, 1));
+ fputc (')', file);
+ }
+ else if (flag_pic
+ && GET_CODE (addr) == CONST
+ && GET_CODE (XEXP (addr, 0)) == MINUS
+ && GET_CODE (XEXP (XEXP (addr, 0), 1)) == CONST
+ && GET_CODE (XEXP (XEXP (XEXP (addr, 0), 1), 0)) == MINUS
+ && XEXP (XEXP (XEXP (XEXP (addr, 0), 1), 0), 1) == pc_rtx)
+ {
+ addr = XEXP (addr, 0);
+ output_addr_const (file, XEXP (addr, 0));
+ /* Group the args of the second CONST in parenthesis. */
+ fputs ("-(", file);
+ /* Skip past the second CONST--it does nothing for us. */
+ output_addr_const (file, XEXP (XEXP (addr, 1), 0));
+ /* Close the parenthesis. */
+ fputc (')', file);
+ }
+ else
+ {
+ output_addr_const (file, addr);
+ }
+}
\f
/* Target hook for assembling integer objects. The sparc version has
special handling for aligned DI-mode objects. */
Index: gcc/config/sparc/sparc.h
===================================================================
--- gcc/config/sparc/sparc.h (revision 172733)
+++ gcc/config/sparc/sparc.h (working copy)
@@ -1922,95 +1922,6 @@
} \
} while (0)
-#define PRINT_OPERAND_PUNCT_VALID_P(CHAR) \
- ((CHAR) == '#' || (CHAR) == '*' || (CHAR) == '(' \
- || (CHAR) == ')' || (CHAR) == '_' || (CHAR) == '&')
-
-/* Print operand X (an rtx) in assembler syntax to file FILE.
- CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
- For `%' followed by punctuation, CODE is the punctuation and X is null. */
-
-#define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)
-
-/* Print a memory address as an operand to reference that memory location. */
-
-#define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
-{ register rtx base, index = 0; \
- int offset = 0; \
- register rtx addr = ADDR; \
- if (GET_CODE (addr) == REG) \
- fputs (reg_names[REGNO (addr)], FILE); \
- else if (GET_CODE (addr) == PLUS) \
- { \
- if (GET_CODE (XEXP (addr, 0)) == CONST_INT) \
- offset = INTVAL (XEXP (addr, 0)), base = XEXP (addr, 1);\
- else if (GET_CODE (XEXP (addr, 1)) == CONST_INT) \
- offset = INTVAL (XEXP (addr, 1)), base = XEXP (addr, 0);\
- else \
- base = XEXP (addr, 0), index = XEXP (addr, 1); \
- if (GET_CODE (base) == LO_SUM) \
- { \
- gcc_assert (USE_AS_OFFSETABLE_LO10 \
- && TARGET_ARCH64 \
- && ! TARGET_CM_MEDMID); \
- output_operand (XEXP (base, 0), 0); \
- fputs ("+%lo(", FILE); \
- output_address (XEXP (base, 1)); \
- fprintf (FILE, ")+%d", offset); \
- } \
- else \
- { \
- fputs (reg_names[REGNO (base)], FILE); \
- if (index == 0) \
- fprintf (FILE, "%+d", offset); \
- else if (GET_CODE (index) == REG) \
- fprintf (FILE, "+%s", reg_names[REGNO (index)]); \
- else if (GET_CODE (index) == SYMBOL_REF \
- || GET_CODE (index) == LABEL_REF \
- || GET_CODE (index) == CONST) \
- fputc ('+', FILE), output_addr_const (FILE, index); \
- else gcc_unreachable (); \
- } \
- } \
- else if (GET_CODE (addr) == MINUS \
- && GET_CODE (XEXP (addr, 1)) == LABEL_REF) \
- { \
- output_addr_const (FILE, XEXP (addr, 0)); \
- fputs ("-(", FILE); \
- output_addr_const (FILE, XEXP (addr, 1)); \
- fputs ("-.)", FILE); \
- } \
- else if (GET_CODE (addr) == LO_SUM) \
- { \
- output_operand (XEXP (addr, 0), 0); \
- if (TARGET_CM_MEDMID) \
- fputs ("+%l44(", FILE); \
- else \
- fputs ("+%lo(", FILE); \
- output_address (XEXP (addr, 1)); \
- fputc (')', FILE); \
- } \
- else if (flag_pic && GET_CODE (addr) == CONST \
- && GET_CODE (XEXP (addr, 0)) == MINUS \
- && GET_CODE (XEXP (XEXP (addr, 0), 1)) == CONST \
- && GET_CODE (XEXP (XEXP (XEXP (addr, 0), 1), 0)) == MINUS \
- && XEXP (XEXP (XEXP (XEXP (addr, 0), 1), 0), 1) == pc_rtx) \
- { \
- addr = XEXP (addr, 0); \
- output_addr_const (FILE, XEXP (addr, 0)); \
- /* Group the args of the second CONST in parenthesis. */ \
- fputs ("-(", FILE); \
- /* Skip past the second CONST--it does nothing for us. */\
- output_addr_const (FILE, XEXP (XEXP (addr, 1), 0)); \
- /* Close the parenthesis. */ \
- fputc (')', FILE); \
- } \
- else \
- { \
- output_addr_const (FILE, addr); \
- } \
-}
-
/* TLS support defaulting to original Sun flavor. GNU extensions
must be activated in separate configuration files. */
#ifdef HAVE_AS_TLS
Anatoly.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P
2011-04-27 18:43 [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P Anatoly Sokolov
@ 2011-04-28 16:18 ` Richard Henderson
2011-05-03 19:07 ` Rainer Orth
0 siblings, 1 reply; 14+ messages in thread
From: Richard Henderson @ 2011-04-28 16:18 UTC (permalink / raw)
To: Anatoly Sokolov; +Cc: gcc-patches, ebotcazou
On 04/27/2011 11:13 AM, Anatoly Sokolov wrote:
> * config/sparc/sparc.h (PRINT_OPERAND, PRINT_OPERAND_ADDRESS,
> PRINT_OPERAND_PUNCT_VALID_P): Remove.
> * config/sparc/sparc-protos.h (print_operand): Remove declaration.
> * config/sparc/sparc.c (TARGET_PRINT_OPERAND_PUNCT_VALID_P,
> TARGET_PRINT_OPERAND, TARGET_PRINT_OPERAND_ADDRESS): Define.
> (print_operand): Rename to...
> (sparc_print_operand): ...this. Make static. Adjust
> sparc_print_operand function call.
> (sparc_print_operand_punct_valid_p, sparc_print_operand_address): New
> functions.
Ok, except,
> + if(code == '#'
Space before (, re-indenting the rest of the condition to match.
r~
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P
2011-04-28 16:18 ` Richard Henderson
@ 2011-05-03 19:07 ` Rainer Orth
2011-05-03 19:18 ` Joseph S. Myers
2011-05-04 17:44 ` Re[2]: [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P Anatoly Sokolov
0 siblings, 2 replies; 14+ messages in thread
From: Rainer Orth @ 2011-05-03 19:07 UTC (permalink / raw)
To: Richard Henderson; +Cc: Anatoly Sokolov, gcc-patches, ebotcazou
Richard Henderson <rth@redhat.com> writes:
> On 04/27/2011 11:13 AM, Anatoly Sokolov wrote:
>> * config/sparc/sparc.h (PRINT_OPERAND, PRINT_OPERAND_ADDRESS,
>> PRINT_OPERAND_PUNCT_VALID_P): Remove.
>> * config/sparc/sparc-protos.h (print_operand): Remove declaration.
>> * config/sparc/sparc.c (TARGET_PRINT_OPERAND_PUNCT_VALID_P,
>> TARGET_PRINT_OPERAND, TARGET_PRINT_OPERAND_ADDRESS): Define.
>> (print_operand): Rename to...
>> (sparc_print_operand): ...this. Make static. Adjust
>> sparc_print_operand function call.
>> (sparc_print_operand_punct_valid_p, sparc_print_operand_address): New
>> functions.
>
> Ok, except,
>
>> + if(code == '#'
>
> Space before (, re-indenting the rest of the condition to match.
This patch broke Solaris 2/SPARC bootstrap which still uses
print_operand in sparc/sol2.h (ASM_OUTPUT_CALL). A bootstrap with the
obvious fix is currently running.
What is so hard about running grep when removing/renaming symbols???
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P
2011-05-03 19:07 ` Rainer Orth
@ 2011-05-03 19:18 ` Joseph S. Myers
2011-05-04 11:54 ` Rainer Orth
2011-05-04 17:44 ` Re[2]: [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P Anatoly Sokolov
1 sibling, 1 reply; 14+ messages in thread
From: Joseph S. Myers @ 2011-05-03 19:18 UTC (permalink / raw)
To: Rainer Orth; +Cc: Richard Henderson, Anatoly Sokolov, gcc-patches, ebotcazou
On Tue, 3 May 2011, Rainer Orth wrote:
> This patch broke Solaris 2/SPARC bootstrap which still uses
> print_operand in sparc/sol2.h (ASM_OUTPUT_CALL). A bootstrap with the
> obvious fix is currently running.
>
> What is so hard about running grep when removing/renaming symbols???
Generically, the presence of lots of nonobvious places that may turn out
to use a symbol - ada/gcc-interface/, go/gofrontend, config/ for what one
thinks of as front-end symbols, libgcc/ and other places outside of gcc/
(being outside gcc/ is probably how the remaining use of ROUND_TYPE_SIZE
in libobjc was missed when that macro was removed from GCC in 2003), C
symbols used directly in Ada source code, .... The ongoing work on
narrowing interfaces (so that it's well-defined whether particular headers
are used for the host or the target, tm.h isn't included in so many
places, etc.) may help - though another thing to watch out for there is
random declarations in .c files or inappropriate headers that mean that
something uses a symbol from some part of the compiler despite not
including the normal header that declares it (I found plenty of such cases
when making options variables into macros). Help in cleaning up
interfaces is always welcome - there's a lot to do
(<http://gcc.gnu.org/wiki/Top-Level_Libgcc_Migration> has notes dealing
with the very narrow area of target macros in code built for the target).
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P
2011-05-03 19:18 ` Joseph S. Myers
@ 2011-05-04 11:54 ` Rainer Orth
2011-05-04 12:02 ` Joseph S. Myers
0 siblings, 1 reply; 14+ messages in thread
From: Rainer Orth @ 2011-05-04 11:54 UTC (permalink / raw)
To: Joseph S. Myers
Cc: Richard Henderson, Anatoly Sokolov, gcc-patches, ebotcazou
"Joseph S. Myers" <joseph@codesourcery.com> writes:
>> What is so hard about running grep when removing/renaming symbols???
>
> Generically, the presence of lots of nonobvious places that may turn out
> to use a symbol - ada/gcc-interface/, go/gofrontend, config/ for what one
> thinks of as front-end symbols, libgcc/ and other places outside of gcc/
> (being outside gcc/ is probably how the remaining use of ROUND_TYPE_SIZE
> in libobjc was missed when that macro was removed from GCC in 2003), C
> symbols used directly in Ada source code, .... The ongoing work on
> narrowing interfaces (so that it's well-defined whether particular headers
> are used for the host or the target, tm.h isn't included in so many
> places, etc.) may help - though another thing to watch out for there is
> random declarations in .c files or inappropriate headers that mean that
> something uses a symbol from some part of the compiler despite not
> including the normal header that declares it (I found plenty of such cases
> when making options variables into macros). Help in cleaning up
> interfaces is always welcome - there's a lot to do
> (<http://gcc.gnu.org/wiki/Top-Level_Libgcc_Migration> has notes dealing
> with the very narrow area of target macros in code built for the target).
certainly true in general, although grep -r over the whole tree isn't
too hard to use either ;-) But in the case at hand,
$ grep print_operand *
in gcc/config/sparc would have turned up the problem at once, that's why
I'm complaining.
Your expansion of the wiki page on toplevel libgcc migration is
certainly welcome: I hadn't seen before that *-unwind.h files and
related macros can be moved over as well.
Thanks.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P
2011-05-04 11:54 ` Rainer Orth
@ 2011-05-04 12:02 ` Joseph S. Myers
2011-05-26 11:49 ` Completing toplevel libgcc move (Was: Re: [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P) Rainer Orth
0 siblings, 1 reply; 14+ messages in thread
From: Joseph S. Myers @ 2011-05-04 12:02 UTC (permalink / raw)
To: Rainer Orth; +Cc: Richard Henderson, Anatoly Sokolov, gcc-patches, ebotcazou
On Wed, 4 May 2011, Rainer Orth wrote:
> Your expansion of the wiki page on toplevel libgcc migration is
> certainly welcome: I hadn't seen before that *-unwind.h files and
> related macros can be moved over as well.
I've no idea whether they can be moved *at present*, but certainly the
eventual aim should be to move them.
Before more macros are moved to files in libgcc/config I'd really rather
the libgcc headers go in a separate libgcc_tm_file or similar, not
included on the host and with the moved macros poisoned in the host
system.h, to avoid the situation listed on that page of "RENAME_LIBRARY
(in gcc/config/arm/symbian.h, otherwise moved to libgcc headers)" where a
macro is only partly migrated to the libgcc headers but this partial state
isn't obvious. This has the advantage of avoiding the
../../libgcc/config/ kludge in tm_file as well.
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* Completing toplevel libgcc move (Was: Re: [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P)
2011-05-04 12:02 ` Joseph S. Myers
@ 2011-05-26 11:49 ` Rainer Orth
2011-05-26 13:24 ` Joseph S. Myers
0 siblings, 1 reply; 14+ messages in thread
From: Rainer Orth @ 2011-05-26 11:49 UTC (permalink / raw)
To: Joseph S. Myers
Cc: Richard Henderson, Anatoly Sokolov, gcc-patches, ebotcazou
"Joseph S. Myers" <joseph@codesourcery.com> writes:
> On Wed, 4 May 2011, Rainer Orth wrote:
>
>> Your expansion of the wiki page on toplevel libgcc migration is
>> certainly welcome: I hadn't seen before that *-unwind.h files and
>> related macros can be moved over as well.
>
> I've no idea whether they can be moved *at present*, but certainly the
> eventual aim should be to move them.
>
> Before more macros are moved to files in libgcc/config I'd really rather
> the libgcc headers go in a separate libgcc_tm_file or similar, not
> included on the host and with the moved macros poisoned in the host
> system.h, to avoid the situation listed on that page of "RENAME_LIBRARY
> (in gcc/config/arm/symbian.h, otherwise moved to libgcc headers)" where a
> macro is only partly migrated to the libgcc headers but this partial state
> isn't obvious. This has the advantage of avoiding the
> ../../libgcc/config/ kludge in tm_file as well.
But doesn't this mean that e.g. MD_UNWIND_SUPPORT can only be moved to
libgcc/config for all targets together? How can you poison the macro
when a single target using it is left behind in gcc/config?
To actually test such a move, one had to setup complete
cross-environments for every affected target, which is way beyond what I
have the time and inclination to do. This would mean that even targets
where the toplevel libgcc move could be completed and the maintainers
are motivated to do so are stalled until all other related ones are
done. Doesn't seem highly desirable to me.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Completing toplevel libgcc move (Was: Re: [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P)
2011-05-26 11:49 ` Completing toplevel libgcc move (Was: Re: [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P) Rainer Orth
@ 2011-05-26 13:24 ` Joseph S. Myers
2011-05-26 13:31 ` Completing toplevel libgcc move Rainer Orth
0 siblings, 1 reply; 14+ messages in thread
From: Joseph S. Myers @ 2011-05-26 13:24 UTC (permalink / raw)
To: Rainer Orth; +Cc: Richard Henderson, Anatoly Sokolov, gcc-patches, ebotcazou
On Thu, 26 May 2011, Rainer Orth wrote:
> But doesn't this mean that e.g. MD_UNWIND_SUPPORT can only be moved to
> libgcc/config for all targets together? How can you poison the macro
> when a single target using it is left behind in gcc/config?
Nothing about the libgcc_tm.h implementation stops you moving a macro
(that is not, in fact, used on the host) for only some targets if you
don't poison it. But I do think moving it for all targets together, and
poisoning it, is much better.
> To actually test such a move, one had to setup complete
> cross-environments for every affected target, which is way beyond what I
> have the time and inclination to do. This would mean that even targets
> where the toplevel libgcc move could be completed and the maintainers
> are motivated to do so are stalled until all other related ones are
> done. Doesn't seem highly desirable to me.
Well, no, you post the patch (I'd guess all thirty or so target-only
macros could be moved in a few hours, but moving them in smaller groups
might be easier), test on the targets you can readily test on (building
just cc1 and xgcc for the others), invite target maintainers (CC:ed) to
test for other targets and seek approval to commit in maybe a week in the
absence of problem reports from target maintainers.
I think completing the move for a particular macro is more meaningful, and
has a better way to ensure the move doesn't regress, than completing it
for a particular target.
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Completing toplevel libgcc move
2011-05-26 13:24 ` Joseph S. Myers
@ 2011-05-26 13:31 ` Rainer Orth
0 siblings, 0 replies; 14+ messages in thread
From: Rainer Orth @ 2011-05-26 13:31 UTC (permalink / raw)
To: Joseph S. Myers; +Cc: Richard Henderson, gcc-patches
"Joseph S. Myers" <joseph@codesourcery.com> writes:
> On Thu, 26 May 2011, Rainer Orth wrote:
>
>> But doesn't this mean that e.g. MD_UNWIND_SUPPORT can only be moved to
>> libgcc/config for all targets together? How can you poison the macro
>> when a single target using it is left behind in gcc/config?
>
> Nothing about the libgcc_tm.h implementation stops you moving a macro
> (that is not, in fact, used on the host) for only some targets if you
> don't poison it. But I do think moving it for all targets together, and
> poisoning it, is much better.
Ok, I see. It sounded to me as you wanted to somehow
discourage/prohibit those partial moves by policy. Clearly achieving
some consistency here is a laudable goal and far better than having just
another incomplete transition that lingers forever.
>> To actually test such a move, one had to setup complete
>> cross-environments for every affected target, which is way beyond what I
>> have the time and inclination to do. This would mean that even targets
>> where the toplevel libgcc move could be completed and the maintainers
>> are motivated to do so are stalled until all other related ones are
>> done. Doesn't seem highly desirable to me.
>
> Well, no, you post the patch (I'd guess all thirty or so target-only
> macros could be moved in a few hours, but moving them in smaller groups
> might be easier), test on the targets you can readily test on (building
> just cc1 and xgcc for the others), invite target maintainers (CC:ed) to
> test for other targets and seek approval to commit in maybe a week in the
> absence of problem reports from target maintainers.
Ok, that sounds doable. AFAICS, the only ones of interest to my targets
are MD_UNWIND_SUPPORT and ENABLE_EXECUTE_STACK. I'll probably do those
separately once the basic toplevel libgcc moves for Solaris, Tru64 UNIX
and IRIX are in.
Right now, I'm close for Solaris, but just noticed that
sparc/sol2-c[in].asm are used by sparc*-elf and sparc*-rtems, too, so
I'll have to deal with them as well before sparc*-*-solaris2* can be done.
The other two are pratically done, but rely on the Solaris move to go in
first.
> I think completing the move for a particular macro is more meaningful, and
> has a better way to ensure the move doesn't regress, than completing it
> for a particular target.
On the other hand, doing it per target has the advantage that you can
easily test the whole beast once, detect may cleanup opportunities, and
be done with it, rather than redoing the stuff on a per-macro basis.
But my targets above indicate that the number of macros per target may
actually be quite small.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re[2]: [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P
2011-05-03 19:07 ` Rainer Orth
2011-05-03 19:18 ` Joseph S. Myers
@ 2011-05-04 17:44 ` Anatoly Sokolov
2011-05-04 17:44 ` Rainer Orth
1 sibling, 1 reply; 14+ messages in thread
From: Anatoly Sokolov @ 2011-05-04 17:44 UTC (permalink / raw)
To: Rainer Orth; +Cc: Richard Henderson, gcc-patches, ebotcazou
Hi.
> Richard Henderson <rth@redhat.com> writes:
>> On 04/27/2011 11:13 AM, Anatoly Sokolov wrote:
>>> * config/sparc/sparc.h (PRINT_OPERAND, PRINT_OPERAND_ADDRESS,
>>> PRINT_OPERAND_PUNCT_VALID_P): Remove.
>>> * config/sparc/sparc-protos.h (print_operand): Remove declaration.
>>> * config/sparc/sparc.c (TARGET_PRINT_OPERAND_PUNCT_VALID_P,
>>> TARGET_PRINT_OPERAND, TARGET_PRINT_OPERAND_ADDRESS): Define.
>>> (print_operand): Rename to...
>>> (sparc_print_operand): ...this. Make static. Adjust
>>> sparc_print_operand function call.
>>> (sparc_print_operand_punct_valid_p, sparc_print_operand_address): New
>>> functions.
> This patch broke Solaris 2/SPARC bootstrap which still uses
> print_operand in sparc/sol2.h (ASM_OUTPUT_CALL). A bootstrap with the
> obvious fix is currently running.
> What is so hard about running grep when removing/renaming symbols???
Sorry for my mistake. I think that the patch is obvious, but I have no
capability to test it.
* config/sparc/sol.h (ASM_OUTPUT_CALL): Use print_operand target
hook.
Index: gcc/config/sparc/sol2.h
===================================================================
--- gcc/config/sparc/sol2.h (revision 173212)
+++ gcc/config/sparc/sol2.h (working copy)
@@ -172,7 +172,7 @@
do \
{ \
fprintf (FILE, "\tcall\t"); \
- print_operand (FILE, XEXP (DECL_RTL (FN), 0), 0); \
+ targetm.asm_out.print_operand (FILE, XEXP (DECL_RTL (FN), 0), 0); \
fprintf (FILE, "\n\tnop\n"); \
} \
while (0)
Anatoly.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P
2011-05-04 17:44 ` Re[2]: [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P Anatoly Sokolov
@ 2011-05-04 17:44 ` Rainer Orth
2011-05-05 9:15 ` Rainer Orth
0 siblings, 1 reply; 14+ messages in thread
From: Rainer Orth @ 2011-05-04 17:44 UTC (permalink / raw)
To: Anatoly Sokolov; +Cc: Richard Henderson, gcc-patches, ebotcazou
Hi Anatoly,
> Sorry for my mistake. I think that the patch is obvious, but I have no
> capability to test it.
>
>
> * config/sparc/sol.h (ASM_OUTPUT_CALL): Use print_operand target
> hook.
>
>
> Index: gcc/config/sparc/sol2.h
> ===================================================================
> --- gcc/config/sparc/sol2.h (revision 173212)
> +++ gcc/config/sparc/sol2.h (working copy)
> @@ -172,7 +172,7 @@
> do \
> { \
> fprintf (FILE, "\tcall\t"); \
> - print_operand (FILE, XEXP (DECL_RTL (FN), 0), 0); \
> + targetm.asm_out.print_operand (FILE, XEXP (DECL_RTL (FN), 0), 0); \
> fprintf (FILE, "\n\tnop\n"); \
> } \
> while (0)
I thought so, too, but you also need to include target.h in
config/sol2.c. I'm currently testing such a patch; will commit tomorrow
if bootstrap passes.
You could at least test it by cross-building cc1 for
sparc-sun-solaris2.10, which failed to link.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P
2011-05-04 17:44 ` Rainer Orth
@ 2011-05-05 9:15 ` Rainer Orth
2011-05-13 7:02 ` Re[2]: " Anatoly Sokolov
0 siblings, 1 reply; 14+ messages in thread
From: Rainer Orth @ 2011-05-05 9:15 UTC (permalink / raw)
To: Anatoly Sokolov; +Cc: Richard Henderson, gcc-patches, ebotcazou
Hi Anatoly,
>
> I thought so, too, but you also need to include target.h in
> config/sol2.c. I'm currently testing such a patch; will commit tomorrow
> if bootstrap passes.
this is the patch I've checked in after it passed sparc-sun-solaris2.11
andi i386-pc-solaris2.11 bootstrap.
Rainer
2011-05-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* config/sparc/sol2.h (ASM_OUTPUT_CALL): Use
targetm.asm_out.print_operand.
* config/sol2.c: Include target.h.
diff --git a/gcc/config/sol2.c b/gcc/config/sol2.c
--- a/gcc/config/sol2.c
+++ b/gcc/config/sol2.c
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.
#include "output.h"
#include "tm.h"
#include "rtl.h"
+#include "target.h"
#include "tm_p.h"
#include "diagnostic-core.h"
#include "ggc.h"
diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h
--- a/gcc/config/sparc/sol2.h
+++ b/gcc/config/sparc/sol2.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GCC, for SPARC running Solaris 2
Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005,
- 2006, 2007, 2008, 2010 Free Software Foundation, Inc.
+ 2006, 2007, 2008, 2010, 2011 Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@netcom.com).
Additional changes by David V. Henkel-Wallace (gumby@cygnus.com).
@@ -172,7 +172,7 @@ along with GCC; see the file COPYING3.
do \
{ \
fprintf (FILE, "\tcall\t"); \
- print_operand (FILE, XEXP (DECL_RTL (FN), 0), 0); \
+ targetm.asm_out.print_operand (FILE, XEXP (DECL_RTL (FN), 0), 0); \
fprintf (FILE, "\n\tnop\n"); \
} \
while (0)
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re[2]: [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P
2011-05-05 9:15 ` Rainer Orth
@ 2011-05-13 7:02 ` Anatoly Sokolov
2011-05-19 13:00 ` Rainer Orth
0 siblings, 1 reply; 14+ messages in thread
From: Anatoly Sokolov @ 2011-05-13 7:02 UTC (permalink / raw)
To: Rainer Orth; +Cc: Richard Henderson, gcc-patches, ebotcazou
Hello, Rainer.
> this is the patch I've checked in after it passed sparc-sun-solaris2.11
> andi i386-pc-solaris2.11 bootstrap.
> Rainer
> 2011-05-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
> * config/sparc/sol2.h (ASM_OUTPUT_CALL): Use
> targetm.asm_out.print_operand.
> * config/sol2.c: Include target.h.
This patch adds a missing dependency to config/t-sol2.
Patch is untested.
OK to install?
* (sol2.o): Add dependency to $(TARGET_H).
Index: gcc/config/t-sol2
===================================================================
--- gcc/config/t-sol2 (revision 173714)
+++ gcc/config/t-sol2 (working copy)
@@ -25,7 +25,7 @@
# Solaris-specific attributes
sol2.o: $(srcdir)/config/sol2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- tree.h output.h $(TM_H) $(TM_P_H) $(GGC_H)
+ tree.h output.h $(TARGET_H) $(TM_H) $(TM_P_H) $(GGC_H)
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(srcdir)/config/sol2.c
Anatoly.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P
2011-05-13 7:02 ` Re[2]: " Anatoly Sokolov
@ 2011-05-19 13:00 ` Rainer Orth
0 siblings, 0 replies; 14+ messages in thread
From: Rainer Orth @ 2011-05-19 13:00 UTC (permalink / raw)
To: Anatoly Sokolov; +Cc: Richard Henderson, gcc-patches, ebotcazou
Hi Anatoly,
>> 2011-05-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
>
>> * config/sparc/sol2.h (ASM_OUTPUT_CALL): Use
>> targetm.asm_out.print_operand.
>> * config/sol2.c: Include target.h.
>
> This patch adds a missing dependency to config/t-sol2.
>
> Patch is untested.
>
> OK to install?
I've installed a minimally different patch, with the dependency list
sorted to match the include order in sol2.c.
Bootstrapped on i386-pc-solaris2.11 and sparc-sun-solaris2.11 without
regressions.
Thanks for the patch.
Rainer
2011-05-19 Anatoly Sokolov <aesok@post.ru>
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* config/t-sol2 (sol2.o): Add $(TARGET_H) dependency.
diff --git a/gcc/config/t-sol2 b/gcc/config/t-sol2
--- a/gcc/config/t-sol2
+++ b/gcc/config/t-sol2
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2008, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -25,7 +25,7 @@ sol2-c.o: $(srcdir)/config/sol2-c.c $(CO
# Solaris-specific attributes
sol2.o: $(srcdir)/config/sol2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- tree.h output.h $(TM_H) $(TM_P_H) $(GGC_H)
+ tree.h output.h $(TM_H) $(TARGET_H) $(TM_P_H) $(GGC_H)
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(srcdir)/config/sol2.c
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2011-05-26 12:31 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-27 18:43 [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P Anatoly Sokolov
2011-04-28 16:18 ` Richard Henderson
2011-05-03 19:07 ` Rainer Orth
2011-05-03 19:18 ` Joseph S. Myers
2011-05-04 11:54 ` Rainer Orth
2011-05-04 12:02 ` Joseph S. Myers
2011-05-26 11:49 ` Completing toplevel libgcc move (Was: Re: [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P) Rainer Orth
2011-05-26 13:24 ` Joseph S. Myers
2011-05-26 13:31 ` Completing toplevel libgcc move Rainer Orth
2011-05-04 17:44 ` Re[2]: [SPARC] Hookize PRINT_OPERAND, PRINT_OPERAND_ADDRESS and PRINT_OPERAND_PUNCT_VALID_P Anatoly Sokolov
2011-05-04 17:44 ` Rainer Orth
2011-05-05 9:15 ` Rainer Orth
2011-05-13 7:02 ` Re[2]: " Anatoly Sokolov
2011-05-19 13:00 ` Rainer Orth
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).