This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/14092] New: fold strips conversion from pointer to integer
- From: "bonzini at gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Feb 2004 09:26:42 -0000
- Subject: [Bug middle-end/14092] New: fold strips conversion from pointer to integer
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
In the attached test case, fold invalidly changes this tree:
----
<negate_expr 0x402012e4
type <integer_type 0x401604a4 int SI
size <integer_cst 0x4015e21c constant 32>
unit size <integer_cst 0x4015e2a8 constant 4>
align 32 symtab 0 alias set -1 precision 32 min <integer_cst
0x4015e280 -2147483648> max <integer_cst 0x4015e294 2147483647>
pointer_to_this <pointer_type 0x40166ca8>>
arg 0 <nop_expr 0x402012a8 type <integer_type 0x401604a4 int>
arg 0 <plus_expr 0x40168300 type <pointer_type 0x4020206c>
arg 0 <nop_expr 0x4020126c type <pointer_type 0x4020206c>
arg 0 <non_lvalue_expr 0x4020121c type <pointer_type
0x401ffd80>
arg 0 <parm_decl 0x401ffdec plci>>>
arg 1 <integer_cst 0x40201258 constant 1>>>>
----
to this tree:
----
<minus_expr 0x40168318
type <pointer_type 0x4020206c
type <array_type 0x401ffbd0 type <integer_type 0x401602f4 unsigned
char>
QI
size <integer_cst 0x4015e8fc constant 8>
unit size <integer_cst 0x4015e7d0 constant 1>
align 8 symtab 0 alias set -1 domain <integer_type 0x4016a360>
pointer_to_this <pointer_type 0x4020206c>>
unsigned SI
size <integer_cst 0x4015e7e4 constant 32>
unit size <integer_cst 0x4015e834 constant 4>
align 32 symtab 0 alias set -1>
arg 0 <integer_cst 0x402012f8 type <pointer_type 0x4020206c> constant
4294967295>
arg 1 <nop_expr 0x4020126c type <pointer_type 0x4020206c>
arg 0 <non_lvalue_expr 0x4020121c type <pointer_type 0x401ffd80>
arg 0 <parm_decl 0x401ffdec plci>>>>
----
the type is wrong: the former is an integer, the latter is a pointer.
I'm CCing Roger because I suspect it is caused by his fold_convert changes
(did not try it though).
--
Summary: fold strips conversion from pointer to integer
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bonzini at gnu dot org
CC: gcc-bugs at gcc dot gnu dot org,roger at eyesopen dot
com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14092