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]

Re: Simple rtl printing


Richard Henderson writes:

 > Don't you really want to do some of this directly in print_simple_rtl?
 > Seems like not only will (const_int 123) be rendered as "123", but
 > (plus (reg 123) (const_int 456)) will be rendered as "(plus (reg 123) 456)".
 > 
 > Or maybe you meant that...

Well I'm in two minds and tried out both ways before I sent the patch.
Originally I special cased CONST_INT and REG so that

(const_int 123) printed as 123
(reg:SI 45)     printed as reg 45

and then fell back to print_rtl for anything else.  However,
when looking at big lists of GIVs,  I thought it was better to 
avoid all the clutter, so that (plus:SI (reg:SI 45) (const_int 123))
prints as

(plus (reg 45)
  (123))

instead of

(plus:SI (reg:SI 45)
  (const_int 123 [7b])).

I ummed and ahhed about whether to print the brackets as well for the
const_int and reg cases but decided for consistency that it was a good
idea.

My current feeling is that I'd like to avoid the newlines when printing
a simplified rtx, so that (plus:SI (reg:SI 45) (const_int 123)) prints
as

(plus (reg 45) (123))

Does anyone have strong feelings about this or should I commit my
patch and we can tweak this later?

Michael.


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