This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/33122] Mistaken type mismatch error prevents bootstrap
- 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: 20 Aug 2007 15:30:51 -0000
- Subject: [Bug c/33122] Mistaken type mismatch error prevents bootstrap
- References: <bug-33122-622@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 2007-08-20 15:30 -------
Reduced testcase:
struct dis386 {
const char *x;
};
static const struct dis386 float_reg[][2] = {
{ { "fadd" }, { "fadd" } },
};
void foo(int i, int j)
{
const struct dis386 *dp;
dp = &float_reg[i - 1][j];
}
Note that with &float_reg[i][j] it works just fine. The fronted generates
dp = &float_reg + (((long unsigned int) ((long unsigned int) i * 2) + (long
unsigned int) (long unsigned int) j) * 8 + 0xfffffffffffffffffffffffffffffff0);
which has a missing conversion to (struct dis386 *). Without the
subtraction in the first array ref we get
dp = (struct dis386 *) &float_reg + ((long unsigned int) ((long unsigned int)
i * 2) + (long unsigned int) (long unsigned int) j) * 8;
instead, which is correct.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Component|bootstrap |c
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-08-20 15:30:51
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33122