This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/47148] [4.6 Regression] likely wrong code bug
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 1 Jan 2011 20:07:40 +0000
- Subject: [Bug tree-optimization/47148] [4.6 Regression] likely wrong code bug
- Auto-submitted: auto-generated
- References: <bug-47148-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47148
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Keywords| |wrong-code
Last reconfirmed| |2011.01.01 20:07:21
Component|c |tree-optimization
CC| |hubicka at gcc dot gnu.org,
| |jakub at gcc dot gnu.org
Ever Confirmed|0 |1
Summary|likely wrong code bug |[4.6 Regression] likely
| |wrong code bug
Target Milestone|--- |4.6.0
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-01 20:07:21 UTC ---
/* PR tree-optimization/47148 */
static inline unsigned
bar (unsigned x, unsigned y)
{
if (y >= 32)
return x;
else
return x >> y;
}
static unsigned a = 1, b = 1;
static inline void
foo (unsigned char x, unsigned y)
{
if (!y)
return;
unsigned c = (0x7000U / (x - 2)) ^ a;
unsigned d = bar (a, a);
b &= ((a - d) && (a - 1)) + c;
}
int
main (void)
{
foo (1, 1);
foo (-1, 1);
if (b && ((unsigned char) -1) == 255)
__builtin_abort ();
return 0;
}
Indeed, seems to be caused by partial inlining. With -fno-partial-inlining it
works fine.