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]
Other format: [Raw text]

Re: RFC - PR java/8608: ICE if WFL not yet set in check_init()


Ranjit Mathew wrote:
  The ICE in PR java/8608 happens because WFL does
not get set before parse_error_context() and thence
issue_warning_error_from_context() is called from
check_init().

The preferred fix is to is to remove parse_error_context, and just the functions in diagnostic.c. These make use of input_location - but note that in init-check.c only when input_location is set, so we'd get the same line numbers as with using parse_error_context.

However, we'd lose column numbers in the short term,
even with USE_MAPPED_LOCATION - but that's easily fixable.

The patch does not handle USE_MAPPED_LOCATION as
I am not familiar with it.

You're a smart boy - you can figure it out. The main thing to note that if USE_MAPPED_LOCATION build_expr_wfl that a source_location, so the code becomes: build_expr_wfl (NULL_TREE, DECL_SOURCE_LOCATION (exp)

But since since we want to get rid of both build_expr_wfl
and parse_error_context, the better fix for USE_MAPPED_LOCATION
is plain:

error ("Variable %qD may not have been initialized", exp);

If we're willing to temporarily give up line numbers,
we can use that for the non-USE_MAPPED_LOCATION as well.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


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