Check zero/sign extended hard registers.

gcc/

2011-03-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/47725
	* combine.c (cant_combine_insn_p): Check zero/sign extended
	hard registers.

gcc/testsuite/

2011-03-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/47725
	* gcc.dg/torture/pr47725.c: New.

From-SVN: r171124
This commit is contained in:
H.J. Lu 2011-03-18 00:29:15 +00:00 committed by H.J. Lu
parent 98aa09c6b1
commit 7606976434
4 changed files with 33 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2011-03-17 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/47725
* combine.c (cant_combine_insn_p): Check zero/sign extended
hard registers.
2011-03-17 Anatoly Sokolov <aesok@post.ru>
* config/v850/v850.h (OUTPUT_ADDR_CONST_EXTRA): Remove.

View File

@ -2137,6 +2137,12 @@ cant_combine_insn_p (rtx insn)
return 0;
src = SET_SRC (set);
dest = SET_DEST (set);
if (GET_CODE (src) == ZERO_EXTEND
|| GET_CODE (src) == SIGN_EXTEND)
src = XEXP (src, 0);
if (GET_CODE (dest) == ZERO_EXTEND
|| GET_CODE (dest) == SIGN_EXTEND)
dest = XEXP (dest, 0);
if (GET_CODE (src) == SUBREG)
src = SUBREG_REG (src);
if (GET_CODE (dest) == SUBREG)

View File

@ -1,3 +1,8 @@
2011-03-17 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/47725
* gcc.dg/torture/pr47725.c: New.
2011-03-17 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/constexpr-overflow2.C: New.

View File

@ -0,0 +1,16 @@
/* { dg-do compile } */
struct _Unwind_Context
{
void *reg[17];
void *ra;
};
extern void bar (struct _Unwind_Context *);
void
__frame_state_for (void *pc_target)
{
struct _Unwind_Context context;
__builtin_memset (&context, 0, sizeof (struct _Unwind_Context));
context.ra = pc_target;
bar (&context);
}