public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PATCH RFC: Use type alias_set_type to hold alias sets
@ 2007-08-10  0:31 Ian Lance Taylor
  2007-08-10  0:37 ` Andrew Pinski
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Ian Lance Taylor @ 2007-08-10  0:31 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 5280 bytes --]

In this patch:
    http://gcc.gnu.org/ml/gcc-patches/2000-05/msg01680.html
Richard Kenner changed the type of alias sets from int to
HOST_WIDE_INT.  However, the change was not made consistently.  There
are a number of places in the compiler which store alias sets in a
simple int; e.g., the static variable alpha_sr_alias_set in alpha.c.

According to his e-mail message, the change was made to permit
frontends to use a sparse definition of alias sets.  However, no
frontend takes advantage of that facility, and I am doubtful that any
frontend ever would.  Since alias sets are allocated directly by the
middle-end, as well as by the frontend via LANG_HOOKS_GET_ALIAS_SET,
it is hard to see how a frontend could be sure to avoid alias sets
allocated by the middle-end.

The code in dse.c stores alias set numbers in bitmaps, which is only
supported for int, not for HOST_WIDE_INT.  This code is admittedly
rather new.

So there is no reason to use HOST_WIDE_INT for alias sets, it never
fully worked, and it works even less well now.  I think it is time to
change alias sets back to have type int, which should save a bit of
space in DECLs and MEM_ATTRs.

To avoid the kind of error made in the original patch, in which some
variables did not change type, this is a purely mechanical patch to
change all alias set representations to have type alias_set_type.
This does not change the compiler, except for correcting the cases
where a variable had type int when it should have been HOST_WIDE_INT.

If this patch seems OK, I'll change alias_set_type in a simple
follow-on patch.

Bootstrapped and tested on i686-pc-linux-gnu.  I plan to commit this
in a couple of days unless I get comments.

Ian


gcc/ChangeLog:
2007-08-09  Ian Lance Taylor  <iant@google.com>

	* alias.h (alias_set_type): Define new type.
	(ALIAS_SET_MEMORY_BARRIER): Use it.
	* rtl.h: Include alias.h.
	(struct mem_attrs): Use alias_set_type.
	* tree.h: Include alias.h
	(struct tree_type): Use alias_set_type.
	(struct tree_struct_field_tag): Likewise.
	(struct tree_decl_common): Likewise.
	* alias.c (struct alias_set_entry): Use alias_set_type.
	(get_alias_set_entry, alias_set_subset_of): Likewise.
	(alias_sets_conflict_p): Likewise.
	(alias_sets_must_conflict_p): Likewise.
	(objects_must_conflict_p): Likewise.
	(get_alias_set, new_alias_set): Likewise.
	(record_alias_subset, record_component_aliases): Likewise.
	(varargs_set, frame_set): Change to alias_set_type.
	(get_varargs_alias_set): Use alias_set_type.
	(get_frame_alias_set): Likewise.
	* builtins.c (setjmp_alias_set): Change to alias_set_type.
	* dse.c (struct store_info): Use alias_set_type.
	(struct read_info, struct clear_alias_mode_holder): Likewise.
	(clear_alias_set_lookup, canon_address): Likewise.
	(record_store, check_mem_read_rtx): Likewise.
	(dse_record_singleton_alias_set): Likewise.
	(dse_invalidate_singleton_alias_set): Likewise.
	* emit-rtl.c (get_mem_attrs): Likewise.
	(set_mem_attributes_minus_bitpos): Likewise.
	(set_mem_alias_set): Likewise.
	* expr.c (store_constructor_field, store_field): Likewise.
	* gimplify.c (struct gimplify_init_ctor_preeval_data): Likewise.
	* langhooks.c (lhd_get_alias_set): Likewise.
	* langhooks-def.h (lhd_get_alias_set): Likewise.
	* reload1.c (alter_reg): Likewise.
	* tree-flow.h (struct fieldoff): Likewise.
	* tree-ssa-alias.c (struct alias_map_d): Likewise.
	(may_alias_p, get_smt_for, create_sft): Likewise.
	* tree-ssa-alias-warnings.c (nonstandard_alias_types_p): Likewise.
	* tree-ssa-structalias.c (set_uids_in_ptset): Likewise.
	(merge_smts_into): Likewise.
	* varasm.c (const_alias_set): Likewise.
	* c-common.c (strict_aliasing_warning): Likewise.
	(c_common_get_alias_set): Likewise.
	* dse.h (dse_record_singleton_alias_set): Update declaration.
	(dse_invalidate_singleton_alias_set): Likewise.
	* emit-rtl.h (set_mem_alias_set): Likewise.
	* c-common.h (c_common_get_alias_set): Likewise.
	* print-rtl.c (print_rtx): Cast MEM_ALIAS_SET when printing it.
	* print-tree.c (print_node): Likewise.
	* config/alpha/alpha.c (alpha_sr_alias_set): Change to
	alias_set_type.
	(alpha_setup_incoming_varargs): Use alias_set_type.
	* config/i386/i386.c (setup_incoming_varargs_64): Use
	alias_set_type.
	(setup_incoming_varargs_ms_64): Likewise.
	(ix86_GOT_alias_set): Likewise.
	* config/mn10300/mn10300.c (mn10300_builtin_saveregs): Likewise.
	* config/rs6000/rs6000.c (setup_incoming_varargs): Likewise.
	(set): Change to alias_set_type.
	(get_TOC_alias_set): Use alias_set_type.
	* config/rs6000/rs6000-protos.h (get_TOC_alias_set): Update
	declaration.
	* config/sh/sh.c (sh_builtin_saveregs): Use alias_set_type.
	* config/sparc/sparc.c (sparc_sr_alias_set): Change to
	alias_set_type.
	(struct_value_alias_set): Likewise.
	* Makefile.in (GTFILES): Add $(srcdir)/alias.h.

gcc/ada/ChangeLog:
2007-08-09  Ian Lance Taylor  <iant@google.com>

	* misc.c (gnat_get_alias_set): Change return type to
	alias_set_type.

gcc/cp/ChangeLog:
2007-08-09  Ian Lance Taylor  <iant@google.com>

	* cp-objcp-common.c (cxx_get_alias_set): Change return type to
	alias_set_type.
	* cp/cp-tree.h (cxx_get_alias_set): Update declaration.

gcc/fortran/ChangeLog:
2007-08-09  Ian Lance Taylor  <iant@google.com>

	* f95-lang.c (gfc_get_alias_set): Change return type to
	alias_set_type.


[-- Attachment #2: alias_set_type patch --]
[-- Type: application/x-gzip, Size: 9850 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PATCH RFC: Use type alias_set_type to hold alias sets
  2007-08-10  0:31 PATCH RFC: Use type alias_set_type to hold alias sets Ian Lance Taylor
@ 2007-08-10  0:37 ` Andrew Pinski
  2007-08-10 16:38   ` Mark Mitchell
  2007-08-10  1:45 ` Richard Kenner
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Andrew Pinski @ 2007-08-10  0:37 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-patches

