Bug 50566 - [avr]: Add support for better logging similar to -mdeb
Summary: [avr]: Add support for better logging similar to -mdeb
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.7.0
: P5 enhancement
Target Milestone: 4.7.0
Assignee: Georg-Johann Lay
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-29 10:56 UTC by Georg-Johann Lay
Modified: 2011-11-25 10:46 UTC (History)
1 user (show)

See Also:
Host:
Target: avr
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-09-29 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Georg-Johann Lay 2011-09-29 10:56:24 UTC
-mdeb lets avr-gcc print log information as a file is being compiled but it's hard to depict from the information

- what function is just being compiled
- what pass gcc is in
- ...

Forover, it would be nice to have a printf-like function to print formatted output together with trees, RTXes, register classes, rtx codes, etc.
Comment 1 Georg-Johann Lay 2011-09-29 11:52:04 UTC
Author: gjl
Date: Thu Sep 29 11:51:59 2011
New Revision: 179344

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179344
Log:
	PR target/50566
	* config.gcc (extra_objs): Add avr-log.o for $target in:
	avr-*-rtems*, avr-*-*.
	* config/avr/t-avr (avr-log.o): New rule to compile...
	* config/avr/avr-log.c: ...this new file.
	* config/avr/avr.opt (mlog=): New option.
	* config/avr/avr-protos.h (avr_edump, avr_fdump): New macros.
	(avr_log_set_caller_e, avr_log_set_caller_f): New prototypes.
	(avr_log_set_avr_log): New prototype.
	(avr_log_t): New typedef.
	(avr_log): New declaration.
	* config/avr/avr.c (avr_option_override): Call avr_log_set_avr_log.


Added:
    trunk/gcc/config/avr/avr-log.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config.gcc
    trunk/gcc/config/avr/avr-protos.h
    trunk/gcc/config/avr/avr.c
    trunk/gcc/config/avr/avr.opt
    trunk/gcc/config/avr/t-avr
Comment 2 Georg-Johann Lay 2011-09-29 16:25:09 UTC
Author: gjl
Date: Thu Sep 29 16:24:57 2011
New Revision: 179359

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179359
Log:
	PR target/50566
	* config/avr/avr-log.c (avr_log_vadump): Use %b to print bool.
	* config/avr/avr.c (avr_rtx_costs_1): New static function, renamed
	from avr_rtx_costs.
	(avr_legitimate_address_p): Use avr_edump to print log information
	filtered by avr_log.
	(extra_constraint_Q): Ditto.
	(avr_legitimize_address): Ditto.
	(avr_rtx_costs): Ditto.  Rewrite as wrapper for avr_rtx_costs_1.
	(final_prescan_insn): Use avr_log.rtx_costs as filter.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/avr/avr-log.c
    trunk/gcc/config/avr/avr.c
Comment 3 Georg-Johann Lay 2011-09-29 16:29:04 UTC
Done.
Comment 4 Georg-Johann Lay 2011-09-30 15:15:32 UTC
Author: gjl
Date: Fri Sep 30 15:15:23 2011
New Revision: 179391

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179391
Log:
	PR target/50566
	* config/avr/avr-protos.h (avr_log_t): New field address_cost.
	* config/avr/avr.c (avr_address_cost): Use it.
	* config/avr/avr-log.c (avr_log_set_avr_log): Initialize it.
	(avr_log_vadump): Unknown %-codes finish printing.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/avr/avr-log.c
    trunk/gcc/config/avr/avr-protos.h
    trunk/gcc/config/avr/avr.c
Comment 5 Georg-Johann Lay 2011-10-04 08:23:08 UTC
Author: gjl
Date: Tue Oct  4 08:23:03 2011
New Revision: 179494

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179494
Log:
	PR target/50566
	* config/avr/avr-protos.h (avr_legitimize_reload_address): New
	prototype.
	* config/avr/avr.h (LEGITIMIZE_RELOAD_ADDRESS): Copy worker code
	from here...
	* config/avr/avr.c (avr_legitimize_reload_address) ...to this new
	function.  Log if avr_log.legitimize_reload_address.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/avr/avr-protos.h
    trunk/gcc/config/avr/avr.c
    trunk/gcc/config/avr/avr.h
Comment 6 Georg-Johann Lay 2011-11-25 10:46:15 UTC
Author: gjl
Date: Fri Nov 25 10:46:10 2011
New Revision: 181718

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181718
Log:
	PR target/50566
	* config/avr/avr-protos.h (avr_log_t): Add field .builtin.
	* config/avr/avr-log.c (avr_log_set_avr_log): Initialize it.
	Don't bypass TARGET_ALL_DEBUG.  Print self-info with ?.
	(avr_log_vadump): Support %D and %X to print double_int.
	(avr_double_int_pop_digit): New static function.
	(avr_dump_double_int_hex): New static function.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/avr/avr-log.c
    trunk/gcc/config/avr/avr-protos.h