re PR middle-end/40035 (ICE when cross-compiling with -Os)

PR middle-end/40035
	* dse.c (check_mem_read_rtx): Guard against width == -1.
testsuite/
	* gcc.c-torture/compile/pr40035.c: New test.

From-SVN: r147498
This commit is contained in:
Ben Elliston 2009-05-14 06:52:00 +10:00
parent a513927a5b
commit efc3527add
4 changed files with 32 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2009-05-13 Jakub Jelinek <jakub@redhat.com>
Ben Elliston <bje@au.ibm.com>
PR middle-end/40035
* dse.c (check_mem_read_rtx): Guard against width == -1.
2009-05-13 Michael Matz <matz@suse.de>
PR middle-end/39976

View File

@ -2245,6 +2245,7 @@ check_mem_read_rtx (rtx *loc, void *data)
if (store_info->rhs
&& store_info->group_id == -1
&& store_info->cse_base == base
&& width != -1
&& offset >= store_info->begin
&& offset + width <= store_info->end
&& all_positions_needed_p (store_info,

View File

@ -1,3 +1,8 @@
2009-05-14 Ben Elliston <bje@au.ibm.com>
PR middle-end/40035
* gcc.c-torture/compile/pr40035.c: New test.
2009-05-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.target/i386/pr39543-2.c: Skip if ilp32 && pic.
@ -9,7 +14,6 @@
* gfortran.dg/c_kind_tests_2.f03: Ditto.
* gfortran.dg/interop_params.f03: Ditto.
2009-05-12 Jan Hubicka <jh@suse.cz>
* gcc.dg/tree-ssa/loop-36.c: Reduce amount of iterations to 2 so unrolling

View File

@ -0,0 +1,20 @@
typedef __SIZE_TYPE__ size_t;
void *memmove (void *dest, const void *src, size_t count);
size_t strlen (const char *s);
int
foo (char *param, char *val)
{
if (val)
{
if (val == param + strlen (param) + 1)
val[-1] = '=';
else if (val == param + strlen (param) + 2)
{
val[-2] = '=';
memmove (val - 1, val, strlen (val) + 1);
val--;
}
}
return 0;
}