Diego Novillo | 1 Feb 2009 01:33
Picon
Favicon

[lto] Remove alias pairs for removed cgraph nodes

This patch fixes the problem we have with early generation of
thunks.  I am not completely thrilled with it, but I have not
been able to found a simpler way of fixing it.

The problem is the following.  Since we are now emitting thunks
before functions are expanded, it may happen that a thunk is
emitted for a function that later disappears and never gets
emitted.  This causes confusion in finish_aliases_1 when it tries
to match the thunk to its alias target.

The basic problem is that there is a circular dependency between
what we need to know if a function will be expanded and the
stage of compilation where we finally know.  Essentially we can't
know whether a cgraph node will be expanded until all the IPA
transformations have been applied (particularly inlining).

At that point, it is too late to expand a thunk because we have
already written the IL to disk so we miss the chance to emit the
thunk in the IL file.

So, we emit thunks early, before the IPA passes.  This may
generate unneeded thunks, which was causing failures in the two
test cases in the patch.

The simplest solution is to remove unreachable alias pairs every
time we remove unreachable nodes in the call graph.

Jan, if you can suggest a better alternative to this, I'd gladly
implement it.

(Continue reading)

Ian Lance Taylor | 1 Feb 2009 01:58
Picon
Favicon
Gravatar

[gcc-in-cxx] Change 0 to VOIDmode in some cases

There are a few cases where an enum machine_mode variable is
initialized to 0.  This is invalid in C++.  I committed this patch to
initialize to VOIDmode instead.

This patch also removes some odd casts to int in optabs.  These were
casting a value of type enum insn_code which was being assigned to a
variable of type enum insn_code.  The casts were clearly unnecessary,
and now they are gone.

Ian

2009-01-31  Ian Lance Taylor  <iant <at> google.com>

	* fwprop.c (update_df): Change 0 to VOIDmode.
	* sel-sched-ir.c (hash_with_unspec_callback): Likewise.
	* combine.c (record_value_for_reg): Likewise.
	(record_dead_and_set_regs): Likewise.
	* optabs.c (expand_widen_pattern_expr): Likewise.
	(expand_vec_shift_expr): Don't cast insn_code field of
	optab_handler to int.
	(emit_cmp_and_jump_insn_1): Likewise.

Attachment (foo.patch): text/x-patch, 3602 bytes
Ian Lance Taylor | 1 Feb 2009 05:58
Picon
Favicon
Gravatar

[gcc-in-cxx] Merge from trunk

I merged trunk revision 143837 onto the gcc-in-cxx branch.

Ian

Ian Lance Taylor | 1 Feb 2009 06:16
Picon
Favicon
Gravatar

Re: [Patch] [SSP] Fix output of diagnostics on mingw32

"Danny Smith" <dansmister <at> gmail.com> writes:

>  2008-01-19  Danny Smith  <dannysmith <at> users.sourcforge.net>
>
>         * ssp.c (_PATH_TTY): Define as "CONOUT$" for _WIN32.

This is OK if it is still useful.

Thanks.

Ian

Ian Lance Taylor | 1 Feb 2009 06:43
Picon
Favicon
Gravatar

[gcc-in-cxx] Return reg_class from branch_target_register_class

This patch changes the target hook branch_target_register_class to
return an enum reg_class rather than an int.  There are other hooks in
target.h which already return reg_class, and this one should as well.
This avoids an enum mismatch in bt-load.c.

This also corrects the prototype of the needs_block_p prototype, which
broke due to a bad merge.

Committed to gcc-in-cxx branch.

Ian

2009-01-31  Ian Lance Taylor  <iant <at> google.com>

	* target.h (struct sched): Correct needs_block_p prototype.
	(struct gcc_target): Change return type of
	branch_target_register_class to enum reg_class.
	* target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Change to
	default_branch_target_register_class.
	* targhooks.h (default_branch_target_register_class): Declare.
	* targhooks.c (default_branch_target_register_class): Define.

Attachment (foo.patch): text/x-patch, 2593 bytes
Ian Lance Taylor | 1 Feb 2009 06:48
Picon
Favicon
Gravatar

[gcc-in-cxx] Remove hook_int_void_no_regs

The last patch on the gcc-in-cxx branch introduced
default_branch_target_register_class.  With that patch, the hook
hook_int_void_no_regs is no longer used (it should never have been in
hooks.c anyhow--it should have been in targhooks.c all along).
Committed to gcc-in-cxx branch.

Ian

2009-01-31  Ian Lance Taylor  <iant <at> google.com>

	* hooks.h (hook_int_void_no_regs): Don't declare.
	* hooks.c (hook_int_void_no_regs): Don't define.

Attachment (foo.patch): text/x-patch, 960 bytes
Ian Lance Taylor | 1 Feb 2009 06:53
Picon
Favicon
Gravatar

[gcc-in-cxx] Don't do enum math in tree-complex.c

The file tree-complex.c does math on enum values, which is verboten in
C++.  This patch changes the complex_lattice_t to be an integer
typedef.  The enum values remain the same, in a now unnamed enum.

This patch also adds a couple of casts to enum type.

Committed to gcc-in-cxx branch.

Ian

2009-01-31  Ian Lance Taylor  <iant <at> google.com>

	* tree-complex.c (complex_lattice_t): Change to int type.  Leave
	enum type unnamed.
	(expand_complex_libcall): Add casts to enum type.

Attachment (foo.patch): text/x-patch, 1214 bytes
Ian Lance Taylor | 1 Feb 2009 06:56
Picon
Favicon
Gravatar

[gcc-in-cxx] Correct enum type

This patch corrects the type of an enum.  This does not matter in C,
but it matters in C++.  Committed to gcc-in-cxx branch.

Ian

2009-01-31  Ian Lance Taylor  <iant <at> google.com>

	* cp/semantics.c (finish_omp_clauses): Change c_kind to enum
	omp_clause_code.

Attachment (foo.patch): text/x-patch, 501 bytes
Ian Lance Taylor | 1 Feb 2009 07:02
Picon
Favicon
Gravatar

[gcc-in-cxx] Fix cp/parser.c to compile with C++

This patch fixes cp/parser.c to compile with C++.  This avoids math on
enum types.  The bulk of the patch is reindentation after introducing
a new block to avoid having a goto jump into the scope of a local
variable.  Committed to gcc-in-cxx branch.

Ian

2009-01-31  Ian Lance Taylor  <iant <at> google.com>

	* parser.c (cp_parser_expression_stack_entry): Change prec field
	to enum cp_parser_prec.
	(cp_parser_decl_specifier_seq): Change flags to int.
	(cp_parser_type_specifier): Likewise.
	(cp_parser_simple_type_specifier): Likewise.
	(cp_parser_type_specifier_seq): Likewise.
	(cp_parser_direct_declarator): Don't jump into variable scope.

Attachment (foo.patch): text/x-patch, 13 KiB
Ian Lance Taylor | 1 Feb 2009 07:05
Picon
Favicon
Gravatar

[gcc-in-cxx] Remove useless comma right hand side

This patch removes a useless reference to a variable on the right hand
side of a comma operator.  This triggers a warning in C++.  Committed
to gcc-in-cxx branch.

Ian

2009-01-31  Ian Lance Taylor  <iant <at> google.com>

	* profile.c (compute_branch_probabilities): Remove useless
	references to variable on right side of comma operator.

Attachment (foo.patch): text/x-patch, 421 bytes

Gmane