Commit 6dc208a1 by Eric Botcazou Committed by Eric Botcazou

re PR rtl-optimization/11210 (optimizer drops conditional with typecast from…

re PR rtl-optimization/11210 (optimizer drops conditional with typecast from signed to unsigned char)

	PR optimization/11210
	* fold-const (decode_field_reference): Strip only NOPs that
	don't affect the sign.

From-SVN: r68524
parent fc5eb4a1
2003-06-26 Eric Botcazou <ebotcazou@libertysurf.fr>
PR optimization/11210
* fold-const (decode_field_reference): Strip only NOPs that
don't affect the sign.
2003-06-26 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
* gcc/config/sh/sh.md (push_fpscr): Enable for TARGET_SH2E.
......
......@@ -2742,7 +2742,8 @@ decode_field_reference (exp, pbitsize, pbitpos, pmode, punsignedp,
if (! INTEGRAL_TYPE_P (TREE_TYPE (exp)))
return 0;
STRIP_NOPS (exp);
/* Signedness matters here. */
STRIP_SIGN_NOPS (exp);
if (TREE_CODE (exp) == BIT_AND_EXPR)
{
......
2003-06-26 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/20030626-1.c: New test.
2003-06-26 Neil Booth <neil@daikokuya.co.uk>
* const-str-2.m: Update.
......
/* PR optimization/11210 */
/* Originator: Guido Classen <guido@clagi.de> */
/* Reduced testcase by Falk Hueffner <falk@debian.org> */
/* { dg-do compile } */
/* { dg-options "-O" } */
/* Verify that the constant expressions folder doesn't
throw away the cast operation in the comparison. */
struct str {
int head;
char data[8];
};
int foo(struct str t)
{
return t.data[0] || (unsigned char) t.data[2] != 130; /* { dg-bogus "comparison is always 1" } */
}
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