Bug 31778 - genattrtab.c doesn't record filename
Summary: genattrtab.c doesn't record filename
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 4.3.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 57062 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-05-01 23:22 UTC by H.J. Lu
Modified: 2014-05-12 21:24 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-01-28 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2007-05-01 23:22:31 UTC
genattrtab.c has

struct insn_def
{
  struct insn_def *next;        /* Next insn in chain.  */
  rtx def;                      /* The DEFINE_...  */
  int insn_code;                /* Instruction number.  */
  int insn_index;               /* Expression numer in file, for errors.  */
  int lineno;                   /* Line number.  */
  int num_alternatives;         /* Number of alternatives.  */
  int vec_idx;                  /* Index of attribute vector in `def'.  */
};

It doesn't record filename. Most of machine descriptions have more than one
input file. As the result, when genattrtab prints an error message
with message_with_line, it dpesn't have filename and it is hard to see
where the problem is.
Comment 1 Andrew Pinski 2012-01-28 02:12:48 UTC
Confirmed.
Comment 2 mrs@gcc.gnu.org 2014-05-08 01:49:12 UTC
*** Bug 57062 has been marked as a duplicate of this bug. ***
Comment 3 mrs@gcc.gnu.org 2014-05-08 01:50:46 UTC
Patch posted.
Comment 4 mrs@gcc.gnu.org 2014-05-12 21:22:53 UTC
Author: mrs
Date: Mon May 12 21:22:20 2014
New Revision: 210340

URL: http://gcc.gnu.org/viewcvs?rev=210340&root=gcc&view=rev
Log:
        PR other/31778
        * genattrtab.c (filename): Add.
        (convert_set_attr_alternative): Improve error message.
	(check_defs): Restore read_md_filename for error messages.
        (gen_insn): Save filename.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/genattrtab.c
Comment 5 mrs@gcc.gnu.org 2014-05-12 21:24:05 UTC
Fixed.