2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-03-21 10:20:29 +08:00

cfgexpand.c (expand_debug_expr): Fail if bitpos < 0 for non-MEM op0.

* cfgexpand.c (expand_debug_expr): Fail if bitpos < 0 for non-MEM
	op0.

	* gcc.dg/debug/vta-3.c: New test.

From-SVN: r152972
This commit is contained in:
Jakub Jelinek 2009-10-19 09:39:43 +02:00
parent 69925f6ce8
commit 2d3fc6aafc
4 changed files with 30 additions and 1 deletions
gcc

@ -1,4 +1,9 @@
2009-10-17 Andy Hutchinson <hutchinsonandy@gcc.gnu.org>
2009-10-19 Jakub Jelinek <jakub@redhat.com>
* cfgexpand.c (expand_debug_expr): Fail if bitpos < 0 for non-MEM
op0.
2009-10-17 Andy Hutchinson <hutchinsonandy@gcc.gnu.org>
PR middle-end/41738
* optabs.c (expand_binop): Make mode of shift count expression mode

@ -2593,6 +2593,9 @@ expand_debug_expr (tree exp)
if (bitpos == 0 && mode == GET_MODE (op0))
return op0;
if (bitpos < 0)
return NULL;
if ((bitpos % BITS_PER_UNIT) == 0
&& bitsize == GET_MODE_BITSIZE (mode1))
{

@ -1,3 +1,7 @@
2009-10-19 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/debug/vta-3.c: New test.
2009-10-17 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/nested_proc.adb: Rename into...

@ -0,0 +1,17 @@
/* { dg-do compile } */
int
foo (void)
{
union { char e[8]; int i; } a, b;
char *c, *d;
unsigned int i;
c = a.e;
d = &b.e[sizeof (int) - 1];
for (i = 0; i < sizeof (int); i++)
{
*d = *c++;
--d;
}
return b.i;
}