On 09 Aug 2007 17:30:12 -0700, Ian Lance Taylor <iant@google.com> wrote:
> To avoid the kind of error made in the original patch, in which some
> variables did not change type, this is a purely mechanical patch to
> change all alias set representations to have type alias_set_type.

I love this idea and I think we should use it more often for other
variables where we store/use in different places.

Thanks,
Andrew Pinski

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PATCH RFC: Use type alias_set_type to hold alias sets
  2007-08-10  0:31 PATCH RFC: Use type alias_set_type to hold alias sets Ian Lance Taylor
  2007-08-10  0:37 ` Andrew Pinski
@ 2007-08-10  1:45 ` Richard Kenner
  2007-08-10  3:49 ` Diego Novillo
  2007-08-11 17:23 ` Ian Lance Taylor
  3 siblings, 0 replies; 6+ messages in thread
From: Richard Kenner @ 2007-08-10  1:45 UTC (permalink / raw)
  To: iant; +Cc: gcc-patches

> In this patch:
>     http://gcc.gnu.org/ml/gcc-patches/2000-05/msg01680.html
> Richard Kenner changed the type of alias sets from int to
> HOST_WIDE_INT.  However, the change was not made consistently.  There
> are a number of places in the compiler which store alias sets in a
> simple int; e.g., the static variable alpha_sr_alias_set in alpha.c.
>
> According to his e-mail message, the change was made to permit
> frontends to use a sparse definition of alias sets.  However, no
> frontend takes advantage of that facility, and I am doubtful that any
> frontend ever would.

