backport: re PR c/40172 (Revision 147596 breaks bootstrap)

2009-05-19  H.J. Lu  <hongjiu.lu@intel.com>

	Backport from mainline:
	2009-05-19  H.J. Lu  <hongjiu.lu@intel.com>

	PR c/40172
	* gcc.dg/pr40172-1.c: New.
	* gcc.dg/pr40172-2.c: Likewise.
	* gcc.dg/pr40172-3.c: Likewise.

From-SVN: r147720
This commit is contained in:
H.J. Lu 2009-05-19 21:24:23 +00:00 committed by H.J. Lu
parent 892937665d
commit f83489c5f8
4 changed files with 73 additions and 0 deletions

View File

@ -1,3 +1,13 @@
2009-05-19 H.J. Lu <hongjiu.lu@intel.com>
Backport from mainline:
2009-05-19 H.J. Lu <hongjiu.lu@intel.com>
PR c/40172
* gcc.dg/pr40172-1.c: New.
* gcc.dg/pr40172-2.c: Likewise.
* gcc.dg/pr40172-3.c: Likewise.
2009-05-19 Richard Guenther <rguenther@suse.de>
* gcc.c-torture/compile/20090519-1.c: New testcase.

View File

@ -0,0 +1,31 @@
/* PR middle-end/40172 */
/* { dg-do compile } */
/* { dg-options "-Wall -W -Werror -Wlogical-op" } */
struct rtx_def;
typedef struct rtx_def *rtx;
extern int foo;
extern int bar;
extern int xxx;
int
test (void)
{
if (((rtx) 0 != (rtx) 0) && xxx ? foo : bar)
return 1;
else if ((foo & 0) && xxx)
return 2;
else if (foo & 0)
return 3;
else if (0 && xxx)
return 4;
else if (0)
return 5;
if (((int) 0 != (int) 0) && bar ? foo : xxx)
return 6;
else if (0 != 0 && foo ? xxx : bar)
return 7;
else
return 0;
}

View File

@ -0,0 +1,16 @@
/* PR middle-end/40172 */
/* { dg-do compile } */
/* { dg-options "-Wall -W -Werror" } */
extern int xxx;
#define XXX xxx
int
test (void)
{
if (!XXX && xxx)
return 4;
else
return 0;
}

View File

@ -0,0 +1,16 @@
/* PR middle-end/40172 */
/* { dg-do compile */
/* { dg-options "-Wall -W -Werror -Wlogical-op" } */
extern int xxx;
#define XXX xxx
int
test (void)
{
if (!XXX && xxx)
return 4;
else
return 0;
}