Commit d491d2af by Richard Guenther Committed by Richard Biener

re PR rtl-optimization/43438 (possible wrong code bug)

2010-03-20  Richard Guenther  <rguenther@suse.de>

	PR rtl-optimization/43438
	* combine.c (make_extraction): Properly zero-/sign-extend an
	extraction of the low part of a CONST_INT.  Also handle
	CONST_DOUBLE.

	* gcc.c-torture/execute/pr43438.c: New testcase.

From-SVN: r157592
parent 39bac010
2010-03-20 Richard Guenther <rguenther@suse.de>
PR rtl-optimization/43438
* combine.c (make_extraction): Properly zero-/sign-extend an
extraction of the low part of a CONST_INT. Also handle
CONST_DOUBLE.
2010-03-19 Mike Stump <mikestump@comcast.net>
* config/i386/darwin.h (SUBTARGET32_DEFAULT_CPU): Add.
......
......@@ -6793,8 +6793,10 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos,
if (mode == tmode)
return new_rtx;
if (CONST_INT_P (new_rtx))
return gen_int_mode (INTVAL (new_rtx), mode);
if (CONST_INT_P (new_rtx)
|| GET_CODE (new_rtx) == CONST_DOUBLE)
return simplify_unary_operation (unsignedp ? ZERO_EXTEND : SIGN_EXTEND,
mode, new_rtx, tmode);
/* If we know that no extraneous bits are set, and that the high
bit is not set, convert the extraction to the cheaper of
......
2010-03-20 Richard Guenther <rguenther@suse.de>
PR rtl-optimization/43438
* gcc.c-torture/execute/pr43438.c: New testcase.
2010-03-20 Dodji Seketeli <dodji@redhat.com>
PR c++/43375
......
extern void abort (void);
static unsigned char g_2 = 1;
static int g_9;
static int *l_8 = &g_9;
static void func_12(int p_13)
{
int * l_17 = &g_9;
*l_17 &= 0 < p_13;
}
int main(void)
{
unsigned char l_11 = 254;
*l_8 |= g_2;
l_11 |= *l_8;
func_12(l_11);
if (g_9 != 1)
abort ();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment