From: H.J. Lu Date: Fri, 18 Mar 2011 00:29:15 +0000 (+0000) Subject: Check zero/sign extended hard registers. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=76069764344e8637046fa002ad98108a24b00271;p=gcc.git Check zero/sign extended hard registers. gcc/ 2011-03-17 H.J. Lu PR middle-end/47725 * combine.c (cant_combine_insn_p): Check zero/sign extended hard registers. gcc/testsuite/ 2011-03-17 H.J. Lu PR middle-end/47725 * gcc.dg/torture/pr47725.c: New. From-SVN: r171124 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8fe2386135f..81498ff4c96 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-03-17 H.J. Lu + + PR middle-end/47725 + * combine.c (cant_combine_insn_p): Check zero/sign extended + hard registers. + 2011-03-17 Anatoly Sokolov * config/v850/v850.h (OUTPUT_ADDR_CONST_EXTRA): Remove. diff --git a/gcc/combine.c b/gcc/combine.c index f9d33b3d539..67aecf15100 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -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) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c72c0e48cd1..51f748c2e22 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-03-17 H.J. Lu + + PR middle-end/47725 + * gcc.dg/torture/pr47725.c: New. + 2011-03-17 Jason Merrill * g++.dg/cpp0x/constexpr-overflow2.C: New. diff --git a/gcc/testsuite/gcc.dg/torture/pr47725.c b/gcc/testsuite/gcc.dg/torture/pr47725.c new file mode 100644 index 00000000000..03d5d36c321 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr47725.c @@ -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); +}