public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/41785] New: ICE on canonical types with variadic templates and CRTP
@ 2009-10-21 18:46 alban dot linard at gmail dot com
2009-10-22 9:34 ` [Bug c++/41785] [4.5 Regression] " rguenth at gcc dot gnu dot org
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: alban dot linard at gmail dot com @ 2009-10-21 18:46 UTC (permalink / raw)
To: gcc-bugs
Source code below makes an ICE:
g++-mp-4.5 -std=c++0x bug.cc
bug.cc: In instantiation of 'derived<a>':
bug.cc:20:16: instantiated from here
bug.cc:9:1: internal compiler error: canonical types differ for identical types
derived<a> and derived<a>
Source:
struct a {};
template < typename T, typename ENCLOSING >
struct base;
template < typename... T >
struct derived
: public base< T, derived< T... > >...
{};
template < typename... T>
struct base< a, derived< T... > >
{
typedef derived< T... >
Derived;
};
int main()
{
derived< a > instance;
}
g++-mp-4.5 -v
Using built-in specs.
Target: i386-apple-darwin9
Configured with: ../gcc-4.5-20091001/configure --prefix=/opt/local
--build=i386-apple-darwin9 --enable-languages=c,c++,objc,obj-c++
--libdir=/opt/local/lib/gcc45 --includedir=/opt/local/include/gcc45
--infodir=/opt/local/share/info --mandir=/opt/local/share/man
--with-local-prefix=/opt/local --with-system-zlib --disable-nls
--program-suffix=-mp-4.5 --with-gxx-include-dir=/opt/local/include/gcc45/c++/
--with-gmp=/opt/local --with-mpfr=/opt/local
Thread model: posix
gcc version 4.5.0 20091001 (experimental) (GCC)
--
Summary: ICE on canonical types with variadic templates and CRTP
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: alban dot linard at gmail dot com
GCC build triplet: i386-apple-darwin9
GCC host triplet: i386-apple-darwin9
GCC target triplet: i386-apple-darwin9
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41785
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/41785] [4.5 Regression] ICE on canonical types with variadic templates and CRTP
2009-10-21 18:46 [Bug c++/41785] New: ICE on canonical types with variadic templates and CRTP alban dot linard at gmail dot com
@ 2009-10-22 9:34 ` rguenth at gcc dot gnu dot org
2009-10-22 14:20 ` alban dot linard at gmail dot com
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-10-22 9:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rguenth at gcc dot gnu dot org 2009-10-22 09:34 -------
Confirmed.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |ice-checking
Known to work| |4.4.2
Last reconfirmed|0000-00-00 00:00:00 |2009-10-22 09:34:12
date| |
Summary|ICE on canonical types with |[4.5 Regression] ICE on
|variadic templates and CRTP |canonical types with
| |variadic templates and CRTP
Target Milestone|--- |4.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41785
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/41785] [4.5 Regression] ICE on canonical types with variadic templates and CRTP
2009-10-21 18:46 [Bug c++/41785] New: ICE on canonical types with variadic templates and CRTP alban dot linard at gmail dot com
2009-10-22 9:34 ` [Bug c++/41785] [4.5 Regression] " rguenth at gcc dot gnu dot org
@ 2009-10-22 14:20 ` alban dot linard at gmail dot com
2009-10-22 15:59 ` [Bug c++/41785] [4.5 Regression] [C++0x] " paolo dot carlini at oracle dot com
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: alban dot linard at gmail dot com @ 2009-10-22 14:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from alban dot linard at gmail dot com 2009-10-22 14:20 -------
Seems related to bug #41752
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41785
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/41785] [4.5 Regression] [C++0x] ICE on canonical types with variadic templates and CRTP
2009-10-21 18:46 [Bug c++/41785] New: ICE on canonical types with variadic templates and CRTP alban dot linard at gmail dot com
2009-10-22 9:34 ` [Bug c++/41785] [4.5 Regression] " rguenth at gcc dot gnu dot org
2009-10-22 14:20 ` alban dot linard at gmail dot com
@ 2009-10-22 15:59 ` paolo dot carlini at oracle dot com
2009-10-22 16:34 ` hjl dot tools at gmail dot com
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-10-22 15:59 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from paolo dot carlini at oracle dot com 2009-10-22 15:59 -------
Note, the ICE happens only with checking enabled, error otherwise.
Again, CC-ing Jason...
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu dot org
Summary|[4.5 Regression] ICE on |[4.5 Regression] [C++0x] ICE
|canonical types with |on canonical types with
|variadic templates and CRTP |variadic templates and CRTP
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41785
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/41785] [4.5 Regression] [C++0x] ICE on canonical types with variadic templates and CRTP
2009-10-21 18:46 [Bug c++/41785] New: ICE on canonical types with variadic templates and CRTP alban dot linard at gmail dot com
` (2 preceding siblings ...)
2009-10-22 15:59 ` [Bug c++/41785] [4.5 Regression] [C++0x] " paolo dot carlini at oracle dot com
@ 2009-10-22 16:34 ` hjl dot tools at gmail dot com
2009-10-24 12:00 ` rguenth at gcc dot gnu dot org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-10-22 16:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from hjl dot tools at gmail dot com 2009-10-22 16:34 -------
It is caused by revision 149188:
http://gcc.gnu.org/ml/gcc-cvs/2009-07/msg00065.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41785
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/41785] [4.5 Regression] [C++0x] ICE on canonical types with variadic templates and CRTP
2009-10-21 18:46 [Bug c++/41785] New: ICE on canonical types with variadic templates and CRTP alban dot linard at gmail dot com
` (3 preceding siblings ...)
2009-10-22 16:34 ` hjl dot tools at gmail dot com
@ 2009-10-24 12:00 ` rguenth at gcc dot gnu dot org
2009-10-25 17:47 ` dodji at redhat dot com
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-10-24 12:00 UTC (permalink / raw)
To: gcc-bugs
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Priority|P3 |P1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41785
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/41785] [4.5 Regression] [C++0x] ICE on canonical types with variadic templates and CRTP
2009-10-21 18:46 [Bug c++/41785] New: ICE on canonical types with variadic templates and CRTP alban dot linard at gmail dot com
` (4 preceding siblings ...)
2009-10-24 12:00 ` rguenth at gcc dot gnu dot org
@ 2009-10-25 17:47 ` dodji at redhat dot com
2009-10-26 16:04 ` dodji at gcc dot gnu dot org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dodji at redhat dot com @ 2009-10-25 17:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from dodji at gcc dot gnu dot org 2009-10-25 17:47 -------
Subject: Re: New: ICE on canonical types with variadic
templates and CRTP
During the instantiation of the base class of "derived" we are trying to
instantiate derived<T...> in the argument list of base.
lookup_template_class should find the specialization derived<a>
in the type_specialization hash table because that specialization has been
hashed when we encountered the "derived<a> instance;" declaration in main.
But the specialization is not found, leading to another derived<a> type being
created and inserted into the type_specialization - which causes type
comparison issues later.
The reason why the derived<a> specialization is not found by
lookup_template_class has to do with ARGUMENT_PACK_SELECT nodes.
At some point during pack expansion substituting in tsubst_pack_expansion
the pack argument "a" is temporarily replaced by an ARGUMENT_PACK_SELECT node.
So in type_specialization, the argument we have for the "derived"
specialization
is no more the TYPE_ARGUMENT_PACK "a", but an ARGUMENT_PACK_SELECT node that
references that TYPE_ARGUMENT_PACK.
But then we indirectly hit lookup_template_class from within
tsubst_pack_expansion
asking for the specialization of "derived" with the "a" argument. We
fail to find the specialization because we compare the TYPE_ARGUMENT_PACK "a"
with the ARGUMENT_PACK_SELECT present in the hash table.
I am testing the patch below which seems to address the issue.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 084ad1c..e80bc30 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -5818,6 +5818,18 @@ template_args_equal (tree ot, tree nt)
return 0;
return 1;
}
+ else if (ot && TREE_CODE (ot) == ARGUMENT_PACK_SELECT)
+ {
+ /* We get here probably because we are in the middle of substituting
+ into the pattern of a pack expansion. In that case the
+ ARGUMENT_PACK_SELECT temporarily replaces the pack argument we are
+ interested in. So we want to use the initial pack argument for
+ the comparison. */
+ ot = ARGUMENT_PACK_SELECT_FROM_PACK (ot);
+ if (nt && TREE_CODE (nt) == ARGUMENT_PACK_SELECT)
+ nt = ARGUMENT_PACK_SELECT_FROM_PACK (nt);
+ return template_args_equal (ot, nt);
+ }
else if (TYPE_P (nt))
return TYPE_P (ot) && same_type_p (ot, nt);
else if (TREE_CODE (ot) == TREE_VEC || TYPE_P (ot))
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41785
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/41785] [4.5 Regression] [C++0x] ICE on canonical types with variadic templates and CRTP
2009-10-21 18:46 [Bug c++/41785] New: ICE on canonical types with variadic templates and CRTP alban dot linard at gmail dot com
` (5 preceding siblings ...)
2009-10-25 17:47 ` dodji at redhat dot com
@ 2009-10-26 16:04 ` dodji at gcc dot gnu dot org
2009-10-26 18:31 ` dodji at gcc dot gnu dot org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-10-26 16:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from dodji at gcc dot gnu dot org 2009-10-26 16:03 -------
Patch posted to http://gcc.gnu.org/ml/gcc-patches/2009-10/msg01563.html .
--
dodji at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |dodji at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2009-10-22 09:34:12 |2009-10-26 16:03:52
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41785
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/41785] [4.5 Regression] [C++0x] ICE on canonical types with variadic templates and CRTP
2009-10-21 18:46 [Bug c++/41785] New: ICE on canonical types with variadic templates and CRTP alban dot linard at gmail dot com
` (6 preceding siblings ...)
2009-10-26 16:04 ` dodji at gcc dot gnu dot org
@ 2009-10-26 18:31 ` dodji at gcc dot gnu dot org
2009-10-26 18:37 ` dodji at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-10-26 18:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from dodji at gcc dot gnu dot org 2009-10-26 18:31 -------
Subject: Bug 41785
Author: dodji
Date: Mon Oct 26 18:31:22 2009
New Revision: 153564
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153564
Log:
Fix PR c++/41785
gcc/cp/ChangeLog:
PR c++/41785
* pt.c (template_args_equal): Handle comparison of
an ARGUMENT_PACK_SELECT node with the arguments node it selects into.
* cp-tree.def: Fix a typo in the description of TYPE_PACK_EXPANSION.
gcc/testsuite/ChangeLog:
PR c++/41785
* gcc/testsuite/g++.dg/cpp0x/variadic96.C: New test.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/variadic96.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.def
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41785
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/41785] [4.5 Regression] [C++0x] ICE on canonical types with variadic templates and CRTP
2009-10-21 18:46 [Bug c++/41785] New: ICE on canonical types with variadic templates and CRTP alban dot linard at gmail dot com
` (7 preceding siblings ...)
2009-10-26 18:31 ` dodji at gcc dot gnu dot org
@ 2009-10-26 18:37 ` dodji at gcc dot gnu dot org
2009-10-29 16:40 ` law at gcc dot gnu dot org
2009-10-30 16:06 ` hjl at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-10-26 18:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from dodji at gcc dot gnu dot org 2009-10-26 18:36 -------
Fixed in 4.5.0
--
dodji at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41785
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/41785] [4.5 Regression] [C++0x] ICE on canonical types with variadic templates and CRTP
2009-10-21 18:46 [Bug c++/41785] New: ICE on canonical types with variadic templates and CRTP alban dot linard at gmail dot com
` (8 preceding siblings ...)
2009-10-26 18:37 ` dodji at gcc dot gnu dot org
@ 2009-10-29 16:40 ` law at gcc dot gnu dot org
2009-10-30 16:06 ` hjl at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: law at gcc dot gnu dot org @ 2009-10-29 16:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from law at gcc dot gnu dot org 2009-10-29 16:40 -------
Subject: Bug 41785
Author: law
Date: Thu Oct 29 16:39:42 2009
New Revision: 153712
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153712
Log:
Recorded merge of revisions 153564-153565,153572-153576 via svnmerge from
svn+ssh://law@gcc.gnu.org/svn/gcc/trunk
........
r153564 | dodji | 2009-10-26 12:31:22 -0600 (Mon, 26 Oct 2009) | 12 lines
Fix PR c++/41785
gcc/cp/ChangeLog:
PR c++/41785
* pt.c (template_args_equal): Handle comparison of
an ARGUMENT_PACK_SELECT node with the arguments node it selects into.
* cp-tree.def: Fix a typo in the description of TYPE_PACK_EXPANSION.
gcc/testsuite/ChangeLog:
PR c++/41785
* gcc/testsuite/g++.dg/cpp0x/variadic96.C: New test.
........
r153565 | jason | 2009-10-26 13:07:14 -0600 (Mon, 26 Oct 2009) | 20 lines
PR c++/38796, Core issue 906
gcc/cp
* cp-tree.h (DECL_DEFAULTED_OUTSIDE_CLASS_P): New.
(DECL_DEFAULTED_IN_CLASS_P): New.
* class.c (user_provided_p): Non-static.
(check_methods): Use it.
(check_bases_and_members): Check defaulted fns.
(defaultable_fn_p): Move and rename to...
* method.c (defaultable_fn_check): ...this.
(defaulted_late_check): New.
* pt.c (tsubst_decl): Call it.
* decl2.c (grokfield): Adjust.
* decl.c (cp_finish_decl): Adjust.
(grok_special_member_properties): Use user_provided_p.
libstdc++-v3
* include/std/future (~Future_result_base): Default outside class
body.
* include/std/system_error (error_category()): Likewise.
* libsupc++/nested_exception.h (nested_exception): Remove
exception specifications from defaulted methods.
........
r153572 | uweigand | 2009-10-26 15:55:59 -0600 (Mon, 26 Oct 2009) | 183 lines
2009-10-26 Ben Elliston <bje@au.ibm.com>
Michael Meissner <meissner@linux.vnet.ibm.com>
Ulrich Weigand <uweigand@de.ibm.com>
* doc/extend.texi (Named Address Spaces): New section.
* coretypes.h (addr_space_t): New type.
(ADDR_SPACE_GENERIC): New define.
(ADDR_SPACE_GENERIC_P): New macro.
* doc/tm.texi (Named Address Spaces): New section.
(TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Document.
(TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Document.
(TARGET_ADDR_SPACE_SUBSET_P): Document.
(TARGET_ADDR_SPACE_CONVERT): Document.
* target.h (struct gcc_target): Add addr_space substructure.
* target-def.h (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Define.
(TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Likewise.
(TARGET_ADDR_SPACE_SUBSET_P): Likewise.
(TARGET_ADDR_SPACE_CONVERT): Likewise.
(TARGET_ADDR_SPACE_HOOKS): Likewise.
(TARGET_INITIALIZER): Initialize addr_space hooks.
* targhooks.c (default_addr_space_legitimate_address_p): New function.
(default_addr_space_legitimize_address): Likewise.
(default_addr_space_subset_p): Likewise.
(default_addr_space_convert): Likewise.
* targhooks.h (default_addr_space_legitimate_address_p): Add prototype.
(default_addr_space_legitimize_address): Likewise.
(default_addr_space_subset_p): Likewise.
(default_addr_space_convert): Likewise.
* doc/rtl.texi (MEM_ADDR_SPACE): Document.
* rtl.h (mem_attrs): Add ADDRSPACE memory attribute.
(MEM_ADDR_SPACE): New macro.
* emit-rtl.c (get_mem_attrs): Add ADDRSPACE argument and set
address space memory attribute.
(mem_attrs_htab_hash): Handle address space memory attribute.
(mem_attrs_htab_eq): Likewise.
(set_mem_attributes_minus_bitpos): Likewise.
(set_mem_alias_set): Likewise.
(set_mem_align): Likewise.
(set_mem_expr): Likewise.
(set_mem_offset): Likewise.
(set_mem_size): Likewise.
(adjust_address_1): Likewise.
(offset_address): Likewise.
(widen_memoy_address): Likewise.
(get_spill_slot_decl): Likewise.
(set_mem_attrs_for_spill): Likewise.
(set_mem_addr_space): New function.
* emit-rtl.h (set_mem_addr_space): Add prototype.
* print-rtl.c (print_rtx): Print address space memory attribute.
* expr.c (expand_assignment): Set address space memory attribute
of generated MEM RTXes as appropriate.
(expand_expr_real_1): Likewise.
* cfgexpand.c (expand_debug_expr): Likewise.
* tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise.
* tree.h (struct tree_base): Add address_space bitfield. Reduce
size of "spare" bitfield.
(TYPE_ADDR_SPACE): New macro.
(ENCODE_QUAL_ADDR_SPACE): Likewise.
(DECODE_QUAL_ADDR_SPACE): Likewise.
(CLEAR_QUAL_ADDR_SPACE): Likewise.
(KEEP_QUAL_ADDR_SPACE): Likewise.
(TYPE_QUALS): Encode type address space.
(TYPE_QUALS_NO_ADDR_SPACE): New macro.
* tree.c (set_type_quals): Set type address space.
(build_array_type): Inherit array address space from element type.
* print-tree.c (print_node_brief): Print type address space.
(print_node): Likewise.
* tree-pretty-print.c (dump_generic_node): Likewise.
* explow.c (memory_address): Rename to ...
(memory_address_addr_space): ... this. Add ADDRSPACE argument.
Use address-space aware variants of memory address routines.
* recog.c (memory_address_p): Rename to ...
(memory_address_addr_space_p): ... this. Add ADDSPACE argument.
Use address-space aware variants of memory address routines.
(offsettable_address_p): Rename to ...
(offsettable_address_addr_space_p): ... this. Add ADDRSPACE argument.
Use address-space aware variants of memory address routines.
* reload.c (strict_memory_address_p): Rename to ...
(strict_memory_address_addr_space_p): ... this. Add ADDSPACE argument.
Use address-space aware variants of memory address routines.
(maybe_memory_address_p): Rename to ...
(maybe_memory_address_addr_space_p): ... this. Add ADDSPACE argument.
Use address-space aware variants of memory address routines.
* expr.h (memory_address_addr_space): Add prototype.
(memory_address): Define as macro.
* recog.h (memory_address_addr_space_p): Add prototype.
(memory_address_p): Define as macro.
(offsettable_address_addr_space_p): Add prototype.
(offsettable_address_p): Define as macro.
(strict_memory_address_addr_space_p): Add prototype.
(strict_memory_address_p): Define as macro.
* combine.c (find_split_point): Use address-space aware variants
of memory address routines.
* emit-rtl.c (operand_subword): Likewise.
(change_address_1): Likewise.
(adjust_address_1): Likewise.
(offset_address): Likewise.
* expr.c (emit_move_insn): Likewise.
(expand_assignment): Likewise.
(expand_expr_real_1): Likewise.
* recog.c (verify_changes): Likewise.
(general_operand): Likewise.
(offsettable_memref_p): Likewise.
(offsettable_nonstrict_memref_p): Likewise.
(constrain_operands): Likewise.
* reload.c (get_secondary_mem): Likewise.
(find_reloads_toplev): Likewise.
(find_reloads_address): Likewise.
(find_reloads_subreg_address): Likewise.
* reload1.c (reload): Likewise.
* rtlhooks.c (gen_lowpart_if_possible): Likewise.
* rtl.h (address_cost): Add ADDRSPACE argument.
* rtlanal.c (address_cost): Add ADDRSPACE argument. Use address-space
aware variant of memory address routines.
* loop-invariant.c (create_new_invariant): Update address_cost call.
* tree-ssa-loop-ivopts.c (computation_cost): Likewise.
* fwprop.c (should_replace_address): Add ADDRSPACE argument.
Use address-space aware variant of memory address routines.
(propagate_rtx_1): Update call to should_replace_address.
* tree-flow.h (multiplier_allowed_in_address_p): Add ADDRSPACE
argument.
* tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p): Add
ADDRSPACE argument. Use per-address-space instead of global cache.
Use address-space aware variant of memory address routines.
(get_address_cost): Likewise.
(get_computation_cost_at): Update calls.
* tree-ssa-address.c (valid_mem_ref_p): Add ADDRSPACE argument.
Use address-space aware variant of memory address routines.
(create_mem_ref_raw): Update call to valid_mem_ref_p.
(most_expensive_mult_to_index): Update call to
multiplier_allowed_in_address_p.
* dwarf2out.c (modified_type_die): Output DW_AT_address_class
attribute to indicate named address spaces.
* varasm.c (get_variable_section): DECLs in named address spaces
cannot be "common".
* reload.c (find_reloads_address): Do not use LEGITIMIZE_RELOAD_ADDRESS
for addresses in a non-generic address space.
* expr.c (emit_block_move_hints): Do not use libcalls for
memory in non-generic address spaces.
(clear_storage_hints): Likewise.
(expand_assignment): Likewise.
* fold-const.c (operand_equal_p): Expressions refering to different
address spaces are not equivalent.
* rtl.c (rtx_equal_p_cb): MEMs refering to different address
spaces are not equivalent.
(rtx_equal_p): Likewise.
* cse.c (exp_equiv_p): Likewise.
* jump.c (rtx_renumbered_equal_p): Likewise.
* reload.c (operands_match_p): Likewise.
* alias.c (nonoverlapping_memrefs_p): MEMs refering to different
address spaces may alias.
(true_dependence): Likewise.
(canon_true_dependence): Likewise.
(write_dependence_p): Likewise.
* dse.c (canon_address): Handle named address spaces.
* ifcvt.c (noce_try_cmove_arith): Likewise.
* tree.def (ADDR_SPACE_CONVERT_EXPR): New tree code.
* expr.c (expand_expr_real_2): Expand ADDR_SPACE_CONVERT_EXPR.
* convert.c (convert_to_pointer): Generate ADDR_SPACE_CONVERT_EXPR
to handle conversions between different address spaces.
* fold-const.c (fold_convert_loc): Likewise.
(fold_unary_loc): Handle ADDR_SPACE_CONVERT_EXPR.
* tree-pretty-print.c (dump_generic_node): Likewise.
* gimple-pretty-print.c (dump_unary_rhs): Likewise.
* tree-cfg.c (verify_gimple_assign_unary): Likewise.
* tree-inline.c (estimate_operator_cost): Likewise.
* tree-ssa.c (useless_type_conversion_p): Conversions between pointers
to different address spaces are not useless.
........
r153573 | uweigand | 2009-10-26 15:57:10 -0600 (Mon, 26 Oct 2009) | 137 lines
2009-10-26 Ben Elliston <bje@au.ibm.com>
Michael Meissner <meissner@linux.vnet.ibm.com>
Ulrich Weigand <uweigand@de.ibm.com>
* doc/tm.texi (TARGET_ADDR_SPACE_POINTER_MODE): Document.
(TARGET_ADDR_SPACE_ADDRESS_MODE): Likewise.
(TARGET_ADDR_SPACE_VALID_POINTER_MODE): Likewise.
* target.h (struct target_def): Add pointer_mode, address_mode,
and valid_pointer_mode to addr_space substructure.
* target-def.h (TARGET_ADDR_SPACE_POINTER_MODE): Define.
(TARGET_ADDR_SPACE_ADDRESS_MODE): Likewise.
(TARGET_ADDR_SPACE_VALID_POINTER_MODE): Likewise.
(TARGET_ADDR_SPACE_HOOKS): Add them.
* targhooks.c (target_default_pointer_address_modes_p): New function.
* target.h (target_default_pointer_address_modes_p): Add prototype.
* targhooks.c (default_addr_space_pointer_mode): New function.
(default_addr_space_address_mode): Likewise.
(default_addr_space_valid_pointer_mode): Likewise.
* targhooks.h (default_addr_space_pointer_mode): Add prototype.
(default_addr_space_address_mode): Likewise.
(default_addr_space_valid_pointer_mode): Likewise.
* output.h (default_valid_pointer_mode): Move to ...
* targhooks.h (default_valid_pointer_mode): ... here.
* varasm.c (default_valid_pointer_mode): Move to ...
* targhooks.c (default_valid_pointer_mode): ... here.
* varasm.c (output_constant): Use targetm.addr_space.valid_pointer_mode
instead of targetm.valid_pointer_mode.
* fold-const.c (fit_double_type): Use int_or_pointer_precision.
* tree.c (integer_pow2p): Likewise.
(tree_log2): Likewise.
(tree_floor_log2): Likewise.
(signed_or_unsigned_type_for): Support pointer type of different size.
(int_or_pointer_precision): New function.
* tree.h (int_or_pointer_precision): Add prototype.
* stor-layout.c (layout_type): Set TYPE_PRECISION for offset types.
* varasm.c (initializer_constant_valid_p): Use TYPE_PRECISION of
incoming pointer type instead of POINTER_SIZE.
* tree.c (build_pointer_type): Use appropriate pointer mode
instead of ptr_mode.
(build_reference_type): Likewise.
* expr.c (store_expr): Likewise.
(expand_expr_addr_expr): Likewise.
* tree-vect-data-refs.c (vect_create_data_ref_ptr): Likewise.
* cfgexpand.c (expand_debug_expr): Likewise.
* auto-inc-dec.c: Include "target.h".
(try_merge): Use appropriate address mode instead of Pmode.
(find_inc): Likewise.
* combine.c (find_split_point): Likewise.
* cselib.c (cselib_record_sets): Likewise.
* dse.c (replace_inc_dec): Likewise.
(canon_address): Likewise.
* var-tracking.c (replace_expr_with_values): Likewise.
(count_uses): Likewise.
(add_uses): Likewise.
(add_stores): Likewise.
* emit-rtl.c: Include "target.h".
(adjust_address_1): Use appropriate address mode instead of Pmode.
(offset_address): Likewise.
* explow.c (break_out_memory_refs): Likewise.
(memory_address_addr_space): Likewise.
(promote_mode): Likewise.
* expr.c (move_by_pieces): Likewise.
(emit_block_move_via_loop): Likewise.
(store_by_pieces): Likewise.
(store_by_pieces_1): Likewise.
(expand_assignment): Likewise.
(store_constructor): Likewise.
(expand_expr_addr_expr): Likewise.
(expand_expr_real_1): Likewise.
* cfgexpand.c (expand_debug_expr): Likewise.
* ifcvt.c (noce_try_cmove_arith): Likewise.
* regcprop.c (kill_autoinc_value): Likewise.
* regmove.c (try_auto_increment): Likewise.
* reload.c (find_reloads): Likewise.
(find_reloads_address): Likewise.
(find_reloads_address_1): Likewise.
* sched-deps.c: Include "target.h".
(sched_analyze_1): Use appropriate address mode instead of Pmode.
(sched_analyze_2): Likewise.
* sel-sched-dump.c: Include "target.h".
(debug_mem_addr_value): Use appropriate address mode instead of Pmode.
* stor-layout.c (layout_type): Likewise.
* tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise.
(multiplier_allowed_in_address_p): Likewise.
(get_address_cost): Likewise.
* varasm.c (make_decl_rtl): Likewise.
* expr.c (expand_assignment): Always convert offsets to appropriate
address mode.
(store_expr): Likewise.
(store_constructor): Likewise.
(expand_expr_real_1): Likewise.
* reload.h (form_sum): Add MODE argument.
* reload.c (form_sum): Add MODE argument, use it instead of Pmode.
Update recursive calls.
(subst_indexed_address): Update calls to form_sum.
* tree-flow.h (addr_for_mem_ref): Add ADDRSPACE argument.
* tree-ssa-address.c: Include "target.h".
(templates): Replace by ...
(mem_addr_template_list): ... this new vector.
(TEMPL_IDX): Handle address space numbers.
(gen_addr_rtx): Add address mode argument, use it instead of Pmode.
(addr_for_mem_ref): Add ADDRSPACE argument. Use per-address-space
instead of global cache. Update call to gen_addr_rtx.
(valid_mem_ref_p): Update call to addr_for_mem_ref.
* expr.c (expand_expr_real_1): Update call to addr_for_mem_ref.
* rtl.h (convert_memory_address_addr_space): Add prototype.
(convert_memory_address): Define as macro.
* explow.c (convert_memory_address): Rename to ...
(convert_memory_address_addr_space): ... this. Add ADDRSPACE argument.
Use appropriate pointer and address modes instead of ptr_mode / Pmode.
Update recursive calls.
(memory_address_addr_space): Call convert_memory_address_addr_space.
* expmed.c (make_tree): Likewise.
* expr.c (expand_assignment): Likewise.
(expand_expr_addr_expr_1): Likewise. Also, add ADDRSPACE argument.
(expand_expr_addr_expr): Likewise. Also, update call.
* alias.c (find_base_value): Guard pointer size optimizations.
(find_base_term): Likewise.
* rtlanal.c (nonzero_bits1): Likewise.
(num_sign_bit_copies1): Likewise.
* simplify-rtx.c (simplify_unary_operation_1): Likewise.
* Makefile.in (tree-ssa-address.o): Add $(TARGET_H) dependency.
(emit-rtl.o): Likewise.
(auto-inc-dec.o): Likewise.
(sched-deps.o): Likewise.
........
r153574 | uweigand | 2009-10-26 15:58:06 -0600 (Mon, 26 Oct 2009) | 53 lines
2009-10-26 Ben Elliston <bje@au.ibm.com>
Michael Meissner <meissner@linux.vnet.ibm.com>
Ulrich Weigand <uweigand@de.ibm.com>
* doc/tm.texi (TARGET_ADDR_SPACE_KEYWORDS): Document.
* c-common.c (c_common_reswords): If TARGET_ADDR_SPACE_KEYWORDS is
defined, add the named address space keywords.
(c_addr_space_name): New function.
(complete_array_type): Preserve named address space.
(handle_mode_attribute): Use targetm.addr_space.valid_pointer_mode
instead of targetm.valid_pointer_mode.
* c-common.h (enum rid): Add RID_ADDR_SPACE_0 .. RID_ADDR_SPACE_15,
RID_FIRST_ADDR_SPACE and RID_LAST_ADDR_SPACE.
(ADDR_SPACE_KEYWORD): New macro.
(c_addr_space_name): Add prototype.
* c-tree.h (struct c_declspecs): Add address_space member.
(declspecs_add_addrspace): Add prototype.
* c-pretty-print.c (pp_c_type_qualifier_list): Handle address spaces.
* c-parser.c (c_parse_init): Add assertion.
(typedef enum c_id_kind): Add C_ID_ADDRSPACE.
(c_lex_one_token): Handle address space keywords.
(c_token_starts_typename): Likewise.
(c_token_starts_declspecs): Likewise.
(c_parser_declspecs): Likewise.
(c_parser_postfix_expression_after_paren_type): Diagnose compound
literal within function qualified with named address space.
* c-decl.c (diagnose_mismatched_decls): Diagnose conflicting named
address space qualifiers.
(shadow_tag_warned): Warn about useless address space qualifiers.
(quals_from_declspecs): Handle address space qualifiers.
(grokdeclarator): Likewise.
(build_null_declspecs): Likewise.
(declspecs_add_addrspace): New function.
* c-typeck.c (addr_space_superset): New function.
(qualify_type): Handle named address spaces.
(composite_type): Likewise.
(common_pointer_type): Likewise.
(comp_target_types): Likewise.
(build_conditional_expr): Likewise.
(handle_warn_cast_qual): Likewise.
(build_c_cast): Likewise.
(convert_for_assignment): Likewise.
(build_binary_op): Likewise.
(pointer_diff): Handle named address spaces. Use intermediate
integer type of sufficient size if required.
........
r153575 | uweigand | 2009-10-26 15:59:17 -0600 (Mon, 26 Oct 2009) | 66 lines
2009-10-26 Ben Elliston <bje@au.ibm.com>
Michael Meissner <meissner@linux.vnet.ibm.com>
Ulrich Weigand <uweigand@de.ibm.com>
* config.gcc (spu-*-elf*): Add spu_cache.h to extra_headers.
* config/spu/spu_cache.h: New file.
* config/spu/cachemgr.c: New file.
* config/spu/cache.S: New file.
* config/spu/spu.h (ASM_OUTPUT_SYMBOL_REF): Define.
(ADDR_SPACE_EA): Define.
(TARGET_ADDR_SPACE_KEYWORDS): Define.
* config/spu/spu.c (EAmode): New macro.
(TARGET_ADDR_SPACE_POINTER_MODE): Define.
(TARGET_ADDR_SPACE_ADDRESS_MODE): Likewise.
(TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Likewise.
(TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Likewise.
(TARGET_ADDR_SPACE_SUBSET_P): Likewise.
(TARGET_ADDR_SPACE_CONVERT): Likewise.
(TARGET_ASM_SELECT_SECTION): Likewise.
(TARGET_ASM_UNIQUE_SECTION): Likewise.
(TARGET_ASM_UNALIGNED_SI_OP): Likewise.
(TARGET_ASM_ALIGNED_DI_OP): Likewise.
(ea_symbol_ref): New function.
(spu_legitimate_constant_p): Handle __ea qualified addresses.
(spu_addr_space_legitimate_address_p): New function.
(spu_addr_space_legitimize_address): Likewise.
(cache_fetch): New global.
(cache_fetch_dirty): Likewise.
(ea_alias_set): Likewise.
(ea_load_store): New function.
(ea_load_store_inline): Likewise.
(expand_ea_mem): Likewise.
(spu_expand_mov): Handle __ea qualified memory references.
(spu_addr_space_pointer_mode): New function.
(spu_addr_space_address_mode): Likewise.
(spu_addr_space_subset_p): Likewise.
(spu_addr_space_convert): Likewise.
(spu_section_type_flags): Handle "._ea" section.
(spu_select_section): New function.
(spu_unique_section): Likewise.
* config/spu/spu-c.c (spu_cpu_cpp_builtins): Support __EA32__
and __EA64__ predefined macros.
* config/spu/spu-elf.h (LIB_SPEC): Handle -mcache-size= and
-matomic-updates switches.
* config/spu/t-spu-elf (MULTILIB_OPTIONS): Define.
(EXTRA_MULTILIB_PARTS): Add libgcc_cachemgr.a,
libgcc_cachemgr_nonatomic.a, libgcc_cache8k.a, libgcc_cache16k.a,
libgcc_cache32k.a, libgcc_cache64k.a, libgcc_cache128k.a.
($(T)cachemgr.o, $(T)cachemgr_nonatomic.o): New target.
($(T)cache8k.o, $(T)cache16k.o, $(T)cache32k.o, $(T)cache64k.o,
$(T)cache128k.o): Likewise.
($(T)libgcc_%.a): Likewise.
* config/spu/spu.h (TARGET_DEFAULT): Add MASK_ADDRESS_SPACE_CONVERSION.
* config/spu/spu.opt (-mea32/-mea64): Add switches.
(-maddress-space-conversion): Likewise.
(-mcache-size=): Likewise.
(-matomic-updates): Likewise.
* doc/invoke.texi (-mea32/-mea64): Document.
(-maddress-space-conversion): Likewise.
(-mcache-size=): Likewise.
(-matomic-updates): Likewise.
........
r153576 | uweigand | 2009-10-26 16:00:52 -0600 (Mon, 26 Oct 2009) | 21 lines
2009-10-26 Ben Elliston <bje@au.ibm.com>
Michael Meissner <meissner@linux.vnet.ibm.com>
Ulrich Weigand <uweigand@de.ibm.com>
* gcc.target/spu/ea/ea.exp: New file.
* gcc.target/spu/ea/cache1.c: Likewise.
* gcc.target/spu/ea/cast1.c: Likewise.
* gcc.target/spu/ea/cast2.c: Likewise.
* gcc.target/spu/ea/compile1.c: Likewise.
* gcc.target/spu/ea/compile2.c: Likewise.
* gcc.target/spu/ea/cppdefine.c: Likewise.
* gcc.target/spu/ea/errors1.c: Likewise.
* gcc.target/spu/ea/errors2.c: Likewise.
* gcc.target/spu/ea/execute1.c: Likewise.
* gcc.target/spu/ea/execute2.c: Likewise.
* gcc.target/spu/ea/execute3.c: Likewise.
* gcc.target/spu/ea/ops1.c: Likewise.
* gcc.target/spu/ea/ops2.c: Likewise.
* gcc.target/spu/ea/options1.c: Likewise.
* gcc.target/spu/ea/test-sizes.c: Likewise.
........
Modified:
branches/reload-v2a/ (props changed)
Propchange: branches/reload-v2a/
('svnmerge-integrated' modified)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41785
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/41785] [4.5 Regression] [C++0x] ICE on canonical types with variadic templates and CRTP
2009-10-21 18:46 [Bug c++/41785] New: ICE on canonical types with variadic templates and CRTP alban dot linard at gmail dot com
` (9 preceding siblings ...)
2009-10-29 16:40 ` law at gcc dot gnu dot org
@ 2009-10-30 16:06 ` hjl at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: hjl at gcc dot gnu dot org @ 2009-10-30 16:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from hjl at gcc dot gnu dot org 2009-10-30 16:05 -------
Subject: Bug 41785
Author: hjl
Date: Fri Oct 30 16:04:41 2009
New Revision: 153759
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153759
Log:
2009-10-30 H.J. Lu <hongjiu.lu@intel.com>
Backport from mainline:
2009-10-30 Dodji Seketeli <dodji@redhat.com>
PR c++/41863
* g++.dg/template/sizeof12.C: New test.
2009-10-29 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/41775
* g++.dg/torture/pr41775.C: New testcase.
2009-10-28 Jakub Jelinek <jakub@redhat.com>
PR debug/41801
* g++.dg/ext/sync-3.C: New test.
2009-10-27 Jakub Jelinek <jakub@redhat.com>
PR c++/41020
* g++.dg/lookup/extern-c-redecl5.C: Fix up regexp.
2009-10-26 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/41345
* gcc.dg/pr41345.c: New test.
2009-10-26 Dodji Seketeli <dodji@redhat.com>
PR c++/41785
* g++.dg/cpp0x/variadic96.C: New test.
2009-10-26 Dodji Seketeli <dodji@redhat.com>
PR c++/41020
* g++.dg/lookup/extern-c-redecl2.C: New test.
* g++.dg/lookup/extern-c-redecl3.C: Likewise.
* g++.dg/lookup/extern-c-redecl4.C: Likewise.
* g++.dg/lookup/extern-c-redecl5.C: Likewise.
2009-10-23 Joseph Myers <joseph@codesourcery.com>
PR c/40033
* gcc.dg/noncompile/pr40033-1.c: New test.
2009-10-23 Joseph Myers <joseph@codesourcery.com>
PR c/41673
* gcc.dg/Wstrict-aliasing-bogus-vla-1.c: New test.
2009-10-21 Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/41497
* gcc.dg/tree-ssa/pr41497.c: New.
Added:
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/variadic96.C
- copied unchanged from r153757,
trunk/gcc/testsuite/g++.dg/cpp0x/variadic96.C
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/ext/sync-3.C
- copied unchanged from r153757, trunk/gcc/testsuite/g++.dg/ext/sync-3.C
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/lookup/extern-c-redecl2.C
- copied unchanged from r153757,
trunk/gcc/testsuite/g++.dg/lookup/extern-c-redecl2.C
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/lookup/extern-c-redecl3.C
- copied unchanged from r153757,
trunk/gcc/testsuite/g++.dg/lookup/extern-c-redecl3.C
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/lookup/extern-c-redecl4.C
- copied unchanged from r153757,
trunk/gcc/testsuite/g++.dg/lookup/extern-c-redecl4.C
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/lookup/extern-c-redecl5.C
- copied unchanged from r153757,
trunk/gcc/testsuite/g++.dg/lookup/extern-c-redecl5.C
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/sizeof12.C
- copied unchanged from r153757,
trunk/gcc/testsuite/g++.dg/template/sizeof12.C
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr41775.C
- copied unchanged from r153757,
trunk/gcc/testsuite/g++.dg/torture/pr41775.C
branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-vla-1.c
- copied unchanged from r153758,
trunk/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-vla-1.c
branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/noncompile/pr40033-1.c
- copied unchanged from r153758,
trunk/gcc/testsuite/gcc.dg/noncompile/pr40033-1.c
branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr41345.c
- copied unchanged from r153757, trunk/gcc/testsuite/gcc.dg/pr41345.c
branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/tree-ssa/pr41497.c
- copied unchanged from r153758,
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr41497.c
Modified:
branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41785
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2009-10-30 16:06 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-21 18:46 [Bug c++/41785] New: ICE on canonical types with variadic templates and CRTP alban dot linard at gmail dot com
2009-10-22 9:34 ` [Bug c++/41785] [4.5 Regression] " rguenth at gcc dot gnu dot org
2009-10-22 14:20 ` alban dot linard at gmail dot com
2009-10-22 15:59 ` [Bug c++/41785] [4.5 Regression] [C++0x] " paolo dot carlini at oracle dot com
2009-10-22 16:34 ` hjl dot tools at gmail dot com
2009-10-24 12:00 ` rguenth at gcc dot gnu dot org
2009-10-25 17:47 ` dodji at redhat dot com
2009-10-26 16:04 ` dodji at gcc dot gnu dot org
2009-10-26 18:31 ` dodji at gcc dot gnu dot org
2009-10-26 18:37 ` dodji at gcc dot gnu dot org
2009-10-29 16:40 ` law at gcc dot gnu dot org
2009-10-30 16:06 ` hjl at gcc dot gnu dot org
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).