Consider associate_trees being called with
(gdb) call debug_tree(t1)
<integer_cst 0xb7c8b450 type <integer_type 0xb7c9b2e0 unsigned int> constant
invariant 4294967295>
(gdb) call debug_tree(t2)
<integer_cst 0xb7c8ba38 type <integer_type 0xb7c9b284 int> constant invariant
1>
(gdb) call debug_tree(type)
<integer_type 0xb7c9b284 int sizes-gimplified public SI
size <integer_cst 0xb7c8b3f0 type <integer_type 0xb7c9b05c bit_size_type>
constant invariant 32>
unit size <integer_cst 0xb7c8b180 type <integer_type 0xb7c9b000 unsigned
int> constant invariant 4>
align 32 symtab 0 alias set -1 precision 32 min <integer_cst 0xb7c8b3a8
-2147483648> max <integer_cst 0xb7c8b3c0 2147483647>
pointer_to_this <pointer_type 0xb7c9bc38>>
(gdb) print code
$15 = PLUS_EXPR
we return via
return fold_build2 (code, type, fold_convert (type, t1),
fold_convert (type, t2));
where fold_build2 gets called with
(gdb) down
#1 0x083b401f in fold_build2_stat (code=PLUS_EXPR, type=0xb7c9b284,
op0=0xb7d26558, op1=0xb7c8ba38)
at /space/rguenther/src/svn/gcc/gcc/fold-const.c:11134
11134 tem = fold_binary (code, type, op0, op1);
(gdb) call debug_tree(op0)
<integer_cst 0xb7d26558 type <integer_type 0xb7c9b284 int> constant invariant
public static overflow -1>
(gdb) call debug_tree(op1)
<integer_cst 0xb7c8ba38 type <integer_type 0xb7c9b284 int> constant invariant
1>
--
Summary: fold-const.c:associate_trees produces constants with
overflow flag set
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rguenth at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27018