Attached is a patch that fixes bug 675 (line numbers of inlined routines
is broken by IPA).

The fix is basically described in a comment attached to the bug (which I have
cleaned up a bit):

    Currently line number information in WHIRL statements for code being 
inlined is
    being replaced with the line number information associated with the call 
(see
    note * below).

    The fix is to have IPA generate a global file table along with maps for each
    input WHIRL file that maps an index into the input file table to an index 
into
    the global file table.

    Then during processing done IP_READ_fix_tree the file index field in the
    SRCPOS record in each WHIRL statement node can be changed to the index
    associated with global file table using the per WHIRL input object file map.

    In output_queue::flush() the current state of the global file table is
    written to the current .I file.  Note that the processing to do this is done
    by a newly added routine copy_DST_Type().  Also the routine
    merge_directories_and_files(), which AFAICS has always generated bogus file
    tables, is no longer called and has been removed.

* Note that code IPO_INLINE::Process_Op_Code was added with the PSC 1.3 merge, 
it
was a work around to prevent assembly errors when out-of-ranges file indices
were detected in .loc assembly directives (if you take out this work around
in the current compiler the IPA compile of SPEC xalancbmk will likely fail).

This work was done by an engineer at AMD who is no longer working on the
project, so I am taking over the maintenance of the change.

Two minor issues I would like to attend to:

1) Make the array indices all start at 1 to eliminate the need of adding
or subtracting 1 when values are inserted from one table to another.

2) Maps should be used to detect whether strings in the local file/directory
tables already exists in the global table (this is currently done via
a linear search).

Though I think these are minor issues that can be attended to later.  We have
been running with this code since late last year and it really a worthwhile
change to incorporate, since the current implementation produces useless line
number information in most situations when compiling with IPA.  If you are
analyzing the performance of IPA compiled code, this change is really
worthwhile.

Note that I attached files to the bug report for testing this change, using
the gdb test suite harness.

One final note, even though with this change correct line/file table
information is being generated, on older Linux systems the `info line'
command in GDB may not be able to determine source location associated with
a text address (this works on newer systems).

For more information on this problem see:

https://bugs.open64.net/show_bug.cgi?id=781

Could a gatekeeper review this change when they have the chance?

Thanks,

Doug

Attachment: bug675_1.patch
Description: bug675_1.patch

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to