re PR rtl-optimization/23943 (segv in side_effects_p())

gcc/
	PR rtl-optimization/23943
	* cse.c (find_best_addr): Never propagate an EXPR_LIST rtx.

testsuite/
	* gcc.dg/pr23943.c: New test.

From-SVN: r104413
This commit is contained in:
Steven Bosscher 2005-09-19 05:04:58 +00:00 committed by Steven Bosscher
parent 02c375d90d
commit 31c304baef
4 changed files with 32 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2005-09-19 Steven Bosscher <stevenb@suse.de>
PR rtl-optimization/23943
* cse.c (find_best_addr): Never propagate an EXPR_LIST rtx.
2005-09-18 Jan Hubicka <jh@suse.cz>
* calls.c (flags_from_decl_or_type): Do not set ECF_LIBCALL_BLOCK.

View File

@ -2999,7 +2999,9 @@ find_best_addr (rtx insn, rtx *loc, enum machine_mode mode)
p = p->next_same_value, count++)
if (! p->flag
&& (REG_P (p->exp)
|| exp_equiv_p (p->exp, p->exp, 1, false)))
|| (GET_CODE (p->exp) != EXPR_LIST
&& exp_equiv_p (p->exp, p->exp, 1, false))))
{
rtx new = simplify_gen_binary (GET_CODE (*loc), Pmode,
p->exp, op1);

View File

@ -1,3 +1,7 @@
2005-09-19 Steven Bosscher <stevenb@suse.de>
* gcc.dg/pr23943.c: New test.
2005-09-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/19181

View File

@ -0,0 +1,20 @@
/* This used to ICE in side_effects_p, due to a problem in cse.c.
Origin: marcus at jet dot franken dot de. */
/* { dg-do compile { target x86_64-*-* } } */
/* { dg-options "-O2 -fPIC" } */
typedef long unsigned int size_t;
extern size_t strlen (__const char *__s)
__attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
static char savecallsin[256] = "";
int read_agent_config(void)
{
savecallsin[0] = '\0';
if (savecallsin[strlen(savecallsin) - 1] != '/')
__builtin___strncat_chk (savecallsin, "/", sizeof(savecallsin) - strlen(savecallsin) - 1, __builtin_object_size (savecallsin, 2 > 1)) ;
return 0;
}