This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Expression with 2 operations
- From: "Sebastian Pop" <sebastian dot pop at inria dot fr>
- To: "Antoine Eiche" <antoine dot eiche at ulp dot u-strasbg dot fr>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 6 May 2007 16:18:10 -0400
- Subject: Re: Expression with 2 operations
- References: <463A5A61.6000607@ulp.u-strasbg.fr>
Hi,
Antoine Eiche <antoine.eiche@ulp.u-strasbg.fr> wrote:
Why can I not do "foo(a + i * x)" then I can do "foo(i * x)" ou "foo(a + i)" ?*
[...]
When a try to compile a program gcc answer:
"
tab.c:22: erreur: invalid operand to binary operator
i_28 * 4;
tab.c:22: erreur interne du compilateur: verify_stmts failed
"
[...]
This is the debug_tree() of new_rhs :
<plus_expr 0x403f6520
type <integer_type 0x403532d8 int sizes-gimplified public SI
size <integer_cst 0x40342348 constant invariant 32>
unit size <integer_cst 0x40342180 constant invariant 4>
align 32 symtab 0 alias set 3 canonical type 0x403532d8
precision 32 min <integer_cst 0x40342300 -2147483648> max <integer_cst
0x40342318 2147483647>
pointer_to_this <pointer_type 0x4035a680>>
arg 0 <mult_expr 0x403f6500 type <integer_type 0x403532d8 int>
arg 0 <ssa_name 0x403ead20 type <integer_type 0x403532d8 int>
You are in gimple form, so you have to build 3-address code: with temporary
variables, you want for "foo(a + i * x)" the following code:
t0 = i * x
t1 = a + t0
foo (t1)
I hope this helps you solving the ICEs that you saw,
Sebastian