Bug 31778

Summary: genattrtab.c doesn't record filename
Product: gcc Reporter: H.J. Lu <hjl.tools>
Component: otherAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: enhancement CC: gcc-bugs, mrs, segher
Priority: P3    
Version: 4.3.0   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2012-01-28 00:00:00

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.