At this point, I agree.  The argument was marginal then and irrelevant now.

> To avoid the kind of error made in the original patch, in which some
> variables did not change type

Just FYI, these error occured in a merge.  alpha_sr_alias_sets was added in
1998 by RTH, but in a different tree than the patch you quote was written
for.  When that patch was moved over to the other tree, nobody went and
looked for any other variables that had to be changed, so that and others
got missed.

> this is a purely mechanical patch to change all alias set
> representations to have type alias_set_type.  This does not change
> the compiler, except for correcting the cases where a variable had
> type int when it should have been HOST_WIDE_INT.

I'm not against that change, but do want to point out that it would not
have avoided the above error.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PATCH RFC: Use type alias_set_type to hold alias sets
  2007-08-10  0:31 PATCH RFC: Use type alias_set_type to hold alias sets Ian Lance Taylor
  2007-08-10  0:37 ` Andrew Pinski
  2007-08-10  1:45 ` Richard Kenner
@ 2007-08-10  3:49 ` Diego Novillo
  2007-08-11 17:23 ` Ian Lance Taylor
  3 siblings, 0 replies; 6+ messages in thread
From: Diego Novillo @ 2007-08-10  3:49 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-patches

On 8/9/07 6:30 PM, Ian Lance Taylor wrote:

> If this patch seems OK, I'll change alias_set_type in a simple
> follow-on patch.

Definitely.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PATCH RFC: Use type alias_set_type to hold alias sets
  2007-08-10  0:37 ` Andrew Pinski
@ 2007-08-10 16:38   ` Mark Mitchell
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Mitchell @ 2007-08-10 16:38 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Ian Lance Taylor, gcc-patches

Andrew Pinski wrote:
> On 09 Aug 2007 17:30:12 -0700, Ian Lance Taylor <iant@google.com> wrote:
>> To avoid the kind of error made in the original patch, in which some
>> variables did not change type, this is a purely mechanical patch to
>> change all alias set representations to have type alias_set_type.
> 
> I love this idea and I think we should use it more often for other
> variables where we store/use in different places.

/me three

I think it would be much better if we used typedefs for integer types
much more widely.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PATCH RFC: Use type alias_set_type to hold alias sets
  2007-08-10  0:31 PATCH RFC: Use type alias_set_type to hold alias sets Ian Lance Taylor
                   ` (2 preceding siblings ...)
  2007-08-10  3:49 ` Diego Novillo
@ 2007-08-11 17:23 ` Ian Lance Taylor
  3 siblings, 0 replies; 6+ messages in thread
From: Ian Lance Taylor @ 2007-08-11 17:23 UTC (permalink / raw)
  To: gcc-patches

Ian Lance Taylor <iant@google.com> writes:

> This is a purely mechanical patch to change all alias set
> representations to have type alias_set_type.  This does not change
> the compiler, except for correcting the cases where a variable had
> type int when it should have been HOST_WIDE_INT.

I have committed this patch.

Ian

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-08-11 17:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-10  0:31 PATCH RFC: Use type alias_set_type to hold alias sets Ian Lance Taylor
2007-08-10  0:37 ` Andrew Pinski
2007-08-10 16:38   ` Mark Mitchell
2007-08-10  1:45 ` Richard Kenner
2007-08-10  3:49 ` Diego Novillo
2007-08-11 17:23 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).