This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/34774] [4.1/4.2/4.3 Regression] templates, enumerations, overflow, ice
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jan 2008 19:17:47 -0000
- Subject: [Bug c++/34774] [4.1/4.2/4.3 Regression] templates, enumerations, overflow, ice
- References: <bug-34774-9709@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from rguenth at gcc dot gnu dot org 2008-01-13 19:17 -------
This is the same issue as PR31714 (which occurs only on the 4.1 branch).
#0 0x084c1ddd in operand_equal_p (arg0=0xb7d275b0, arg1=0xb7d275cc, flags=0)
at /home/richard/src/trunk/gcc/fold-const.c:3015
#1 0x084c4664 in operand_equal_p (arg0=0xb7d23be0, arg1=0xb7d23c20, flags=0)
at /home/richard/src/trunk/gcc/fold-const.c:3157
#2 0x084c48d0 in operand_equal_p (arg0=0xb7d2806c, arg1=0xb7d28090, flags=0)
at /home/richard/src/trunk/gcc/fold-const.c:3162
#3 0x0853fcb1 in fold_ternary (code=COND_EXPR, type=0xb7c84548,
op0=0xb7d25550, op1=0xb7d2806c, op2=0xb7d28090)
at /home/richard/src/trunk/gcc/fold-const.c:13018
#4 0x08543a00 in fold_build3_stat (code=COND_EXPR, type=0xb7c84548,
op0=0xb7d25550, op1=0xb7d2806c, op2=0xb7d28090)
at /home/richard/src/trunk/gcc/fold-const.c:13717
#5 0x084e1cc7 in fold_binary_op_with_conditional_arg (code=GT_EXPR,
type=0xb7c84548, op0=0xb7c7f280, op1=0xb7d2747c, cond=0xb7c7f280,
arg=0xb7d2747c, cond_first_p=1)
at /home/richard/src/trunk/gcc/fold-const.c:6398
#6 0x08506c18 in fold_binary (code=GT_EXPR, type=0xb7c84548, op0=0xb7c7f280,
op1=0xb7d2747c) at /home/richard/src/trunk/gcc/fold-const.c:9532
#7 0x08543530 in fold (expr=0xb7d28048)
at /home/richard/src/trunk/gcc/fold-const.c:13331
#8 0x0826d088 in fold_if_not_in_template (expr=0xb7d28048)
at /home/richard/src/trunk/gcc/cp/tree.c:2728
#9 0x081f7043 in build_binary_op (code=GT_EXPR, orig_op0=0xb7c7f280,
(gdb) call debug_tree (arg0)
<tree_list 0xb7d275b0
value <negate_expr 0xb7d23c00
type <integer_type 0xb7c842d8 int public type_6 SI
size <integer_cst 0xb7c73620 constant invariant 32>
unit size <integer_cst 0xb7c7340c constant invariant 4>
align 32 symtab 0 alias set -1 canonical type 0xb7c842d8 precision
32 min <integer_cst 0xb7c735cc -2147483648> max <integer_cst 0xb7c735e8
2147483647>
pointer_to_this <pointer_type 0xb7c8d8f0>>
arg 0 <template_parm_index 0xb7c78e34 type <integer_type 0xb7c842d8
int>
readonly constant invariant
index 0 level 1 orig_level 1>>>
we leak template args to middle-end fold.
3.3 emits an error:
mf/unit.h: In instantiation of `metafloat::core::helpers::details::aligner<7,
metafloat::core::float_t<0, 0, 0, CAT_NRM> >':
mf/unit.h:108: instantiated from
`metafloat::core::helpers::details::normalizer<7,
metafloat::core::helpers::details::aligner<7, metafloat::core::float_t<0, 0, 0,
CAT_NRM> > >'
metafloat.h:135: instantiated from `metafloat::core::helpers::normalizer<7,
metafloat::core::float_t<0, 0, 0, CAT_NRM>, true>'
metafloat.h:135: instantiated from `metafloat::core::ops::add<F0, F1>'
tf.cc:59: instantiated from here
mf/unit.h:84: error: no integral type can represent all of the enumerator
values for `metafloat::core::helpers::details::aligner<7,
metafloat::core::float_t<0, 0, 0, CAT_NRM> >::<anonymous enum>'
reducing.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu dot
| |org
OtherBugsDependingO| |31714
nThis| |
Keywords| |ice-on-invalid-code
Known to fail| |3.4.6 4.1.3 4.3.0
Known to work| |3.3.6
Priority|P3 |P4
Summary|templates, enumerations, |[4.1/4.2/4.3 Regression]
|overflow, ice |templates, enumerations,
| |overflow, ice
Target Milestone|--- |4.1.3
Version|unknown |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34774