This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH/RFC/RFA] Machine modes for address printing (all targets)
- From: Bernd Schmidt <bschmidt at redhat dot com>
- To: Julian Brown <julian at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 5 Nov 2015 11:22:04 +0100
- Subject: Re: [PATCH/RFC/RFA] Machine modes for address printing (all targets)
- Authentication-results: sourceware.org; auth=none
- References: <20151104125418 dot 5b15143a at octopus>
On 11/04/2015 01:54 PM, Julian Brown wrote:
That's not all targets by any means, but may be enough to warrant a
change in the interface. I propose that:
* The output_address function should have a machine_mode argument
added. Bare addresses (e.g. the 'a' case in final.c) should pass
"VOIDmode" for this argument.
* Other callers of output_address -- actually all in backends -- can
pass the machine mode for the memory access in question.
* The TARGET_PRINT_OPERAND_ADDRESS hook shall also have a machine_mode
argument added. The legacy PRINT_OPERAND_ADDRESS hook can be left
alone. (The documentation for the operand-printing hooks needs fixing
too, incidentally.)
I think this approach seems fine.
static void
-mcore_print_operand_address (FILE * stream, rtx x)
+mcore_print_operand_address (FILE * stream, machine_mode mode ATTRIBUTE_UNUSED,
+ rtx x)
So apparently we're settling on writing the unused arg as just
"machine_mode" without a name. Please change everywhere.
@@ -1754,7 +1754,7 @@ mmix_print_operand_punct_valid_p (unsign
/* TARGET_PRINT_OPERAND_ADDRESS. */
static void
-mmix_print_operand_address (FILE *stream, rtx x)
+mmix_print_operand_address (FILE *stream, machine_mode mode, rtx x)
{
if (REG_P (x))
{
The arg appears to be unused - I'd expect to see a warning here.
Other thank that it looks OK. I'm not going to require that you test
every target, but it would be good to have the full set built to cc1
before and after, and please be on the lookout for fallout.
Bernd